Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

compare month prodution with average prodution

hi, this is my firt post and this is my first project

i have this table

   

this one i can create

but i can't create this one

the total is calculated by adding the total of each january (4+6+6)

and the avarege is the avarege of (4,6,6) i.e in this case (4+6+6)/3

can anyone help me.

thaks

Tags (4)
6 Replies

Re: compare month prodution with average prodution

Try this: avg(aggr(sum(qty), year))

- Marcus

ecolomer
Honored Contributor II

Re: compare month prodution with average prodution

Your formula for calculate average are wrong

you can use:

Sum(total) / count(distinct year) 

or

Sum(qty) / count(distinct year)

or

avg(aggr(sum(qty), year)

MVP
MVP

Re: compare month prodution with average prodution

Check enclosed file....

Not applicable

Re: compare month prodution with average prodution

i only have to add the month

avg(aggr(sum(qty), year, month))

the average its ok, but it returns the average of my selection, i want the average of all the data.

thanks

Not applicable

Re: compare month prodution with average prodution

i think its this

avg({1}aggr({1}sum({1}qty)), year, month))

thaks to all

MVP
MVP

Re: compare month prodution with average prodution

it should be

SUM({1}qty)

and

Avg({1}Aggr(SUM({1}qty),Year))

Community Browser