Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Looping Script using Date & Hour as Parameter

Hello,

I have to create a loop script which has as parameter for the next load the last date & hour (YYYY-MM-DD hh:mm:ss) of the field 'date'.

This parameter I've already have using "LET vInitialDate=Peek('date',-1)" in the end of the script. But how can I stop the looping, considering Now() as the final date? I'm stuck with this.

Tks!

3 Replies
rahulpawarb
Specialist III
Specialist III

Hello Marcelo,

Could you please share the application with sample data? This will help us to identify the issue and provide fix for the same.

Regards!

Rahul

Not applicable
Author

Hello Rahul,

I can't share the application, but the script has the following model:

CUSTOM CONNECT TO "Provider=QvRestConnector.exe;url=URL&$(vInitialDate)|$(vFinalDate)";

RestConnectorMasterTable:

SQL SELECT

  "success",

  "__KEY_root",

  (SELECT

  "id",

  "date",

  "__FK_data"

  FROM "data" FK "__FK_data")

FROM JSON (wrap on) "root" PK "__KEY_root";

 

Table:

LOAD

  [id],

  [date],

  [__FK_data] AS [__KEY_root]

RESIDENT RestConnectorMasterTable

WHERE NOT IsNull([__FK_data]);

Remembering that the variable vFinalDate is Date(Now(),'YYYY-MM-DD hh:mm:ss'). And the vInitialDate is always the last record from the field "date" (YYYY-MM-DD hh:mm:ss).

Tks

Not applicable
Author

Nobody else?