Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense - If Expression giving different results

Hi all,

I have a dimension called VendorContactConflictFlag that only has the value 1 or is null.


When using the expression below for records that do not have a value of 1 (i.e. null values), it gives the correct outcome of 0.


IF(VendorContactConflictFlag=1,1,0)

When using the second expression for the same records, it does not evaluate correctly and gives a value of 'Yes'.

IF(VendorContactConflictFlag=1,'Yes','No')

Would appreciate any help on why this is happening!

Cheers,

Joel

4 Replies
Chanty4u
MVP
MVP

did u chk with the variable name alrdy declared?  twice?

Cntrl+Alt+V

sunny_talwar

Can you put them side by side in your application and check what you get?

IF(VendorContactConflictFlag=1,1,0) & ' ' & IF(VendorContactConflictFlag=1,'Yes','No')

Do you still get 0 Yes?

Not applicable
Author

Hi Sunny,

I get the correct answer when I paste your formula in (0, No). 

Not sure why this is the case - could you please enlighten me?

sunny_talwar

I have no idea, may be you had some not right? (Spelling mistake, Upper case/lower case issue)

If you now paste this -> IF(VendorContactConflictFlag=1,'Yes','No') it should give you no right?