Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Looping through columns in table load script

Hi People,

problem is simple:

I have table with columns names: @1,@2,@3....@10

I want to loop through these columns..

I wrote something like this:

for i= 1 to 10

Table_Name:

load distinct

@$(i) as Parent ( "i" here will be 1)

@$(i)+2 as Kid  ( "i" here supposed to be 3)

resident Table2;


next;

This script doesnt work for counting $(i) + 2 as result column name: @3.

How can it be done ?

Thank You in advance for your help,

Jacenk Antek

11 Replies
PradeepReddy
Specialist II
Specialist II

what u want to achieve thru the script?

If you do like this, after all the iterations, you will have two columns only(parent & Kid).

Is this your requirement? If so, my solution is not feasible...

Anonymous
Not applicable
Author

Exactly, i wanted to have only 2 columns (parent and kid as hierarchy).

So thank You