Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
JM39
Creator
Creator

Help with IF/Else statement

Hello

I'm trying to get help on this if/else statement.  I don't really know what I'm doing when I need to include more than one condition.  This is my statement

row8.Code.equals("AE") ? null :
row5.CONTACT_ADD3 :
row5.CONTACT_ADD3.equals(null)?
row5.CONTACT_POSTCODE :
row5.CONTACT_ADD3+", "+row5.CONTACT_POSTCODE

So I'm trying to say

If Code = AE then make the field null, else

Use contact_add3, else

If contact_add3 is null then use contact_postcode, else

use contact_add3 + contact_postcode

 

I'm getting the error in the screenshot.  Thank you so much for help.

 

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

row8.Code.equals("AE") ? null :
row5.CONTACT_ADD3 == null ?
row5.CONTACT_POSTCODE :
row5.CONTACT_ADD3 + ", " + row5.CONTACT_POSTCODE

View solution in original post

4 Replies
TRF
Champion II
Champion II

row8.Code.equals("AE") ? null :
row5.CONTACT_ADD3 == null ?
row5.CONTACT_POSTCODE :
row5.CONTACT_ADD3 + ", " + row5.CONTACT_POSTCODE
Anonymous
Not applicable

Use this it will work

 

row8.Code.equals("AE") ? null :
Relational.ISNULL(row5.CONTACT_ADD3) ? row5.CONTACT_POSTCODE : row5.CONTACT_ADD3 + ", " + row5.CONTACT_POSTCODE

TRF
Champion II
Champion II

Did this help? If so, thanks to mark your case as solved (Kudo also accepted)
JM39
Creator
Creator
Author

Got that working now - thank you both!