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: 
Not applicable

Recursive LOAD

Hi,

i have a situation like this:

Table 1:

Key1
11
22
33
44

Table 2:

Key2Key1
A11
B11
C22
D33
E44

I need to load Table 1 with a summary of the keys on Table 2:

Key1Summary Key2
11A;B
22C
33D
44E

Which is the best option?

Many thanks

1 Solution

Accepted Solutions
srchilukoori
Specialist
Specialist

Try this:

Table2:

Load * INLINE [

Key1, Key2

11, A

11, B

22, C

33, D

44, E

];

Table1:

NoConcatenate

Load * Inline [

Key1

11,

22,

33,

44

];

Table3:

NoConcatenate

LOAD Distinct

    Concat(DISTINCT Key2, '; ') As [Summary Key2],

    Key1

Resident Table2

Group by Key1;

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Load Key1 from table1;

left join

Load Key1, concat(Key2) from Table2;

Hope it helps

Anonymous
Not applicable
Author

Concat() function is what you need:

result:
LOAD
Key1,
concat(Key2, ';') as "Summary of Key2"
FROM table2
GROUP BY Key1;

srchilukoori
Specialist
Specialist

Try this:

Table2:

Load * INLINE [

Key1, Key2

11, A

11, B

22, C

33, D

44, E

];

Table1:

NoConcatenate

Load * Inline [

Key1

11,

22,

33,

44

];

Table3:

NoConcatenate

LOAD Distinct

    Concat(DISTINCT Key2, '; ') As [Summary Key2],

    Key1

Resident Table2

Group by Key1;