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: 
loganathan
Contributor III
Contributor III

How to get distinct count even after having multiple dimensions

Hi All,

i have data like,

day month alerts
1 May A1
2 May A2
3 May A3
4 May A1
5 May A4

 

if i do 'Distinct count of alerts' in KPI i will get 4.

like same if i do 'Distinct count of alerts' in table where my dimensions are day and month i will get 5. which is valid.

but in table too i need it to be '4' as i dont want to count 'A1' again means my result table must  be like below. Any idea how to achieve this.

day month distinct count of alerts
1 May 1
2 May 1
3 May 1
4 May 0
5 May 1

 

Labels (1)
6 Replies
Chanty4u
MVP
MVP

Try this 

Count({<alerts = {"=Count(distinct {<day, month> alerts) > 0"}>} alerts)

 

loganathan
Contributor III
Contributor III
Author

Hi,

 

Thanks for your quick response. But this expression doesn't work. TIA

BrunPierre
Partner - Master
Partner - Master

Hi, Try this.

Count(DISTINCT If(Aggr (Count(DISTINCT alerts), month, day) = 1, alerts, Null()))

loganathan
Contributor III
Contributor III
Author

Hi Brun Pierre,

 

Thanks for your help. but tried with this condition still it doesnt work. Please advise.

 

Thanks.,

tresesco
MVP
MVP

tresesco_0-1685597731534.png

Note: Disable zero/null suppression

BrunPierre
Partner - Master
Partner - Master

Count(Aggr(Only(alerts), alerts))