# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
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:

A, B, C

1, 2

11,22,33

];

join

A, B, C, D

1, 2, 3, 4

];

Result:

 A B C D 1 2 1 2 3 4 11 22 33

Expected:

 A B C D 1 2 3 4 11 22 33
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:

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:

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
MVP

## Re: JOIN on null value

You can also try this:

A:

B, C as E;

A, B, C

1, 2

11,22,33

];

join

A, B, C, D

1, 2, 3, 4

];

Final:

B,

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

D

Resident A;

DROP Table A;

Not applicable

## Re: JOIN on null value

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