Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ltc
Partner - Creator
Partner - Creator

Expression for Labeling and Selecting Null Values

Hi,

I have a column name "CCaR User DD2875 is Valid" which has Yes, No, and Null values.  I'd like to label the null values as "Empty" and make the null values selectable.  What is the expression for this?

Capture.PNG

Thank you

1 Solution

Accepted Solutions
m_perreault
Creator III
Creator III

If(isnull([CCaR User DD2875 is Valid]),'Empty',[CCaR User DD2875 is Valid])

View solution in original post

11 Replies
adityaakshaya
Creator III
Creator III

Hi Lea,

Please use the below expression in your Dimension :  Field, it will work for you.

if([CCaR User DD2875 is Valid]='','Empty',[CCaR User DD2875 is Valid]) and in the label, you can name it as per the requirement.



Regards,

Akshaya


PS- if you find response as correct and Helpful, Please mark it as correct and helpful

ltc
Partner - Creator
Partner - Creator
Author

Thank you for the response!  Unfortunately, it didn't seem to work.  The null values are still appearing as "-".Capture.PNG

CaptureII.PNG

any suggestions?

m_perreault
Creator III
Creator III

If(isnull([CCaR User DD2875 is Valid]),'Empty',[CCaR User DD2875 is Valid])

adityaakshaya
Creator III
Creator III

You can try like below

if(isnull([CCaR User DD2875 is Valid]),'Empty',[CCaR User DD2875 is Valid])


or


if(Len([CCaR User DD2875 is Valid])=0,'Empty',[CCaR User DD2875 is Valid])


Regards,

Akshaya

ltc
Partner - Creator
Partner - Creator
Author

Thank you!

It did label the null values as Empty and I am able to select the "Empty" label on the donut chart.

How can I get the null values to also be included in the KPI chart?  Without filters selected, it should show 13607 of 13607 users.  However, it shows 11,050 because it's not counting the null values.

Capture.PNG

Here is my current KPI expression.  It's just a count.

Capture.PNG

But I need it to include null values.  What would the expression be?

Thank you!

ltc
Partner - Creator
Partner - Creator
Author

Thank you so much.  It worked, but there was another person who replied before you and I used his expression.  I wish I could mark both as correct.  If there is a way to do so, please let me know.

m_perreault
Creator III
Creator III

My recommendation would be to move this logic to your script

If(isnull([CCaR User DD2875 is Valid]),'Empty',[CCaR User DD2875 is Valid]) as [CCar User DD2875 is Valid]



ltc
Partner - Creator
Partner - Creator
Author

Makes sense!  Although I am not the owner of the app, so I can't open the data load editor.

I am just working on a sheet for myself, so I don't think I have a choice but to edit the KPI expression.

Is there a way to edit my current KPI expression to include null values?

My current expression is a count:

Count([CCaR User DD2875 Is Valid])

I don't know how to add an IF statement if I have a count.

Thank you again.

vishsaggi
Champion III
Champion III

Try this?

= Sum(Aggr(Count(If(isnull([CCaR User DD2875 is Valid]),1,[CCaR User DD2875 is Valid])), [CCaR User DD2875 is Valid]))