Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have straight table with 3 columns with diff scenario values... i need to find out the Max value out of 3 values. its a max of absolute numbers however i need to retain the sign .
Scenario-1 | Scenario-1 | Scenario-1 | Max(Scenario) |
120 | -212 | -830 | -830 |
-388 | 990 | 113 | 990 |
-787 | 93 | 188 | -787 |
try
=FirstSortedValue(Senario,- Value)
Perhaps This.
=FirstSortedValue(Max(Expression), Dim)
There may be cleaner ways to do this, but this should work:
NumMax(fabs(Column(1),fabs(Column(2),fabs(Column(3)) *
If(NumMax(Column(1),Column(2),Column(3)) = NumMax(fabs(Column(1),fabs(Column(2),fabs(Column(3)),1,-1)
Explanation: First, we find the maximum absolute value.
Second, we check if this value is equal to the maximum non-absolute value. If it is, then it was a positive number (multiply by 1). If it isn't, then it was a negative number and we need to multiply by -1 to reverse the sign.
Dear Udaya,
This perhaps?:
Data:
LOAD * INLINE [
Scenario, Value
1, 120
1, -212
1, -830
2, -388
2, 990
2, 113
3, -787
3, 93
3, 188
];
Then
Scenario | FirstSortedValue(Value,-Fabs(Value)) |
---|---|
990 | |
1 | -830 |
2 | 990 |
3 | -787 |
Cheers
Andrew
Hi,
May be like this,
Using this expression,
=Sum(IF(fabs([Scenario-3])>fabs([Scenario-1]) and fabs([Scenario-2]),[Scenario-3],
IF(fabs([Scenario-1])>fabs([Scenario-2]) and fabs([Scenario-3]),[Scenario-1],
IF(fabs([Scenario-2])>fabs([Scenario-1]) and fabs([Scenario-3]),[Scenario-2]))))
Hope this helps,
PFA,
Hirish
Thank you everyone with valuable inputs. I had similar idea what Shoham had suggested, until we have clear solution i am going to make use of this expression. its working...thank you everyone!