Skip to content

Commit

Permalink
[OSDEV-974] Create report contributor type by percent (#166)
Browse files Browse the repository at this point in the history
[OSDEV-974](https://opensupplyhub.atlassian.net/browse/OSDEV-974)

Replaced the correct function name

---------

Co-authored-by: Inessa Druzhkova <inessadruzkova@Inessas-MacBook-Pro.local>
  • Loading branch information
Innavin369 and Inessa Druzhkova authored Apr 15, 2024
1 parent 065722d commit fe45628
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/django/api/reports/contributor_type_by_percent.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION calc_value(total_count bigint, filtered_count bigint)
CREATE OR REPLACE FUNCTION calc_column(total_count bigint, filtered_count bigint)
RETURNS text AS $$
DECLARE
begin
Expand All @@ -19,7 +19,6 @@ SELECT
calc_column(COUNT(*), COUNT(*) filter (where contrib_type ='Auditor / Certification Scheme / Service Provider')) as "Auditor / Certification Scheme / Service Provider",
calc_column(COUNT(*), COUNT(*) filter (where contrib_type ='Academic / Researcher / Journalist / Student')) as "Academic / Researcher / Journalist / Student",
calc_column(COUNT(*), COUNT(*) filter (where contrib_type ='Other')) as "Other"

FROM (
SELECT distinct
min(to_char(s.created_at, 'YYYY-MM')) AS month,
Expand Down

0 comments on commit fe45628

Please sign in to comment.