Discussion board where members can learn more about Qlik Sense App Development and Usage.
Could anyone explain how for loop works with simple example?
Thanks & Regards
For loop - Wikipedia, the free encyclopedia
Loops in the Script
Hope it will help you.
Are you asking about for loop or for each loop to load data from multiple file ?
I need explanation for both "for and for each"
We use the For loop every file is sequentially loaded from the source folder and then
a preceding load is applied.
For each vFile in FileList
LOAD *,Left(Source,3) as Month;
Filebasename() as Source
(ooxml, embedded labels, table is Sheet1);
Another example is:
TABLE:load * inline [A, B, CChina, Cotton, ShirtIndia, Cotton, SocksJapan, Leather, Jacket];let vNOR=NoOfRows('TABLE');for i=1 to $(vNOR)let vA=FieldValue('A',$(i));let vB=FieldValue('B',$(i));let vC=FieldValue('C',$(i));NEXT;