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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Null values in a calculated dimension

Hi is there a way to drill down into the null values in a chart which uses a calculated dimension. I have a pie chart with the following dimension which picks out only the values labelled 'High' and 'Low'. I want to be able to drill into the rest of the data which doesnt have a TAX_BAND assigned.

=if(not wildmatch(TAX_BAND, '*Low*', '*High*'), null(), TAX_BAND) as NEW_TAX_BAND

11 Replies
sunny_talwar

May be don't make it null() call it NULL

=If(not WildMatch(TAX_BAND, '*Low*', '*High*'), 'NULL', TAX_BAND)

Not applicable
Author

Thanks Sunny. It doesnt seem to like that expression. Throwing an error.

trdandamudi
Master II
Master II

Give a try on the below for calculated dimension:

=If(Len(Trim(TAX_BAND))>0 ,TAX_BAND,'Null')

Null_PieChart_Calculated_Dimension.jpg

sunny_talwar

What is the error that you are seeing?

Not applicable
Author

'Error in calculated dimension' appears in pie chart

sunny_talwar

Would you be able to share a snapshot of the expression you used for the dimension?

Not applicable
Author

I beg your pardon. That works now. However I see both 'NULLS' and a separate chunk in the pie chart which is all values with a TAX_BAND assigned aside from the ones picked up by the wild card. Ideally I want to see only 3 chunks.

High

Low

NULL ( ie those values with no tax band assigned )

trdandamudi
Master II
Master II

Please check the expression that Sunny provided and it is working. Please see the chart below with Sunny expression:

Null_PieChart_Calculated_Dimension_01.jpg

sunny_talwar

How about you try this (I removed not before WildMatch and changed the order of True and False):

=If(WildMatch(TAX_BAND, '*Low*', '*High*'), TAX_BAND, 'NULL')