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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

If condition

I am facing a challenge - 

I have 2 columns named [Customer Part] and [Internal Part].

If my Customer Part is either Null or Blank, then it should display my Internal Part else Customer Part.

I wrote this -

if(Len([Customer Part]=0),[Internal Part]
,if(Len([Customer Part]>0),[Customer Part])) as [Customer Part Final];

But for all cases, it is just considering the 1st if condition.

 

risabhroy_03_0-1655325224533.png

 

Please help

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Len([Customer Part]=0) will always return 1. The value 1 will be intepreted as true(), so you will always get the Internal parts.

I think you should do this instead:

if(Len([Customer Part]) =0,[Internal Part], [Customer Part]) as [Customer Part Final];

View solution in original post

1 Reply
Vegar
MVP
MVP

Len([Customer Part]=0) will always return 1. The value 1 will be intepreted as true(), so you will always get the Internal parts.

I think you should do this instead:

if(Len([Customer Part]) =0,[Internal Part], [Customer Part]) as [Customer Part Final];