Hello
For this expression:
IF [Existing Reserve (USD)]>[v_Previous E&O Reserve (USD)]
THEN [v_Previous E&O Reserve (USD)]
ELSE [Existing Reserve (USD)]
ENDIF
I am expecting Zero to be greater than Neg value.
How can I modify the expression to return Zero as being greater than a negative value.
Thank you.
Solved! Go to Solution.
It's working as built. Swap the > to be a < and it should work as you're thinking
You're saying with your values:
If 0 > negative [true]
then return negative [returned in your workflow]
else return 0
endif
Could you provide a bit more explanation to what the issue is? The formula seems to be working as expected as it's returning the negative value given that it's less than the 0. Unless the question is for the logic to swap, in which case the operator would just switch from ">" to "<".
Depending on the exact data, you can use the Max() or Min() function as well instead of the IF statement.
Here is another version of my expression.
IF [v_Previous E&O Reserve (USD)]<[Existing Reserve (USD)]
THEN [v_Previous E&O Reserve (USD)]
ELSE [Existing Reserve (USD)]
ENDIF
The -2370.05 should be 0
Should I take the ABS value of [v_Previous E&O Reserve (USD)]?
With this formula, you flipped too many things - it's also giving the correct output based on the provided logic. Translated, here is what the formula is saying:
If -2370 is less than 0 (TRUE), then return -2370, otherwise return 0.
The two formulas below will return 0:
(Flipping the operator)
IF [v_Previous E&O Reserve (USD)]>[Existing Reserve (USD)]
THEN [v_Previous E&O Reserve (USD)]
ELSE [Existing Reserve (USD)]
ENDIF
(Flipping the THEN and ELSE clauses)
IF [v_Previous E&O Reserve (USD)]<[Existing Reserve (USD)]
THEN [Existing Reserve (USD)]
ELSE [v_Previous E&O Reserve (USD)]
ENDIF
Looking at your new formula, it's working as written:
If -2370 < 0 [TRUE]
then put -2370
if 75 < 0 [FALSE]
else put 0
Also, in your initial expression, you put:
[Existing Reserve (USD)]>[v_Previous E&O Reserve (USD)]
In your reply with your 2nd version, you put:
[v_Previous E&O Reserve (USD)]<[Existing Reserve (USD)]
Those are the same since you switched both the > and the fields. In both cases, the side that's greater is point to the Existing Reserve
You need to EITHER change the > to a < and leave the fields in their initial order:
[Existing Reserve (USD)] < [v_Previous E&O Reserve (USD)]
OR swap the order of the fields but leave the > :
[v_Previous E&O Reserve (USD)] > [Existing Reserve (USD)]