Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

Join * value to any value in other table

Hi

having Table fields

- Table1.A with Values A, B, C, D, *
- Table2.A with Values A, B, C, D, E, F

What I want to reach in load script is that
- Table1.A values join to identical Table2.A values except for value *
- Table1.A value * shall join with ANY value of Table2.

Thus result of LEFT JOIN(Table1) load Distinct A as Table1.A from Table2 should be:

Table1.A
A
B
C
D
E
F

I tried with Star Is command, it does not help. I cannot remember to correct way to do this,
however I remember there should be a simple solution...

Thx - Marcel

2 Replies
maxgro
MVP
MVP

Table1: load * inline [

Field

A

B

C

D

GG

*

];

Table2: NoConcatenate load * inline [

Field

A

B

C

D

GG

GG

E

F

HH

HH

];

Final:

NoConcatenate load *, Field as Field1 Resident Table1 Where Field <> '*';

left join(Final) load * Resident Table2;

Concatenate (Final) load * Resident Table2 where not Exists(Field1, Field);

DROP Field Field1;

DROP Table Table1, Table2;  

hugmarcel
Specialist
Specialist
Author

Hi

thank you for this solution. It is of course possible to split tables and apply different join conditions etc.

However, I thought there was a simpler solution needing 1 script statement only. If this is not the case, your

solution is of course ok.

Regards - Marcel