Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Store loop in QVD file

Hi,

I have a loop like:

LET vWeeks=0;

 

FOR counter = 2012 to year(Today()) +1

FOR counter1 = 1 to 12

 

IF WeekDay(MakeDate(counter, counter1)) = 'Sun' then

$(vWeeks)=4;

ELSEIF WeekDay(MakeDate(counter, counter1)) = 'Mon' then

$(vWeeks)=4;

ELSEIF WeekDay(MakeDate(counter, counter1)) = 'Tue' then

$(vWeeks)=5;

ELSEIF WeekDay(MakeDate(counter, counter1)) = 'Wed' then

$(vWeeks)=5;

ELSEIF WeekDay(MakeDate(counter, counter1)) = 'Thu' then

$(vWeeks)=5;

ELSEIF WeekDay(MakeDate(counter, counter1)) = 'Fri' then

$(vWeeks)=4;

ELSE

$(vWeeks)=4;

  NEXT counter1

ENDIF

          NEXT counter

Now I want to store the above loop in a qvd so that i can use it in a different qvw file

Can anyone help me on this.

Thanks

Manisha

1 Solution

Accepted Solutions

Re: Store loop in QVD file

Hi Manisha,

Do you mean to store this into a script file so you can reuse in one or more QVW files? If so, the just copy that text into an empty text file (using notepad, for example) and save it as "script.qvs" (use the double quotes).

Then, to use this code in another file, use the following line:

$(include=script.qvs);

That will add the lines in the file "script.qvs" into the current position, and they will be executed as any other instruction in the script.

Hope that helps.

Miguel

2 Replies

Re: Store loop in QVD file

Hi Manisha,

Do you mean to store this into a script file so you can reuse in one or more QVW files? If so, the just copy that text into an empty text file (using notepad, for example) and save it as "script.qvs" (use the double quotes).

Then, to use this code in another file, use the following line:

$(include=script.qvs);

That will add the lines in the file "script.qvs" into the current position, and they will be executed as any other instruction in the script.

Hope that helps.

Miguel

manisha_uit
Contributor

Re: Store loop in QVD file

Thanks for the instant reply Miguel.

Its working fine.

Thanks

Manisha

Community Browser