Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community!
I have a small table:

The first expresion is the simple sum.
I want get the second expresion with sum of the all values in the table but only values wich are largest than current string.
For example for Prod2 Sum 10+15+20 = 45 (all values >5, but not include 1)
Could somebody help me with this expresion?
Thanks!
Script:
InitialData:
LOAD *,
AutoNumber(Month1&Product1) as Key1;
LOAD Month(Date#(Month1, 'MMM')) as Month1,
Product1,
Amount1
Inline [
Month1, Product1, Amount1
Jan, Prod1, 5
Jan, Prod2, 10
Jan, Prod3, 12
Feb, Prod1, 1
Feb, Prod2, 5
Feb, Prod3, 3
Mar, Prod1, 20
Mar, Prod2, 14
Mar, Prod3, 7
];
FinalTable:
LOAD Month1 as Month,
Product1 as Product,
Amount1 as Amount,
Key1 as Key
Resident InitialData
Order By Month1, Amount1;
Expression:
=Sum(TOTAL <Month> Amount) - Aggr(RangeSum(Above(Sum(Amount), 0, RowNo())), Month, Key)
Try,
Sum({<Value={">5"}>}Total Value)
But I need do this for every row in table.
For example for the 1 rows it should be sum values only wich > 10 etc...
When you say 'greater than current string' what do you mean by 'current string'?
Yes, exactly!
Two cases:
I need get the next values (different for every row):

May be this?
You will have to keep the sorting like this to get this to work in the solution I am proposing
Sum(Total Value) - RangeSum(Above(Sum(Value),0, RowNo()))
NOTE: Used Mindaugas Bacius sample to make modification as I was too lazy to create my own ![]()
Hi Sunny
Just curious can we try this edit script using a loop kind of thing
For acheiving this does it require to sort the products in order , what I observed