Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
qlikknow
New 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
Partner
Partner

Re: Average calculation over dimension

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. 

5 Replies
anushree1
Valued Contributor

Re: Average calculation over dimension

please provide a sample of input and desired output

Partner
Partner

Re: Average calculation over dimension

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
New Contributor II

Re: Average calculation over dimension

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))

 

 

Partner
Partner

Re: Average calculation over dimension

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
New Contributor II

Re: Average calculation over dimension

Thanks.It worked