Commit all views

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-04-23 09:24:37 +02:00
parent 79f6e6111f
commit 3986882771
16 changed files with 518 additions and 91 deletions

View File

@@ -1,8 +1,10 @@
CREATE OR REPLACE VIEW public.vw_bi_dim_trade AS
SELECT pc."intPurchaseLineId" AS "intTradeId",
(pc."intPurchaseLineId" || '_0'::text) AS "strTradeId",
'Physical'::text AS "Trade Category",
'Purchase'::text AS "Trade Type",
pc."strReference" AS "Trade Ref",
pc."strContractNb" AS "Trade Number",
pc."dtmContractDate" AS "Trade Date",
pc."strCounterparty" AS "Counterparty",
pc."strRegion" AS "Bassin",
@@ -12,9 +14,11 @@ CREATE OR REPLACE VIEW public.vw_bi_dim_trade AS
WHERE ((1 = 1) AND (pc."intPurchaseLineId" > 0))
UNION ALL
SELECT sc."intSaleLineId" AS "intTradeId",
('0_'::text || sc."intSaleLineId") AS "strTradeId",
'Physical'::text AS "Trade Category",
'Sale'::text AS "Trade Type",
sc."strReference" AS "Trade Ref",
sc."strContractNb" AS "Trade Number",
sc."dtmContractDate" AS "Trade Date",
sc."strCounterparty" AS "Counterparty",
sc."strRegion" AS "Bassin",