Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
Can anyone explain the aggr function with example, more than what is mentioned in reference manual?
Thanks and regards,
Murali
Hi,
Aggr() functions is used when you are counting or sum up by a particular field(s).
Suppose
Dept EmpID
Sales 101
Sales 102
Sales 102
Sales 103
Market 104
Market 101
Suppose if we want to get the count of Distinct employees by department
If you use Count(Distinct EmpID) then you will get the value as 4.
But if you use Aggr for getting Distinct Employee by department
then we have use
=Sum(Aggr(Count(Distinct EmpID), Dept)) Now you will the get the value as 5. For Sales Dept there are 3 and for Market 2 by summing up all this becomes 5.
This is one of the sample scenario for using AGGR().
Hope this helps you.
Regards,
Jagan.
Hi,
Aggr() functions is used when you are counting or sum up by a particular field(s).
Suppose
Dept EmpID
Sales 101
Sales 102
Sales 102
Sales 103
Market 104
Market 101
Suppose if we want to get the count of Distinct employees by department
If you use Count(Distinct EmpID) then you will get the value as 4.
But if you use Aggr for getting Distinct Employee by department
then we have use
=Sum(Aggr(Count(Distinct EmpID), Dept)) Now you will the get the value as 5. For Sales Dept there are 3 and for Market 2 by summing up all this becomes 5.
This is one of the sample scenario for using AGGR().
Hope this helps you.
Regards,
Jagan.
Thanks Jagan