Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
amit_saini
Honored Contributor 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:MISmiley FrustratedS');

STICHPROBE:

LOAD

    '$(vPlant)' as Plant,

    *;

SQL SELECT

NSPCIDNR,

NTOOLNR,

NSTPNR,

NPERS_IDNR

FROM $(vPlantAutor).STICHPROBE

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

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

Re: Full day reload help ???

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
Honored Contributor III

Re: Full day reload help ???

Thanks Gysbert!

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

Thanks,
AS

MVP
MVP

Re: Full day reload help ???

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:MISmiley FrustratedS');


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


Hope this helps.

Community Browser