From 769bd7ff298bfe4f24bdb4fa4d8e589bb6a0b89e Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 5 Dec 2023 11:19:57 -0500 Subject: [PATCH] convert to dollars --- sql/schema.pg.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/schema.pg.sql b/sql/schema.pg.sql index bce724f..9824e20 100644 --- a/sql/schema.pg.sql +++ b/sql/schema.pg.sql @@ -33,10 +33,10 @@ SELECT --,os.glec --,m.biggroup --,os.priceg - ,COALESCE(sum(pounds) filter (WHERE sseas = 2023 AND version = 'Actual'),0) "Actual 2023" - ,COALESCE(sum(pounds) filter (WHERE sseas = 2024 AND version = 'Actual'),0) "Actual 2024" - ,COALESCE(sum(pounds) filter (WHERE version = 'Actual' AND ostatus LIKE 'Open%' AND rseas <= 2024),0) "Open Ord" - --,COALESCE(sum(pounds) filter (WHERE version = 'Quotes'),0) "Quotes" + ,COALESCE(sum(sales_usd) filter (WHERE sseas = 2023 AND version = 'Actual'),0) "Actual 2023" + ,COALESCE(sum(sales_usd) filter (WHERE sseas = 2024 AND version = 'Actual'),0) "Actual 2024" + ,COALESCE(sum(sales_usd) filter (WHERE version = 'Actual' AND ostatus LIKE 'Open%' AND rseas <= 2024),0) "Open Ord" + --,COALESCE(sum(sales_usd) filter (WHERE version = 'Quotes'),0) "Quotes" FROM rlarp.osm_stack os LEFT OUTER JOIN rlarp.molds m ON @@ -72,7 +72,7 @@ GROUP BY ,ship_dba ,dsm ,sum(sales_usd) sales - ,sum(pounds) pounds + ,sum(sales_usd) sales_usd --string_agg(distinct mold,', ') FROM rlarp.osm_stack @@ -89,7 +89,7 @@ GROUP BY COALESCE(act.bill_dba,TRIM(bgt.bill_dba)) bill_dba ,COALESCE(act.ship_dba,TRIM(bgt.ship_dba)) ship_dba ,COALESCE(act.dsm ,TRIM(bgt.dsm )) dsm - ,COALESCE(SUM(bgt.pounds ),0) "Budget 2024" + ,COALESCE(SUM(bgt.sales_usd ),0) "Budget 2024" ,COALESCE(SUM(act."Actual 2023"),0) "Actual 2023" ,COALESCE(SUM(act."Actual 2024"),0) "Actual 2024" ,COALESCE(SUM(act."Open Ord" ),0) "Open Ord"