User count mismatch Analysis
Closed this issue · 1 comments
sachsk commented
FD ticket: https://avni.freshdesk.com/a/tickets/3255
Context
In the Classroom Observations Trackers (State Level) [AP Teach] when we add date filter count of Users are not matching with the total users (Userwise Observation Count + Userwise Observation not Done Count)
vedfordev commented
Notes :
Userwise Observation Count
in this we findout that some users check not provided so we added that
Backup query:
-- Note: Unless you save your query, these tabs will NOT persist if you clear your cookies or change browsers.
SELECT users.username, "District", users.name as "name",
users.phone_number as mobile_number,
"Mandal" as mandal,
"Complex" as complex,
"School" as school,
obs.id, obs.encounter_date_time,
"Type of School" as school_type,
primary_status,
secondary_status
from teachap.teacher_observation obs
inner join teachap.teacher t on t.id = obs.individual_id
inner join address on t.address_id = address.id
inner join users on users.id = obs.last_modified_by_id
inner join user_status us on us.user_id = users.id
where obs.encounter_date_time is not null
and obs.is_voided = false
and t.is_voided = false
-- and users.is_voided = false
Userwise Observation not Done Count
Analysis:
- In this card we find out that time filter is currently not working as no encounter_date_time available.
- So we have to pass it into inside query
- Logic for this component should be users which don't have encounters or don't have encounter between that time frame