Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

loop through either the list or a variable

I have a list which is obtained from an expression (not a direct column value) and the values vary upon selection of another list .

i am able to save this as a comma separated value in a variable.

variable.pnglt.png

now i need to loop through this.

for eg. it has 2 values as 1 and 2

then say vLOOP = 1,2

for (i=0, i<=Count(vLOOP ), i=i+1)

how many time time the loop in executed that many time i want to display a text box

say if vLOOP has only one value

i have to display one value

if it has 3 (4,5,6) then i have to display 3 values. for this i wanted to loop through.

Kindly suggest

1 Solution

Accepted Solutions

Re: loop through either the list or a variable

Check out the attached application and see if this is what you are looking for.

Capture.PNG

12 Replies

Re: loop through either the list or a variable

Shyamala Mahendran wrote:

if it has 3 (4,5,6) then i have to display 3 values. for this i wanted to loop through.

Show them in 3 different text box or just one text box?

Not applicable

Re: loop through either the list or a variable

show three diff txt box

Not applicable

Re: loop through either the list or a variable

three different text box

Re: loop through either the list or a variable

Is there a upper limit to the number of values this variable can contain? AFAIK, QlikView won't be able to dynamically create text box objects for you, but if there is an upper limit, you might be able to create (20-30 text boxes) and conditionally hide show them based on the count of numbers within your variable.

Re: loop through either the list or a variable

You could count the number of values with: substringcount(YourExpression, 'YourDelimiter') + 1 and pick with: subfield(YourExpression, 'YourDelimiter', n) the appropriate values and use also the count as condition to show the textboxes.

- Marcus

Re: loop through either the list or a variable

Marcus -

But this can be done only for a known number of X values, correct? There is no dynamic way of doing this?

Re: loop through either the list or a variable

Hi Sunny,

no, not dynamically else like mentioned from you above it needs to create many objects in the forefront. But will be a table-chart used for this it could be dynamically (the layout-options are restricted then compared with many textboxes but it might be sufficient).

- Marcus

Re: loop through either the list or a variable

That make sense

Not applicable

Re: loop through either the list or a variable

yes there is upper limit and lower limit 1 and 6 respectively

yes i can place all 6 text box (max probability is getting all 6 values) and show hide

but this will create a gap in those position if there is no value

for ex if the value in the list 1,3

Sample.png

There will be a gap between one and three since there is no value for 2 .i want to show as below

Sample-required.png

Community Browser