5 Replies Latest reply: May 14, 2014 7:30 AM by jagan mohan rao appala

# Average of monthly figures

Hi I am trying to get an average for monthly figures but having no joy

I have a straight table with expressions for Average National figures per month which are calculated figures themselves

So the January expression is:

=sum({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue)/count({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue)

I want the table to show as follows:

Jan   Feb   Mar   Average

6.8   6.0     8.2    7.0

I have tried to get the average but havent been successful

Any help would be great

Thank you

• ###### Re: Average of monthly figures

Hi Rhona,

Below you can find a post that probably illustrate why you are not getting the expected result

http://community.qlik.com/blogs/qlikviewdesignblog/2013/07/29/averages

Cheers

Carlos

• ###### Re: Average of monthly figures

Hi,

Try this.It may work

=avg({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue) and Month as dimension.

Regards,

Neelam

• ###### Re: Average of monthly figures

Hi,

Try like this

=Avg({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue)

or I think the denominator should be employee count instead of ActualValue

sum({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue)/count({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>} EmployeeCount)

Regards,

jagan.

• ###### Re: Average of monthly figures

Hi

I need to have the average in a column showing the average for whatever months are loaded so for 2014 at present it would be for Jan to May showing average of their figures added together and divided by 5.  I have no employee count and have tried ReferredMM count but doesnt work.

When I put in any of the above I only get one figure no matter what selection I make and it isnt the right one.

Rhona

• ###### Re: Average of monthly figures

Hi,

Try this

sum({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>}ActualValue)/Count(DISTINCT Month)

OR

sum({\$<ActivityKey ={10},ReferredMM={1},ServiceProviderType={H}>} TOTAL ActualValue)/Count(DISTINCT Month)

Regards,

Jagan.