Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
erivera10
Creator
Creator

AGGR Fuction

Hi,

I need help, I have this por expression Double,

IF(SUM(AGGR(sum(Amount),Group))>9,

Sum(Aggr(sum(9),Group)),

Sum(Aggr(sum(Amount),Group)))

and this por Triple

IF(SUM(AGGR(SUM(Amount),Group))<9,0,

Sum(Aggr(Sum(Amount)-9,Group)))

I have this natural table:

Group Amount
A1
A2
A4
B2
B3
C1
C4
D4
D6
E5
E6
F1
F2
F3
F4

But I need to separete de data of the Amount, for example, Sum Value F is 10, so for doubles is 9 and for Triples 1,

the maximum for Doubles is 9, and Triples don´t have limits,

The total results are this

Group SUM(AGGR(SUM(Amount),Group))
48
A7
B5
C5
D10
E11
F10

And Amount in Doubles and Triples need to be this

Group Dobles Triples
63 -6
A70
B50
C50
D91
E92
F91

But the total sum not is true, Doubles=44 and Triples=4, I don´t Found the solution, and subsequently, I will to do a chart whit the velocimeter, Thanks a lot.

1 Solution

Accepted Solutions
sunny_talwar

Suggest to slightly simplify the expressions

Doubles

=Sum(Aggr(RangeMin(9, Sum(Amount)), Group))

Triples

=Sum(Aggr(RangeMax(0, Sum(Amount)-9), Group))

View solution in original post

4 Replies
Anil_Babu_Samineni

Attached

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Suggest to slightly simplify the expressions

Doubles

=Sum(Aggr(RangeMin(9, Sum(Amount)), Group))

Triples

=Sum(Aggr(RangeMax(0, Sum(Amount)-9), Group))

erivera10
Creator
Creator
Author

Sunny,

Thanks a lot, its working, and very simple.

erivera10
Creator
Creator
Author

Anil,

Thanks a lot, its work, too.