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

Run script if condition met.

Hi,

I want to create a QVD if the current time is between the hours of 08:00 AM and 10:00 AM, if it does not meet this condition I want it to Exit the Script.

I've tried to do the following Script IF Statement but does not seem to work, any ideas?

LET vHour = Hour(Now());

If vHour >= 8 And  vHour <= 10 Then

TableA:

LOAD *;

SQL

SELECT *

From TableA;

ELSE EXIT SCRIPT;

Thanks

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this?

SET vQVDPath = 'yourpathhere';

LET vHour = Hour(Now());

If ($(vHour) >= 6 And  $(vHour) <= 10) Then

Your ODBC or OLEDB Connection string here;

TableA:

LOAD *;

SQL

SELECT *

From TableA;

Store TableA into $(vQVDPath)tableB.qvd(qvd);

ELSE

EXIT SCRIPT;

ENDIF;

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

Try this?

SET vQVDPath = 'yourpathhere';

LET vHour = Hour(Now());

If ($(vHour) >= 6 And  $(vHour) <= 10) Then

Your ODBC or OLEDB Connection string here;

TableA:

LOAD *;

SQL

SELECT *

From TableA;

Store TableA into $(vQVDPath)tableB.qvd(qvd);

ELSE

EXIT SCRIPT;

ENDIF;

ivandrago
Creator II
Creator II
Author

Thanks Alot

minajalalian90
Contributor II
Contributor II

Thanks For your answer. Very useful. 💮