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

Avg of count distinct

Hello,

I use a Count( DISTINCT Date) to calculate the unique number of days per month that a truck is used.

I get this result:

Truck 101 => 12 days
Truck 102 => 27 days
Total          => 27 days

I would like to get the average of 12+27= 19.5

I've tried the next, but with the same 27 as result:

Avg(
        Aggr(
                   Count(DISTINCT Date),Month
                   )
        )

Can anyone help me out?

Thanks in advance

Jan

 

 

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Try this may be

Avg(
        Aggr(
                   Count(DISTINCT Date), Month, Truck
                   )
        )

View solution in original post

2 Replies
sunny_talwar

Try this may be

Avg(
        Aggr(
                   Count(DISTINCT Date), Month, Truck
                   )
        )

janvandernagel
Contributor III
Contributor III
Author

Thats it!

Thanks a lot