Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Full day reload help ???

Hi Folks,

I'm using below script for generating QVD over the weekends for the full week , in case I have missed the data for any weekday!

Let vLoadFrom = timestamp(If(Weekday($(vLAST_LOAD_TIME)) >= 5, WeekStart($(vLAST_LOAD_TIME)), $(vLAST_LOAD_TIME)), 'DD.MM.YYYY HH24:MI:SS');

STICHPROBE:

LOAD

    '$(vPlant)' as Plant,

    *;

SQL SELECT

NSPCIDNR,

NTOOLNR,

NSTPNR,

NPERS_IDNR

FROM $(vPlantAutor).STICHPROBE

WHERE DTTSERF > to_timestamp('$(vLoadFrom)', 'DD.MM.YYYY HH24:MI:SS');

store STICHPROBE into $(vQVDCurrentYear)\$(vPlant)_STICHPROBE.qvd;

Now what I'm looking for is :

Suppose when I have triggered QVD Generator @ 6:00 AM , this might have missed some data which was made available  later this day@9:00 PM inside database. So to support these cases of database update issue , is there any solution with the above script where I can write :

"Each day @ 11:00 PM , I want a full load for fetching data from database for the full day and store as QVD"

Please suggest if this approach is possible or not???

Thanks,

AS

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this:

If Frac(Now(1)) >= 23/24) Then

     // do full reload

Else

    // do incremental load

Endif


talk is cheap, supply exceeds demand
amit_saini
Master III
Master III
Author

Thanks Gysbert!

But could you please help me with complete script taking "STICHPROBE" as an example.

Thanks,
AS

tresesco
MVP
MVP

While you pass a qv variable to SQL engine, the evaluation of variable still gets done by QV and the resultant is sent to SQL engine. That means, your variable definition:


Let vLoadFrom = timestamp(If(Weekday($(vLAST_LOAD_TIME)) >= 5, WeekStart($(vLAST_LOAD_TIME)), $(vLAST_LOAD_TIME)), 'DD.MM.YYYY HH24:MI:SS');


is supposed to be evaluated by QV. But the time stamp format 'DD.MM.YYYY HH24:MI:SS' is unknown to QV. So you don't get the desired output.


Hope this helps.