-
-
Notifications
You must be signed in to change notification settings - Fork 519
Metrics [prod]
compwron edited this page May 20, 2021
·
31 revisions
https://firelemons.github.io/casaMetricsComparison/
- case contact count per org https://data.heroku.com/dataclips/idfolumrbaubogbmewdoeyahhdtj
select casa_case_id, count(*)
from case_contacts
join casa_cases on case_contacts.casa_case_id = casa_cases.id
group by casa_case_id
- volunteers assigned to supervisors per org https://data.heroku.com/dataclips/ymbdlyldhiiqcmsslbjfjdjmzwco
select casa_org_id, count(distinct volunteer_id)
from (
select casa_org_id, volunteer_id
from supervisor_volunteers
join users on supervisor_volunteers.volunteer_id = users.id
where users.type = 'Volunteer'
and users.active = true
and supervisor_volunteers.is_active = true
group by users.casa_org_id, volunteer_id
) x
group by casa_org_id
- volunteer invitations accepted per org https://data.heroku.com/dataclips/ibzctyhepsfsgpiobxrltuhejxds
select casa_org_id, invitation_accepted_at is not NULL as accepted, count(*)
from users
group by casa_org_id, invitation_accepted_at is not NULL
- number of notifications by org https://data.heroku.com/dataclips/xsikhducnqfdrmfcntvdhtehuuwp
select users.casa_org_id, count(*)
from notifications
join users on recipient_id = users.id
group by users.casa_org_id
-
cases with emancipation entries per org https://data.heroku.com/dataclips/cnluraqwatwiupkkhkpueonwqcfz
-
cases with mandates per org https://data.heroku.com/dataclips/fairemyutljnkjgwldlaqtpecvvt
-
total hours in case contacts for ALL orgs https://data.heroku.com/dataclips/vgblwvzhclatsdxzdbihypqulckq
-
x case contacts by y volunteers per casa org https://data.heroku.com/dataclips/zjwklxzqruwfquvzbsovbsodipqd
select casa_org_id, sum(volunteer_count), sum(case_contacts_count)
from (
select casa_cases.casa_org_id,
count(distinct case_assignments.volunteer_id) as volunteer_count,
count(*) as case_contacts_count
from case_contacts
join casa_cases
on case_contacts.casa_case_id = casa_cases.id
join case_assignments on casa_cases.id = case_assignments.casa_case_id
where case_contacts.created_at > NOW() - INTERVAL '14 days'
group by casa_cases.casa_org_id, case_assignments.volunteer_id
order by casa_cases.casa_org_id
) as x
group by casa_org_id