Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Nested For Each loop query

We have a scenario where we are getting number of Ids for different Regions. We need to pass these Id's in URL for one region at the time and We have different URLs for different regions. 

Example.

abc.com/xyz/Region1/$(ids)/details

We want to pass set of URLs in a for each loop and at the same time pass Ids specific to that region in above URL. How can we write nested loop for this scenario?

1 Reply
Highlighted
Creator III
Creator III

You can use the below code 

Table1:

Load * Inline [

Id,Region

1,R1

2,R1

3,R2

];

 

Let vNoOfRows=NoOfRows('Table1');

for i=0 to $(vNoOfRows)-1

Let  vRegion= Peek('Region',$(i),'Table1');
Let vID= Peek('Id',$(i),'Table1');

Load

'abc.com/xyz/$(vRegion)/$(vID)/details' as URL,

....

from dataSource

next i;