Hello community,
I have to do a lot of controls (boolean) and base and theses controls give me a value based on its true or not.
I do a lot of these technicals line items for :
-Controlling element
-Color Coding
-...
I code it in 3 steps :
- 1) Business Element (Number) : Uselly a business value
- 2) Control (Boolean) : Management rules that I want to verify (ex : Business Element > 0)
- 3) Color Coding (Number) : Based on the control I will apply a value in order to build a color coding.
It is not very complicated to do. Nevertheless, this 3rd step forces me to write it this way :
Color Coding = IF Control THEN XX ElSE XX
I try to split my line items when I can in order to have the best lisibility but this 3rd step create complexity where there is not.
It would be great to have a direct formula to convert a boolean into a number. I image a formula that would be such as :
CONVERT(Condition, true value result, false value result)
Where :
Condition : Boolean LI
True value result : Number
False value result : Number
Source : Boolean
Output : Number
Best regards,
NT