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.
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

Re: Switch Satement in EditScript

------

Not applicable

Re: Switch Satement in EditScript

----

anbu1984
Honored Contributor III

Re: Switch Satement in EditScript

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)

Community Browser