Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anybody tell how to use How to use Aggregation at script level
Thanks
Do you mean using Aggr() ?
Yes Cheliyan,
In Designing we can write avg(aggr(sum(sales),Country)), like this.
similar way i should do the same in the script level
Thanks
You cannot use Aggr() in script. You can try like this
Initial:
Load * Inline [
Country,Sales,Year
India,1000,2013
India,2000,2014
China,1000,2013
China,200,2014 ];
Join(Initial)
Load Country,Sum(Sales)/Count(Country) As Avg Resident Initial Group by Country;
Hi,
there are multiple aggregation functions for the script, they all have in common that there must be a group by clause for all fields loaded but not aggregated:
hope this helps
regards
Marco