Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loop Inside Load Statement

Hi,

I have a question about loop inside load statement.

I have 5 variable that contain Field Name,

let's say the variable are:

v1 = A

v2 = B

v3 = C

v4 = D

v5 = E

I want to load the field name based on the varible like this:

Load

     /*

     for i =0 to variableCount

          v$(i)

     next i

     */

FROM ....

So explicitly it will return

Load

     A,

     B,

     C,

     D,

     E

FROM ....

My Question is, is it possible to using loop inside load statement ?

Thanks in advance

Really appreciate your help.

1 Reply
Not applicable
Author

You can try like create variable that holds all the fields from variable & load the data like below:

LET vFieldList = '';

For i=1 to variablecount

     Let vFieldList = '$(vFieldList) , v$(i)'  ;

Next i

Load $(vFieldList) From ....