# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
Highlighted
Contributor

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

1 Solution

Accepted Solutions

## 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.

talk is cheap, supply exceeds demand
6 Replies
MVP

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

Valued Contributor

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

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

Contributor

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

Valued Contributor II

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

which is the datasource currenthly you are using?

Contributor

## 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.

talk is cheap, supply exceeds demand