Announcements
cancel
Showing results for
Did you mean:
Master II

## Difference between two expressions

Hi All,

What is the difference between the below expressions?

1) =Avg(Aggr( Sum(Sells), Products ))

2)=Aggr( Sum(Sells), Products )

Table:

Products,Sells

Product 1,10000

Product 2,60000

Product 3,70500

Product 4,45000

Product 5,50200

];

1 Solution

Accepted Solutions
Luminary Alumni

Hi,

You have only one record for each of the Product, if you have multiple records then you can see the difference.

Regards,

Jagan.

3 Replies
Master III

In this situation the AVG does not do much

As you already use AGGR to group you product AVG from this group will be the same as the AGGR.

and is the same as

=Avg(Sells)

Luminary Alumni

Hi,

You have only one record for each of the Product, if you have multiple records then you can see the difference.

Regards,

Jagan.

Luminary Alumni

Hi,

If you are using Product as dimension then there is no need of Aggr(), it should be used when there is no corresponding dimension used in the chart.

Below expressions also give the same result

1) =Avg(Sells)

2)=Sum(Sells)

Aggr() will have performance, so use it carefully whenever you need it really.

Regards,

jagan.

Community Browser