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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF and statements

Hello,

I am trying to use an if statement to filter out and get a specific set of data for a column.

Just as an example say I have a column that says NumOfProducts and it will be listed as either 'Single or 'Multiple'

And also I have a column with PRODUCTDESC which is listed with about 50 different labels, '1: Wood', '2: Toys', etc..

I am looking to get rid of any 'Single' that works only with '1: Wood'
I tried using =IF(Numofprod<>'Single' AND PRODUCTDESC<>'1: Wood', PRODUCTDESC)
So that I could just suppress the Null and get rid of the Single that works onl with 1: Wood, however, when I use this if statement it seems to just catch every PRODUCTDESC that's '1: Wood' and makes it a null value.

CONSUMERNUMOFPRODUCTSPRODUCTDESC
TomSingle1: WOOD
BobMultiple1: WOOD
BobMultiple2: TOYS
BobMultiple3: FOOD

As an example this is what my straight table looks like and when I use my If statement, it ends up putting the a null value where 1: WOOD in Bob's row when it shouldn't. I am only looking to put null values in the PRODUCTDESC column for 'Single' AND '1: Wood'

What can I do to fix this? Is there something else I should do to make it easier?

Thank you!

Labels (1)
2 Replies
MarcoWedel
MVP
MVP

Hi,

hope this helps:

QlikCommunity_Thread_131032_Pic1.JPG.jpg

regards

Marco

MarcoWedel
MVP
MVP

QlikCommunity_Thread_131032_Pic2.JPG.jpg

QlikCommunity_Thread_131032_Pic3.JPG.jpg