Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
JM39
Creator
Creator

How to select last populated column in tmap

Hello.  I'm trying to get the last populated column from my source data in some address fields.  This is my expression

 

row1.Address4!=null ? row1.Address4 :
row1.Address4==null ? row1.Address3 :
row1.Address3==null ? row1.Address2

 

What I'm trying to say is

If address4 is not null, use address4 ELSE

If address4 is null, use address3 ELSE

If address3 is null, use address2

 

It seems to work for all records except those where address2 is the last one populated in the source data & it's returning null values.  Any help appreciated.  Thanks you

 

 

Labels (2)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

Modify like this
If address4 is not null, use address4 ELSE
If address3 is not null , use address3 ELSE
If address3 is null, use address2

View solution in original post

2 Replies
akumar2301
Specialist II
Specialist II

Modify like this
If address4 is not null, use address4 ELSE
If address3 is not null , use address3 ELSE
If address3 is null, use address2
JM39
Creator
Creator
Author

Perfect thank you!  It still didn't work actually and then I realised that I also have null values in addr2.  I tried this way and it worked:

row1.Address4 !=null ?
row1.Address4 :
row1.Address3 !=null ?
row1.Address3 :
row1.Address2 !=null ?
row1.Address2 : null

 

Thank you so much 🙂