Push fct_open_position and fct_trade_fullfillment_event

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-02-13 14:04:56 +01:00
parent 0fa522ece6
commit 98f4dfc2c8
2 changed files with 74 additions and 31 deletions

View File

@@ -1,7 +1,11 @@
--DROP VIEW IF EXISTS vw_bi_fct_trade_fulfillment_event;
CREATE OR REPLACE VIEW vw_bi_fct_trade_fulfillment_event AS
SELECT
SM."intPurchaseLineId" AS "inTradeId",
'Physical' AS "Trade Category",
'Purchase' AS "Trade Type",
'Delivered' AS "Event Type",
SM."dtmBLDate" AS "Event Date",
SM."dblQuantity" AS "Quantity"
@@ -10,8 +14,9 @@ CREATE OR REPLACE VIEW vw_bi_fct_trade_fulfillment_event AS
AND COALESCE( SM."intPurchaseLineId" , 0 ) > 0
UNION ALL
SELECT
SM."intSaleLineId" AS "inTradeId",
SM."intSaleLineId" AS "inTradeId",
'Physical' AS "Trade Category",
'Sale' AS "Trade Type",
'Delivered' AS "Event Type",
SM."dtmBLDate" AS "Event Date",
SM."dblQuantity" AS "Quantity"