Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to compare two values in an expression and get the difference but I don't want a negative number. Is there anyway to formulate this WITHOUT an If statement>???
Example: I'm comparing The Book quantitiy of several items and the counted quantity. I want a new field that is the difference between the two and is always a positive number.
Give it a try with (A>B)*(A-B)
should end with 0 for negative differences.
HTH
Peter
Hello, I apologize for not being clear in my original post. I am looking for the variation between the two numbers, I do not want any values to be changed to zeros.
For example if the book quantity is 20 and the counted quantity is 30 I want it to produce the number 10
and if the book quantity is 20 and the counted quantity is 10 I want it to produce the number 10 also.
I was wondering if this is possible without an If statement? Thank you for your help.
You can use the function fabs( ) to get the absolute value, always positive.