Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i build a script that generate a QVD, and everyday the QVD is refreshed adding a new line for the day with a Balance (field amount) for the specific day.
My goal is to build the Daily Delta, as difference between the Balance of the day and the Balance of the previous day,
How this can be achieved? Below is my original script.
Thank you for all the suggestion!
//LOAD TABEL WITH REVELANT DATA
WalkingImplantsTemporary:
Load
BusinessUnit,
Amount,
Today() as Date;
SQL SELECT *
FROM JDE90.PRODDTA.F4211 WHERE SDMCU=' EIT22' AND SDNXTR='560';
WalkingImplants:
LOAD
BusinessUnit,
Amount,
Date
RESIDENT WalkingImplantsTemporary
GROUP BY BusinessUnit,Date;
DROP TABLE WalkingImplantsTemporary;
////********** Load the previous QVD and perform the incremental load******************
Concatenate(WalkingImplants)
WalkingImplantsQVD:
LOAD
BusinessUnit,
Amount,
HistoricalWIEUR,
Date
FROM
[$(vSourceData)WalkingImplants.qvd]
(qvd)
Where
Date < Today();
Store WalkingImplants into $(vSourceData)WalkingImplants.qvd(QVD);
Add this to your load script.
Rangesum(Amount-Previous(Amount)) as DailyDelta
in which part of the script?
//LOAD TABEL WITH REVELANT DATA
WalkingImplantsTemporary:
Load
BusinessUnit,
Amount,
Today() as Date;
SQL SELECT *
FROM JDE90.PRODDTA.F4211 WHERE SDMCU=' EIT22' AND SDNXTR='560';
WalkingImplants:
Load *,
Rangesum(Amount-Previous(Amount)) as DailyDelta
;
LOAD
BusinessUnit,
Amount,
Date
RESIDENT WalkingImplantsTemporary
GROUP BY BusinessUnit,Date;
DROP TABLE WalkingImplantsTemporary;
////********** Load the previous QVD and perform the incremental load******************
Concatenate(WalkingImplants)
WalkingImplantsQVD:
LOAD
BusinessUnit,
Amount,
HistoricalWIEUR,
Date,
Rangesum(Amount-Previous(Amount)) as DailyDelta
FROM
[$(vSourceData)WalkingImplants.qvd]
(qvd)
Where
Date < Today();
Store WalkingImplants into $(vSourceData)WalkingImplants.qvd(QVD);