Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
sersal10
Creator
Creator

How to remove nulls from a measure

Hi all, 
I want to remove nulls so that I can calculate the percentaje of the countries but not taking into account the NULLs in the calculation. This code doesn't work. The measure is the same as with the nulls.

Any solution for this?

Many thanks

Captura de pantalla 2023-10-25 a las 17.21.13.png

Labels (2)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

Maybe a small typo here:

Sum({<customer_country = {*}>} quantity) / Sum({<customer_country = {*} >} total quantity)

View solution in original post

5 Replies
vincent_ardiet_
Specialist
Specialist

Try with this filter in your set analysis:
customer_country={*}

sersal10
Creator
Creator
Author

Hi Vincent,

 

I tried this in the expression: Sum({<customer_country = {*} quantity) / Sum({<customer_country = {*} >} total quantity) and it says there is an error. It doesn't show anything then.

vincent_ardiet_
Specialist
Specialist

Maybe a small typo here:

Sum({<customer_country = {*}>} quantity) / Sum({<customer_country = {*} >} total quantity)

sersal10
Creator
Creator
Author

Thank you so much!! It worked 🙂

maheshkuttappa
Creator II
Creator II

Sum({<Customer_Country ={"*"}>} Quantity)  

This will pick up all possible values in Customer_Country and ignore the null. If data has text values like null, n/a then this expression will include it.  It is better to handle the null value in the script. 

This an excellent resource NULL handling in QlikView