Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average over period sum

Hi, i have the following table for example

test:

load * inline [

period,      branch, salesAmount

201401,    1         , 1000

201402,    2         , 1200

201312,    1         , 1400

201312,    2         , 1000

201311,    1         , 800

201402,    1         , 1050

];

i wish to calculate average of period sum sales amount. i'm looking for some examples and i've found Aggr(Total ...) function, but i don't understand totally how it works.

In this case it should be 1612,5

thanks!

1 Solution

Accepted Solutions
rubenmarin

Hi, try:

=Avg(Aggr(Sum(salesAmount), period))

View solution in original post

4 Replies
rubenmarin

Hi, try:

=Avg(Aggr(Sum(salesAmount), period))

veidlburkhard
Creator III
Creator III

Hi Alexander,

simply use: Sum(salesAmount) / Count(DISTINCT period)

Hope this helps

Burkhard

Not applicable
Author

Thank you very much, it was i've been looking for.

Not applicable
Author

Thanks Burkhard, but my real expresion is so complex and Aggr is more simple for read, this data was only to show you that i want to make.

Regards!