Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikknow
Contributor II
Contributor II

Average calculation over dimension

Hi,

     I am trying to calculate overall average over a dimension.As shown in below table how to calculate avg for Count column and display same overall average for all dates.Tried Aggr and avg in expression but no luck.

QQ.PNG

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

The following expression does what you need:

Sum(Total Aggr(Count(Value), Name, Date))
/
(Count(Total Aggr(Count(Value), Name, Date)) - 1)

Regards,

Jaime. 

View solution in original post

5 Replies
anushree1
Specialist II
Specialist II

please provide a sample of input and desired output

jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

I am not sure if I understood your issue but I think that the following expresion may work:

Avg(Total Aggr(Count(Value), Name, Date))

Where I supposed that your count expression is "Count(Value)". Please, use your correct count expression above. I get the following output:

2019-05-23 11_13_43-Window.png

Hope it helps! Regards,

Jaime. 

qlikknow
Contributor II
Contributor II
Author

Thanks @jaibau1993  it worked added dimension after Total.I want to make small change to avg.In numerator I want to consider all records (4 records as shown) for Avg but divided by 3 instead of 4.So for ABC I want to show 10/3=3.33 instead of 10/4=2.5.thanks in advance

 

Avg(Total<Name> Aggr(Count(Value), Name, Date))

 

 

jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

The following expression does what you need:

Sum(Total Aggr(Count(Value), Name, Date))
/
(Count(Total Aggr(Count(Value), Name, Date)) - 1)

Regards,

Jaime. 

qlikknow
Contributor II
Contributor II
Author

Thanks.It worked