Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
marthajesicap
Contributor
Contributor

How to average of sum of data per month

Hi, having an issue with getting to a monthly data average and wonder if someone can help . The below is an example of my data and the calculation that i made in excel:

DateNameWeight
1-Jan-21Ana0.25
1-Jan-21Mia0.31
2-Jan-21Ana0.28
2-Jan-21Mia0.33
3-Jan-21Ana0.26
3-Jan-21Mia0.27
1-Feb-21Ana 0.19
1-Feb-21Mia0.3
2-Feb-21Ana0.27
2-Feb-21Mia0.26
3-Feb-21Ana0.24
3-Feb-21Mia0.22

 

MonthHow I wrote the formula in excel
JanAVERAGE(SUM(D4,D6,D8),SUM(D5,D7,D9))
FebAVERAGE(SUM(D10,D12,D14),SUM(D11,D13,D15))

 

and this is the result that i want to show:

Jan0.85
Feb0.74

 

any ideas?

thank you

1 Solution

Accepted Solutions
tresesco
MVP
MVP

I missed at the first place, your calculation is actually based upon two dimensions, Month as well as Name. Try:

=Avg(Aggr(Sum(Weight), Month, Name))

View solution in original post

7 Replies
marthajesicap
Contributor
Contributor
Author

i'm having issue with the script. 

i made a new field for Month (Jan, Feb)

and for the calculation
i wrote:

Avg(Aggr(Sum(Weight), Month)

please help me to correct the script.

Thank you

tresesco
MVP
MVP

Could you share your excel?

marthajesicap
Contributor
Contributor
Author

this is the excel. 

thank you

tresesco
MVP
MVP

I meant excel with excel data, formula and output. I will try to get you the same in qlik

marthajesicap
Contributor
Contributor
Author

i hope this is what you meant.

Thank you 

tresesco
MVP
MVP

I missed at the first place, your calculation is actually based upon two dimensions, Month as well as Name. Try:

=Avg(Aggr(Sum(Weight), Month, Name))

marthajesicap
Contributor
Contributor
Author

It helps me.

Thank you so much