Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AGGR()

hello everyone,

i have below table, i want to used AGGR function to calculate average.

i am not getting why both o/p shows differ value if they calculate average.

it become difficult for me to find a difference between them.

=avg(aggr(sum(sales),prod))                          =avg(sales)

                     

why it shows different o/p if they calculate average ?

please let me know

thank you..

1 Solution

Accepted Solutions
Lucke_Hallbergson

If You want the average per sale when using aggr  =avg(aggr(avg(sales),prod, code)) will get the average sale per sale (not just product) eg 304,16667 if that is what You want.

View solution in original post

15 Replies
tresesco
MVP
MVP

Read this blog: Average – Which average? It would be worth reading I guess.

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Prachi ,

try below One :

=Aggr(Avg(sales),prod)


Thanks,

Arvind Patil

Anonymous
Not applicable
Author

=Sum( sales) / Count( distinct prod) it shows 365

but when i used code instead of prod then it show 304.16

Anonymous
Not applicable
Author

it shows o/p when i clicked on field otherwise it shows blank

effinty2112
Master
Master

Hi Prachi,

Your total sales = 3650.

avg(sales) = your average per line = 3650 / 12 = 304.16666

avg(aggr(sum(sales),prod)) will give the average per prod = 3650 / 10 = 365.


Regards


Andrew



rohitraut
Creator
Creator

Hello Prachi,

Try this,

=avg(aggr(sum(sales),prod,code))

its_anandrjs

Your Avg(Sales) and avg(aggr(sum(sales),prod)) both are different first go for the AVG calculation and check the result



1. Avg(Sales) give different result try to put this all expression in the chart and see the result what they return back.

2. avg(aggr(sum(sales),prod)) is also different it is by Prod and if you use


avg(aggr(sum(sales),prod,code))

or

avg(aggr(sum(sales),code))


This all are also different so be aware about the AVG usage and output also.

Anonymous
Not applicable
Author

ok but in the following exp  why it doesn't take average per prod ,it shows 304.16 o/p

= Avg( Aggr( Sum(sales), prod,code ) )

Anonymous
Not applicable
Author

but how i know which is correct or not