Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rsdhavle
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
miskinmaz
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;