Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
for i=1 to 10
let j=$(i)+2;
Table_Name:
load distinct
@$(i) as Parent,
@$(j) as Kid
resident Table2;
next;
@$(=i+2) as Kid
for i=1 to 10
let j=$(i)+2;
Table_Name:
load distinct
@$(i) as Parent,
@$(j) as Kid
resident Table2;
next;
Hi,
If it is static number of columns you can simply use below script without making the script more complex to understand
Table_Name:
load distinct
@1 as Parent,
@3 as Kid
resident Table2;
Concatenate(Table_Name)
oad distinct
@2 as Parent,
@4 as Kid
resident Table2;
'
'
''
'
'
if the table contains 10 columns (@1,@2,@3....@10), what is the need to loop the columns?
Mention whatever columns you want load from the resident table (Table2) explicitly..
Table:
Load @1 as Parent1,
@2 as Kid
resident Table2;
Hi,
thank you for your answer. Unfortunately this is not working:
error is :
So Kid (Subsetname) is not working - QV doesnt see it as @ and number.
thanks! It is working !
I wanted to learn somthening new but thx for answer.
what if this table had 1000 columns?