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

Looping through specific values

Hi Folks,

Can you let us know if it is possible in QlikView to loop through particular values in for loop in the script.

Eg: I want to write condition like this

a=x;

b=y;

c=z;

//Basically a, b, c are discrete values

for i= a to c;

..................

................

next

1 Solution

Accepted Solutions
MVP
MVP

Re: Looping through specific values

Hi

You can do this:

For Each zVar in ('a', 'b', 'c')

  Let $(zVar) = 0;

Next

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
3 Replies
MVP
MVP

Re: Looping through specific values

Hi

You can do this:

For Each zVar in ('a', 'b', 'c')

  Let $(zVar) = 0;

Next

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Looping through specific values

Hi

I'm not totally sure of how you wish to use this but you could use;

For each driver in a, b, c

Where driver is used in your script.  So if you wanted to load one at a time for example, the script would be;

For each driver in a, b, c

Load

     *

From [File} where $(driver);

I hope this helps, let me know how you get on.

Regards


Steve

Not applicable

Re: Looping through specific values

Many Thanks Jonathan and Steve.

Answered exactly what I'm looking for.

I didn't know that for each loop exists in QlikView.

Regards,

Surendra

Community Browser