Commit all views for ITSA
This commit is contained in:
24
Database Backups/SQL Views/vw_bi_fct_trade_line.sql
Normal file
24
Database Backups/SQL Views/vw_bi_fct_trade_line.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE OR REPLACE VIEW public.vw_bi_fct_trade_line AS
|
||||
SELECT pc."intPurchaseLineId" AS "intTradeId",
|
||||
'Physical'::text AS "Trade Category",
|
||||
'Purchase'::text AS "Trade Type",
|
||||
pc."dtmEstimatedBLDate" AS "Delivery Date",
|
||||
pc."dblTheoriticalQuantity" AS "Contracted Quantity",
|
||||
pc."dblQuantity" AS "Quantity",
|
||||
pc."dblPrice" AS "Price",
|
||||
pc."dblUnitPrice" AS "Unit Price",
|
||||
'USD'::text AS "Price Currency",
|
||||
pc."dblLineAmount" AS "Line Amount"
|
||||
FROM vw_utility_purchase_physical_contract pc
|
||||
UNION ALL
|
||||
SELECT pc."intSaleLineId" AS "intTradeId",
|
||||
'Physical'::text AS "Trade Category",
|
||||
'Sale'::text AS "Trade Type",
|
||||
pc."dtmEstimatedBLDate" AS "Delivery Date",
|
||||
pc."dblTheoreticalQuantity" AS "Contracted Quantity",
|
||||
pc."dblQuantity" AS "Quantity",
|
||||
pc."dblPrice" AS "Price",
|
||||
pc."dblUnitPrice" AS "Unit Price",
|
||||
'USD'::text AS "Price Currency",
|
||||
pc."dblLineAmount" AS "Line Amount"
|
||||
FROM vw_utility_sale_physical_contract pc;;
|
||||
Reference in New Issue
Block a user