Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nitaci
Contributor II
Contributor II

IF statement is returning null for the ELSE part

Dear All,

After joining two table with outer join, I need to create a new column (collumn 3) that copies another one (column1) but replace all the null values in (column1) with values in (column2).

My code looks something like:

 

Table1:
Load Name,
     Column1
From
[location1];

Outer Join(table1)
Load Name,
     Subname,
     Column2
From
[location1];

Table3:
Load Column1
     Column2
     If(IsNull(Column2), Column1, Column2) as Column3
Resident Table1;

 

 

 I get the correct result when Column2 is not null, but when it is null I get null and not Column2.

Screenshot:

Nitaci_0-1668771698634.png

Any suggenstions?

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Try with this in place of the IsNull()

Len(Trim(Column2))= 0

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Try with this in place of the IsNull()

Len(Trim(Column2))= 0

Nitaci
Contributor II
Contributor II
Author

Great thanks!