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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loop for generate DATA

Hello everybody,

I'm trying to find a solution for generate DATA.

I've this table:

AB
XX1
AA2
BB3

and I 'd like to have

AB
XX11
XX21
XX31
AA12
AA22
AA3

2

BB13
BB23

BB3

3

I've ever try to do a loop like

set a=1;

Do while a<10

load A&$(a) as A ,B;

Let a=a+1;

Loop

But it 's not working.

Thanks for your help.

1 Reply
tomasz_tru
Specialist
Specialist

Maybe without loop?

input:

load * inline [

A    B

XX    1

AA    2

BB    3

](delimiter is '\t');

A_tab:

LOAD A RESIDENT input;

join

LOAD B RESIDENT input;

B_tab:

LOAD A&B AS AB, A RESIDENT A_tab;

left join

LOAD A, B RESIDENT input;

DROP TABLES input, A_tab;