Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Distinct Exclude Total Row

I have a chart with a total row.  When I execute the =count(distinct(field name)) the total includes the row with the totals.  Is there a way to eliminate the total row in the count?  Thanks.

1 Solution

Accepted Solutions
PrashantSangle

Hi,

Because of it you are getting 1 extra count.

Either you can subtract 1 manually from your expression or handle null value dimension in your expression

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

14 Replies
sunny_talwar

Not sure what you mean, but try this:

Sum(Aggr(Count(DISTINCT FieldName), YourChartDimensions))

Not applicable
Author

Thanks, but that did not work.  Here is an example.  There are 8 invoices but the count = 9.

Capture.JPG

sunny_talwar

Is Customer Name and Inv Nbr the only two dimensions in this chart? and when you did this, it did not give you the correct total up-top -> Sum(Aggr(Count(DISTINCT FieldName), [Customer Name], [Inv Nbr]))?

Not applicable
Author

There are 8 dimensions in the table.  I used Sum(Aggr(Count(DISTINCT [Invoice Number]), [Invoice Number]))  since I'm trying to determine the invoice count.


sunny_talwar

Try the above expression by adding all dimensions in it and see if it gives you the desired output.

Not applicable
Author

It gave me a count of 20

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

If you have Primary Key in your data model I suggest count the Primary key.

Like ID sort of

avinashelite

Share your sample app and data will see whats the issues is

PrashantSangle

Hi,

Are you selecting Supress when Value is Null option from dimension tab.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂