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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
prabhas277
Creator
Creator

Question on Operation

Hi All,

Individually i wrote below expression it gives result. while i used AND or OR Operations it won't give result just it throws null value 

= if(state ='HYD',
if(category='Apple','AAA',
if(category='Mango','MMM',)))
OR
= if(state ='BANG',
if(category='Apple','CCC',
if(category='Mango','DDD,)))

Please help out me where i am wrong.

Thanks

Srinu

 

2 Replies
tresB
Champion III
Champion III

Of course it would give you null. Your first conditional expression produces - 'AAA' or 'MMM' or null based on your data, and second expression gives similarly - 'CCC' or 'DDD' or null. That means after combining (I am assuming that you are putting them correctly to avoid any syntax error), your expression evaluation becomes something like:

<a text/ null> OR/AND <a text/ null> 

And this will of course result in null.

Instead, you would probably need something like:

= if(state ='HYD',
if(category='Apple','AAA',
if(category='Mango','MMM', if(state ='BANG',
if(category='Apple','CCC',
if(category='Mango','DDD))) )))

prabhas277
Creator
Creator
Author

CCC and DDD data not showing