Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

JOIN on null value

Hi I have a script like below,  how do I get to the expected result? Tried join but didn't work. Thank you!

A:

LOAD * INLINE [

    A, B, C

    1, 2

    11,22,33

];

join

LOAD * INLINE [

    A, B, C, D

    1, 2, 3, 4

];


Result:

ABCD
12
1234
112233


Expected:

ABCD
1234
112233
Tags (3)
1 Solution

Accepted Solutions

Re: JOIN on null value

So you want to join a 3 with a null. That's not going to happen. 3 will never be null.

Try joining without C:

Temp:

LOAD * INLINE [

    A, B, C

    1, 2

    11,22,33

];

join

LOAD A, B, C as X, D INLINE [

    A, B, C, D

    1, 2, 3, 4

];

Result

LOAD A, B, If(Len(Trim(C))=0,X,C) as C, D

RESIDENT Temp;

DROP TABLE Temp;


talk is cheap, supply exceeds demand
3 Replies

Re: JOIN on null value

So you want to join a 3 with a null. That's not going to happen. 3 will never be null.

Try joining without C:

Temp:

LOAD * INLINE [

    A, B, C

    1, 2

    11,22,33

];

join

LOAD A, B, C as X, D INLINE [

    A, B, C, D

    1, 2, 3, 4

];

Result

LOAD A, B, If(Len(Trim(C))=0,X,C) as C, D

RESIDENT Temp;

DROP TABLE Temp;


talk is cheap, supply exceeds demand

Re: JOIN on null value

You can also try this:

A:

LOAD A,

  B, C as E;

LOAD * INLINE [

    A, B, C

    1, 2

    11,22,33

];

join

LOAD * INLINE [

    A, B, C, D

    1, 2, 3, 4

];

Final:

LOAD A,

  B,

  If(Len(Trim(C)) = 0, E, C) as C,

  D

Resident A;

DROP Table A;


Capture.PNG

Not applicable

Re: JOIN on null value

Thank you both! Both are correct, too bad the system only allowed me to mark one...

Community Browser