Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to calculate max of sum like example below
date | ID | Sticker | Amount |
---|---|---|---|
1 | T1 | A | 100 |
1 | T1 | B | 200 |
1 | T1 | C | 300 |
2 | T1 | A | 200 |
2 | T1 | B | 100 |
2 | T1 | C | 400 |
1 | T2 | D | 2 |
1 | T2 | E | 3 |
1 | T2 | F | 5 |
2 | T2 | D | 8 |
2 | T2 | E | 7 |
2 | T2 | F | 1 |
I want the result is :T1 = 200+100+400=700
T2=8+7+1=16
this means Sum Amount based on each date, and choose Max number for each ID T.
ID | Amount |
---|---|
T1 | 700 |
T2 | 15 |
I used to a set analysis: max(aggr(sum(Amount),Date))
But it doesnt work
Hi,
for T1, if you need max(amount) for each date, it will be:
T1= 300 (for date 1) + 400 (for date 2) = 700
for T2:
T2= 5 (for date 1) + 8 (for date 2) = 13
Hi, this works for me:
Max(Aggr(Sum(Amount),date, ID))
try this expression:
=sum(aggr(max(Amount),ID,date))
It is right, awesome. Thanks so much
Do you mind marking it as correct?