Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Switch Satement in EditScript

Hello,

I am trying to execute the load and store statement only if the day is Sunday. If it is Sunday and if the table is already stored then it should not run. Can somebody help me with my code. What is wrong in my Switch Statement.

Thanks in advance.

SWITCH

IF(WEEKEND(DATE(QVDCREATETIME('C:\Users\ABC\Lastweekque.qvd'))) = DATE(WEEKEND(TODAY())),1,2)

CASE 1

TRACE('LAST WEEK QUE QVD IS ALREADY UPDATED');

CASE 2

Currweekque:

LOAD*FROM Lastweekque.qvd(qvd)

WHERE Uni_ReloadWeek > DATE(WEEKEND(TODAY())-21);

CONCATENATE

LOAD

WEEKEND(TODAY()) AS Uni_ReloadWeek,

wa_Include_Roots AS Uni_Include_Roots,

RecID AS Uni_RecID

FROM RAITS;

STORE Currweekque INTO Lastweekque.QVD(QVD);

ENDSWITCH

IMG_0575 (1).JPG

3 Replies
Not applicable
Author

------

Not applicable
Author

----

anbu1984
Master III
Master III

Write the If statement on the same line as Switch

SWITCH  IF(WEEKEND(DATE(QVDCREATETIME('C:\Users\ABC\Lastweekque.qvd'))) = DATE(WEEKEND(TODAY())),1,2)