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: 
madhuqliklondon
Creator II
Creator II

Converting value into Yes or No

Hi all,

I have a column "Promotion code" in my table , I am creating pivot table, in that I want to see if the customer used a promo code or not ,for that I want to convert my feild value for example under if it is null or - it must say No and if there is promode like New20 then it is Yes. I am not doing this at script level , I am doing this at chart or expression level.

I have used if([Promo Code]=0,'No','Yes') but it seems to give me all Yes for some reason.

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

May be this?

if( Len(trim([Promo Code]))=0,'No','Yes')

View solution in original post

4 Replies
tresB
Champion III
Champion III

May be this?

if( Len(trim([Promo Code]))=0,'No','Yes')

Anil_Babu_Samineni
MVP
MVP

May be you have Nulls instead of 0. Can you check handle the nulls. May be this?

if([Promo Code]=0 or [Promo Code] = 'Null' or [Promo Code] = '-' or IsNull([Promo Code]),'No','Yes')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mostwanted123
Creator
Creator

Try this,

if(isnull([Promo Code]),'No','Yes')

Regards,

Pratik

madhuqliklondon
Creator II
Creator II
Author

Thank you all.