Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can someone explain in plain English what the script statement min() GROUP achieves ?
I've seen it in code and I assume it returns the minimum value of a named field. But what does GROUP do ?
Thanks
MV
Load ID,Min(Sale) Group by ID;
Load * Inline [
ID,Sale
1,100
1,200
2,10
2,100];
Here we grouped on ID and calculated min of Sale from each group of IDs
Min from this group(ID=1) is 100
1,100
1,200
Min from this group(ID=2) is 10
2,10
2,100
hi
are you asking about group by
if it is
group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.
Group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.
Hi,
maybe this explanation will help you:
group by is a clause used for defining over which fields the data should be aggregated (grouped). The aggregation fields should be included in some way in the expressions loaded. No other fields than the aggregation fields may be used outside aggregation functions in the loaded expressions.
BR
Michael
Clollecting the data across multiple fields and group the result by one
Load ID,Min(Sale) Group by ID;
Load * Inline [
ID,Sale
1,100
1,200
2,10
2,100];
Here we grouped on ID and calculated min of Sale from each group of IDs
Min from this group(ID=1) is 100
1,100
1,200
Min from this group(ID=2) is 10
2,10
2,100
Thank you for your clear answer and helpful example, Anbu.
It's a shame some people can only be bothered to copy the same text from the same reference manual. I suppose they think it's a quick and easy way to accumulate points.
MV