Commit all views

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-05-11 14:01:13 +02:00
parent 3986882771
commit 3a3e715336
28 changed files with 5546 additions and 111 deletions

View File

@@ -1024,3 +1024,74 @@ AND (B.Description LIKE '%2025%' OR B.Description LIKE '%2026%')
--AND D.Reference = 2097
ORDER BY 1,2
-- Run that script to generate CSV for price_curve MTM used in physical contract in 2025 and 2026
SELECT DISTINCT
CONCAT(
ISNULL(S.Description, '') , ' ' ,
M.MaturityYear , '-',
RIGHT(CONCAT('0', M.MaturityPeriod),2)
)AS price_index,
Q.QuoteDate AS price_date,
Q.Value AS high_price,
Q.Value AS low_price,
Q.Value AS open_price,
Q.Value AS price_value
FROM dbo.ExpenseRevenue AS ERMtM
INNER JOIN dbo.Deal AS D ON ERMtM.DealId = D.Id
INNER JOIN dbo.PriceFormulaElement AS PFEMtM ON PFEMtM.ExpenseRevenueId = ERMtM.Id AND PFEMtM.FormulaType <> 'Adjustment'
INNER JOIN price.Maturity AS M ON PFEMtM.MaturityId = M.Id
INNER JOIN price.Symbol AS S ON M.SymbolId = S.Id
INNER JOIN dbo.Book AS B ON D.BookId = B.Id
LEFT JOIN price.Quote AS Q ON M.Id = Q.MaturityId
WHERE 1=1
AND ERMtM.FormulaGroup = 2
AND PFEMtM.FormulaType LIKE 'MtM%'
AND S.Description LIKE 'Freight%'
AND (B.Description LIKE '%2026%')
ORDER BY 1,2
-- Run that script to generate CSV for price_curve MTM used in physical contract in 2025 and 2026
SELECT DISTINCT
D.Reference,
PFEMtM.FormulaType,
CONCAT(
ISNULL(S.Description, '') , ' ' ,
M.MaturityYear , '-',
RIGHT(CONCAT('0', M.MaturityPeriod),2)
)AS price_index,
--Q.QuoteDate AS price_date,
--Q.Value AS high_price,
--Q.Value AS low_price,
--Q.Value AS open_price,
--Q.Value AS price_value,
PFEMtM.FirstDate,
PFEMtM.LastDate,
PFEMtM.TriggerDate,
PFEMtM.NbDaysBefore,
PFEMtM.NbDaysAfter,
PFEMtM.*
FROM dbo.ExpenseRevenue AS ERMtM
INNER JOIN dbo.Deal AS D ON ERMtM.DealId = D.Id
INNER JOIN dbo.PriceFormulaElement AS PFEMtM ON PFEMtM.ExpenseRevenueId = ERMtM.Id AND PFEMtM.FormulaType <> 'Adjustment'
INNER JOIN price.Maturity AS M ON PFEMtM.MaturityId = M.Id
INNER JOIN price.Symbol AS S ON M.SymbolId = S.Id
INNER JOIN dbo.Book AS B ON D.BookId = B.Id
LEFT JOIN price.Quote AS Q ON M.Id = Q.MaturityId
WHERE 1=1
--AND ERMtM.FormulaGroup = 1
--AND PFEMtM.FormulaType NOT LIKE 'MtM%'
--AND S.Description NOT LIKE 'Freight%'
--AND S.Description NOT LIKE 'Discount%'
--AND S.Description NOT LIKE 'BAF%'
AND (B.Description LIKE '%2026%')
--AND D.Reference = 2097
ORDER BY 1,2