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

Conditional join

Hi guys,

Today I am struggling with below simple case:

tstable:

LOAD * INLINE [

    ID, ID2

    1, 01

    2, 02

];

left join (tstable)

LOAD * INLINE [

    ID2, VAL

    01, alfa

    02, beta

];

Concatenate (tstable)

LOAD * INLINE [

    ID, ID2

    3, 03

];

left join (tstable)

LOAD * INLINE [

    ID2, VAL

    03, gamma

];

Result of this script is:

a.PNG.png

And I would like to reach below result:

b.PNG.png

How to deal with this case Gentlemans?

Thank You & Regards,

Sebastian

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

tstable:

LOAD * INLINE [

    ID, ID2

    1, 01

    2, 02

];

left join (tstable)

LOAD * INLINE [

    ID2, VAL

    01, alfa

    02, beta

];

NoConcatenate

T2:

LOAD * INLINE [

    ID, ID2

    3, 03

];

Left Join 

LOAD * INLINE [

    ID2, VAL

    03, gamma

];

Concatenate (tstable) Load * Resident T2;

Drop Table T2;

View solution in original post

3 Replies
MK_QSL
MVP
MVP

tstable:

LOAD * INLINE [

    ID, ID2

    1, 01

    2, 02

];

left join (tstable)

LOAD * INLINE [

    ID2, VAL

    01, alfa

    02, beta

];

NoConcatenate

T2:

LOAD * INLINE [

    ID, ID2

    3, 03

];

Left Join 

LOAD * INLINE [

    ID2, VAL

    03, gamma

];

Concatenate (tstable) Load * Resident T2;

Drop Table T2;

Not applicable
Author

Hi,

Try this one:

 

table1:

LOAD * INLINE [
ID2, VAL
01, alfa
02, beta
]
;

LOAD * INLINE [
ID2, VAL
03, gamma

]
;


tstable:

LOAD * INLINE [
ID, ID2
1, 01
2, 02
]
;
Concatenate (tstable)

LOAD * INLINE [
ID, ID2
3, 03
]
;

left join(tstable)
LOAD * Resident table1;

DROP Table table1;

hope it works.

Regards,

Biren Agrawalla

engishfaque
Specialist III
Specialist III

Dear Sebastian,

Find attached qvw.

Kind regards,

Ishfaque Ahmed