Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
ID | Days | max(days)-min(days)-currentvalue |
---|---|---|
A | 5 | 0 |
B | 7 | -2 |
C | 2 | 3 |
Hi experts,
I have a straight table with ID and Days. ID is the dimension and Days is expression. i want to create the 3rd column as an expression but i do not know how to write the expression.
I want to find out the max number of days (7) and min number of days (2) in Days column and use that number (5) minus the value in Days.
as the selections changes, the max number of days and min number of days will be changed dynamically.
How do I achieve this?
thanks!
Try this
RangeSum(Max(TOTAL Aggr(DaysExpressionHere, ID)), -Min(TOTAL Aggr(DaysExpressionHere, ID)), -Days)
Replace DaysExpressionHere with your Days expression
May be this
RangeSum(Max(TOTAL Days), -Min(TOTAL Days), -Days)
Thanks for replying, but it shows this
A 5 -5
B 7 -7
C 2 -2
looks like it is calculating only the line itself so max and min are the same.
I wonder why, I am seeing this
is Days a field or expression?
Days is an expression.
Try this
RangeSum(Max(TOTAL Aggr(DaysExpressionHere, ID)), -Min(TOTAL Aggr(DaysExpressionHere, ID)), -Days)
Replace DaysExpressionHere with your Days expression
Sunny, you are number 1!
thanks for your help!
No problem
but i am wondering why can't I just use minus instead i have to use rangesum?