Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks ,
Below is my QVD Gen script , triggered on hourly basis. Currently I'm facing some issue with the data , sometimes I'm missing some data from the Stichprobe table ,so to avoid this situation what I'm looking is to recreate this qvd over the weekends for the past whole week .
STICHPROBE:
LOAD
'$(vPlant)' as Plant,
*;
SQL SELECT
NSPCIDNR,
NTOOLNR,
NSTPNR,
NPERS_IDNR
FROM $(vPlantAutor).STICHPROBE
WHERE DTTSERF > to_timestamp('$(vLAST_LOAD_TIME)', 'DD.MM.YYYY HH24:MI:SS');
store STICHPROBE into $(vQVDCurrentYear)\$(vPlant)_STICHPROBE.qvd;
Below is example:
Today is Monday 21st Sep , so this qvd gen will work as it is triggered currently till Friday midnight , but on Sat or Sun what I'm looking for is to call the data from the complete week starting from 21st till 25th sep .
Please help me on this task , how can I do this by using above script.
Thanks,
AS
If I understand you right, add this line before the load
Let vLoadFrom = If(Weekday(vLAST_LOAD_TIME) >= 5, WeekStart(vLAST_LOAD_TIME), vLAST_LOAD_TIME);
And then in the load where clause, use vLoadFrom:
WHERE DTTSERF > to_timestamp('$(vLoadFrom)', 'DD.MM.YYYY HH24:MI:SS');
Thanks Jonathan for the suggestion.
Thanks,
AS