Newbies Malcolm99 0 Posted February 9 Newbies Share Posted February 9 I am new to FM and am wanting some help with a calculation. I have four fields, rate1 & rate2, quantity & result. What I am trying to figure out is how to have a calculation that will calculate the result of the value in the quantity field divided by the rate where if the field rate2 has no data (is empty) the calculation formula will use rate1 to calculate the result. However if there is a value in the field rate2 then the result should be calculated based on this rate2 and not use the value found in rate1. Appreciate any direction and help. Thanks Link to post Share on other sites
Ocean West 172 Posted February 9 Share Posted February 9 Quantity * GetValue ( List ( Rate2 ; Rate1 ) ; 1 ) Link to post Share on other sites
Newbies Malcolm99 0 Posted February 9 Author Newbies Share Posted February 9 Thanks thats exactly what was needed. Works as I wanted. Link to post Share on other sites
comment 1,794 Posted February 10 Share Posted February 10 10 hours ago, Malcolm99 said: if the field rate2 has no data (is empty) the calculation formula will use rate1 IMHO it would be much simpler to do exactly what you said: quantity / If ( IsEmpty ( rate2 ) ; rate1 ; rate2 ) instead of converting the values to text, stacking them into a list, extracting the first value from the list and converting it back to number. 1 Link to post Share on other sites
Ocean West 172 Posted February 10 Share Posted February 10 After second thought I would agree that what @comment suggests is actually better. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now