Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I met one problem, how to obtain each group's sum, and to save this sum as one field in script.
The scenario is I need to monitor each group's quantity, once it exceeds one value(like 2 as below), the system will send alert.
Thank you very much!
group | quantity |
---|---|
A | 1 |
A | 2 |
B | 2 |
C | 3 |
load group,
sum(quantity)
from tablename
group by group;
Jack,
Try this:
max(aggr(sum(quantity),group))
Thanks,
AS