6 Replies Latest reply: Jul 8, 2013 4:17 AM by Gysbert Wassenaar

# calculating average for each month and summing all calculated averages

Hi guyz,

I have the following data and I want to calculate average for each month for specific (or selected) company/ies and display the total of averages.

I have tried avg(aggr(sum(Value),Company, Month(Period))) but I am not getting the desired result. Please guide..

Regards,

Raza

• ###### Re: calculating average for each month and summing all calculated averages

You can't use a calculated dimension in your advanced aggregation (i.e. Month(Period) is not allowed), so try

avg(aggr(sum(Value),Company, Period))

Then I am not sure what you want to calculate, the average over all monthly Company Values, or the sum of averages? What is your expected outcome (a small table showing this will probably help)?

• ###### Re: calculating average for each month and summing all calculated averages

Hi, Please find the attached files xlsx datasource and qlickview document, in the attached xlsx file I have done the calculation manually, basically this is the result which I want to achieve in the "Total" of "OS/WA" column (as shown in the below image) but I am not getting the desired result by "=sum(Aggr(avg([O/S Avg]) ,Month,Company))" formula

• ###### Re: calculating average for each month and summing all calculated averages

which is the datasource currenthly you are using?

• ###### Re: calculating average for each month and summing all calculated averages

the above provided xlsx file

• ###### Re: calculating average for each month and summing all calculated averages

You need to remove month from the aggr function: sum(Aggr(avg([O/S Avg]),Company)). See attached example.

• ###### Re: calculating average for each month and summing all calculated averages

Try to make a table about you want with this set of data...