Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add new admin reports #1326

Merged
merged 1 commit into from May 12, 2021
Merged

Add new admin reports #1326

merged 1 commit into from May 12, 2021

Conversation

TaiWilkin
Copy link
Contributor

Overview

With the new round of funding from Laudes Foundation, the KPIs we are tracking and reporting on have changed. There is a new set of monthly reports needed.

  1. percent of facilities contributed by OAR and percent of facilities contributed by industry
  2. percent of facilities contributed by each contributor type (non public sources)
  3. percent of facilities contributed via API
  4. percentage of facilities with more than one affiliation
  5. average number of affiliations per facility

Connects #1306

Demo

Screen Shot 2021-05-04 at 3 01 09 PM

Screen Shot 2021-05-04 at 3 02 51 PM

Screen Shot 2021-05-04 at 3 03 27 PM

Screen Shot 2021-05-04 at 3 04 08 PM

Screen Shot 2021-05-04 at 3 04 35 PM

Testing Instructions

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work on some very intense queries. I have a few suggestions for updates and would like to walk through percent_facilities_with_multiple_matches.sql on a Meet with you.

src/django/api/reports/average_affiliations.sql Outdated Show resolved Hide resolved
src/django/api/reports/industry_data_vs_oar_data.sql Outdated Show resolved Hide resolved
src/django/api/reports/percent_data_by_source_type.sql Outdated Show resolved Hide resolved
src/django/api/reports/percent_data_by_source_type.sql Outdated Show resolved Hide resolved
Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the updates ran the reports on production, and put the report results in a document. The results match my expectations.

Thank you for pairing with me to work through these queries together. I learned a new technique in the process.

@@ -0,0 +1,18 @@
SELECT
fm.month,
(COUNT(CASE WHEN fm.is_public_list THEN 1 ELSE NULL END)*100)/COUNT(*) AS oar_data,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that these two columns are not adding up to 100 when we do integer division. I think we should apply the same CAST and ROUND approach that we have used on our other percentage reports here.

@TaiWilkin TaiWilkin merged commit 5f1dee0 into develop May 12, 2021
@TaiWilkin TaiWilkin deleted the tw/add-new-reports branch May 12, 2021 12:50
@jwalgran jwalgran added the task 025 Small features, bug fixes, and other unplanned tasks Q2 2021 label May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
task 025 Small features, bug fixes, and other unplanned tasks Q2 2021
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants