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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Mulan
Contributor
Contributor

How to Correctly Show Total after Masking Small Numbers

Hello, Qlik Community. 

I have a question about correctly showing total in the chart. In my project, I hide numbers smaller than 5  and replace them with an asterisk (*), using the code (=if (count (Distinct PERSON_UID) <5, '*', count(distinct PERSON_UID)). After hiding the small numbers, I found the total shown in the chart is not correct. It didn't include the small number I hid. See the example below.  At the same time, the totals in Pivot tables don't have this issue. Could you help me find a solution? Thank you in advance!

Mulan 

 

Mulan_0-1671114761133.png

Mulan_1-1671114801915.png

 

Labels (4)
2 Replies
Or
MVP
MVP

My understanding is that a graph's total should total the individual segments, while a table / pivot table's total applies the formula at the Total level (which means it only applies the formula once, and the count(distinct) is greater than five so there's no problem). I believe this means you need the values to be contained within one of the segments in order to be included in the total, and since '*' is not a number, it's not displayed in any of the segments. Perhaps you could instead use the built-in Dimension limitation / Exact Value in order to automatically generate an "Others" segment?

 

 

Mulan
Contributor
Contributor
Author

Thank you for your response. I just tried the 'Exact Value' method you recommended. I checked the "Show others" option. The total is correct. However, although I gave the "others" a customized label "Less than 5". It wasn't shown in the legend. Now the race/ethnicity has a "Others" category. This is misleading. Users will be confused about it (long story: there were changes in the definition of race). Do you have a  method that I don't need to show the "others" label but the total is still correct? Thanks. 

Mulan_0-1671122316150.png