avniproject / calcutta-kids

0 stars 0 forks source link

CK 2024: Metabase Dashboard: Vaccination Bar Graphs and Pie Chart calculation to be checked #263

Closed AnjaliBhagabati closed 1 month ago

AnjaliBhagabati commented 1 month ago

Technical differences

Screenshot 2024-09-27 at 11.18.22 AM.png
nupoorkhandelwal commented 1 month ago

For 1st Bar graph following should be the base query in order to match the result - with data as ( select i.id as "IndividualID", "Area", concat(i.first_name, ' ', i.last_name) as "Full Name", ir.afull_name as "Mother's Name", ci.item_detail_name as "Vaccination", ci.completion_date as "Completion Date", case when ci.completion_date between {{start_date}}::timestamp and {{end_date}}::timestamp + interval '1' day then 'Yes' else 'No' end as "Completed during time period" from checklist_item_checklist_view ci join checklist c on ci.checklist_id = c.id join program_enrolment_view pe on pe.id = ci.program_enrolment_id join public.individual i on i.id = pe.individual_id left join individual_name_relationship_view ir on ir.individual_b_id = i.id and ir.a_is_to_b = 'mother' join calcutta_kids.address a on i.address_id = a.id where ci.item_detail_state = 'Due' and c.is_voided = false and ci.completion_date is not null and ((interval '1' day COALESCE(ci.expires_after, 36500) + date(ci.base_date)) > {{end_date}}::timestamp) and ci.completion_date between {{start_date}}::timestamp and {{end_date}}::timestamp + interval '1' day ) select count() filter (where "Completed during time period" = 'Yes') from data

AnjaliBhagabati commented 1 month ago

Closing this card as they are correct. We’ve added detailed descriptions within the CK Dashboard 2024 for each indicator to enhance clarity. cc: @nupoorkhandelwal @pkundu