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

Case for aggr function?

Hi friends,

I am trying to count distinct number of events per year based on a date, but there is a problem when it is used the regular count ( Distinct "dimension") in expression chart.

Below is the fact table:

IDDateEventControl
A01/01/2015X1
A01/01/2015X2
A01/01/2015X3
A03/07/2015X1
A03/07/2015X2
B02/01/2015Z1
B02/01/2015Z2
C02/10/2015X1
B10/10/2015X1
B10/10/2015X2

So, in this case, when I use the expression Count ( distinct ID), having the dimension year(Date) and Event, the result is:

A = 1

B = 1

C = 1

But the desirable result is:

A = 2

B = 2

C = 1

Does anyone have an idea of what can be done?

Thanks in advance.

3 Replies
Gysbert_Wassenaar

Try count(distinct Date) as expression with ID as dimension


talk is cheap, supply exceeds demand
Frank_Hartmann
Master II
Master II

Straight Table:

Dim = ID

Exp1 = count(aggr( ID,Date))

Unbenannt.png

Anonymous
Not applicable
Author

Thanks friends,

I forgot to include that the result will be shown in a chart like this:

event.png