convert to dollars

This commit is contained in:
Paul Trowbridge 2023-12-05 11:19:57 -05:00
parent ddb4977a5a
commit 769bd7ff29

View File

@ -33,10 +33,10 @@ SELECT
--,os.glec --,os.glec
--,m.biggroup --,m.biggroup
--,os.priceg --,os.priceg
,COALESCE(sum(pounds) filter (WHERE sseas = 2023 AND version = 'Actual'),0) "Actual 2023" ,COALESCE(sum(sales_usd) 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(sales_usd) 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(sales_usd) 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 version = 'Quotes'),0) "Quotes"
FROM FROM
rlarp.osm_stack os rlarp.osm_stack os
LEFT OUTER JOIN rlarp.molds m ON LEFT OUTER JOIN rlarp.molds m ON
@ -72,7 +72,7 @@ GROUP BY
,ship_dba ,ship_dba
,dsm ,dsm
,sum(sales_usd) sales ,sum(sales_usd) sales
,sum(pounds) pounds ,sum(sales_usd) sales_usd
--string_agg(distinct mold,', ') --string_agg(distinct mold,', ')
FROM FROM
rlarp.osm_stack rlarp.osm_stack
@ -89,7 +89,7 @@ GROUP BY
COALESCE(act.bill_dba,TRIM(bgt.bill_dba)) bill_dba COALESCE(act.bill_dba,TRIM(bgt.bill_dba)) bill_dba
,COALESCE(act.ship_dba,TRIM(bgt.ship_dba)) ship_dba ,COALESCE(act.ship_dba,TRIM(bgt.ship_dba)) ship_dba
,COALESCE(act.dsm ,TRIM(bgt.dsm )) dsm ,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 2023"),0) "Actual 2023"
,COALESCE(SUM(act."Actual 2024"),0) "Actual 2024" ,COALESCE(SUM(act."Actual 2024"),0) "Actual 2024"
,COALESCE(SUM(act."Open Ord" ),0) "Open Ord" ,COALESCE(SUM(act."Open Ord" ),0) "Open Ord"