From caa83b8a982483d575f1bc694a9ccf1cdcfe6c2c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 12 Jul 2021 15:35:15 -0400 Subject: [PATCH] total up forecast pool by month --- inquirey/tots.sql | 90 +++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/inquirey/tots.sql b/inquirey/tots.sql index d46fc4b..0f1a1a9 100644 --- a/inquirey/tots.sql +++ b/inquirey/tots.sql @@ -19,48 +19,48 @@ ORDER BY order_month asc -------------------------------------------short ships------------------------------------- -SELECT - version, - iter, - oseas, - SUM(FB_VAL_LOC::numeric *r_rate::Numeric) -FROM - RLARP.osmf_dev -WHERE - --oseas = 2020 - fs_line = '41010' - --AND odate < '2020-04-01' - --AND CALC_STATUS <> 'CANCELED' - AND NOT (calc_status = 'CLOSED' AND flag = 'REMAINDER') -GROUP BY - version, - iter, - oseas - - select distinct version from rlarp.osm_pool - - - - -SELECT - oseas, - to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon') order_month, - r_currency, - r_rate, - sum(fb_val_loc) value_loc -FROM - rlarp.osmf_dev o -WHERE - oseas >= 2020 - --AND fs_line = '41010' - --AND odate < '2020-04-01' -GROUP BY - oseas, - to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon'), - r_currency, - r_rate - --glec -ORDER BY - oseas asc, - order_month asc +--------------------------------------------short ships------------------------------------- +--SELECT +-- version, +-- iter, +-- oseas, +-- SUM(FB_VAL_LOC::numeric *r_rate::Numeric) +--FROM +-- RLARP.osmf_dev +--WHERE +-- --oseas = 2020 +-- fs_line = '41010' +-- --AND odate < '2020-04-01' +-- --AND CALC_STATUS <> 'CANCELED' +-- AND NOT (calc_status = 'CLOSED' AND flag = 'REMAINDER') +--GROUP BY +-- version, +-- iter, +-- oseas +-- +-- select distinct version from rlarp.osm_pool +-- +-- +-- +-- +--SELECT +-- oseas, +-- to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon') order_month, +-- r_currency, +-- r_rate, +-- sum(fb_val_loc) value_loc +--FROM +-- rlarp.osmf_dev o +--WHERE +-- oseas >= 2020 +-- --AND fs_line = '41010' +-- --AND odate < '2020-04-01' +--GROUP BY +-- oseas, +-- to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon'), +-- r_currency, +-- r_rate +-- --glec +--ORDER BY +-- oseas asc, +-- order_month asc