I'm trying to calculate the difference in % betwee...
# general
b
I'm trying to calculate the difference in % between to Result columns in a Saved Search. Essentially, I want it to always be a positive difference. So: PO Amount = 25 Bill Amount = 30 Difference = 18.1818% PO Amount = 30 Bill Amount = 25 Difference = 18.1818% I'm trying to use this:
Copy code
(({netamount}-{billingtransaction.netamount})/(({netamount}+{billingtransaction.netamount})/2))*100
but it's throwing an error
g
Try putting a NULLIF around the denominator:
NULLIF((({netamount}+{billingtransaction.netamount})/2),0))*100
k
I think Greg's on right path here.
One thing you might have to do - is include criteria of billing.transaction fields amount is not equal to zero.
g
Sometimes NS doesn't explicitly call out the "possible divide by zero" error and just has a stroke.
b
I love you guys
party furby 1
🎉 1
@Gregory Jones and @KevinJ of Kansas