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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
jrdunson
Creator
Creator

Distinct Column Totals for a Straight Table?

Hey, I'm just wanting to show straight tables, yet for distinct values, per user selections:

IDKeyAmount
0000093529209240425
0000093529219257225
0000758673216415820
000054974021926380
0000549740219319950
0000740998216415625
0900300113210770250
???7195
Unique ID Count?Key countTotal Amount

How do I calculate a 'Unique ID Count' ? [i.e. should be 5] ...???

I've Google'd, tried to use Aggr(), Count DISTINCT, but haven't yet found a solution... Should this be simple?

Jarrell

Labels (1)
1 Solution

Accepted Solutions
jrdunson
Creator
Creator
Author

Hey everyone,

I figure this out...

- I replaced this:     count(DISTINCT [ID])

- With this: num(count(DISTINCT [ID]), '#,##0')

.. adding the num() make it work.

View solution in original post

8 Replies
manideep78
Partner - Specialist
Partner - Specialist

Hi,

Where do you want to use this ID Count. Is it in a text object or straight table.

If you want to show in a text object Count(Distinct ID) gives 5.

But if you want to show in a straight table you should remove Key. Since Key is unique and same ID is have 2 unique keys. you should see Id twice. if you remove Key then you can see sUnique Id in a table.

maxgro
MVP
MVP

create a chart (straight table)

dimension      Key

expression     see below lables

1.png

jrdunson
Creator
Creator
Author

I tried this... and didn't work... my column results in zeros...and there is nothing in the total field.

My column is an expression: Count (Distinct [ID])

Here are my results (PS. my table has 943,000 rows in it...so, I didn't highlight the exact same rows as I did above, but here is another few rows as another example):

cnt_distinct.JPG.jpg

manideep78
Partner - Specialist
Partner - Specialist

make sure in the expressions tab, total mode is set to expression total.

jrdunson
Creator
Creator
Author

It is... already...

temp.JPG.jpg

jrdunson
Creator
Creator
Author

Sorry, I can't remove the 'Key' field

manideep78
Partner - Specialist
Partner - Specialist

Can you please upload your app with some sample data.

jrdunson
Creator
Creator
Author

Hey everyone,

I figure this out...

- I replaced this:     count(DISTINCT [ID])

- With this: num(count(DISTINCT [ID]), '#,##0')

.. adding the num() make it work.