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: 
Anonymous
Not applicable

average of count distinct

Hello,  I didnt think I would have to ask you guys for that but im not getting it to work properly.

first table is my regular data count(distinct) per day per hour

count(DISTINCT {1<PickEvent={'PROGRESS'}>} PickLine)

second table I want to calculate, for all of my available data, the average count(distinct) per hour independent of any date selections.

avg(aggr(count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine),PickHour))

Any help is appreciated.

regards,

Lucas

1 Solution

Accepted Solutions
sunny_talwar

Try this

Avg({1} Aggr(Count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine), PickDate, PickHour))

View solution in original post

7 Replies
Chanty4u
MVP
MVP

did you tried like below?

aggr(avg(count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine),PickHour))

sunny_talwar

May be you forgot to add PickDate

Avg(Aggr(Count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine), PickDate, PickHour))

Anonymous
Not applicable
Author

the calculation is not working, showing no result 😕

Anonymous
Not applicable
Author

I was pretty sure i tried this and it didnt show any result.

anyways, this is working!! thanks!

Avg(Aggr(Count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine), PickDate, PickHour))

Anonymous
Not applicable
Author

sorry, it is still not working as intended.

the results are still varying depending on the date selection.

I thought the "1" in the set analysis would refer to the whole data set ignoring any selections 😕

sunny_talwar

Try this

Avg({1} Aggr(Count(DISTINCT {1<PickEvent={'PROGRESS'}>}PickLine), PickDate, PickHour))

Anonymous
Not applicable
Author

thanks for the quick reply!

now it works perfectly !!

much appreciated