Hello I have a Feature Layer with three integer fields (A, B, and C)
I want to calculate the percentage between A and B. The following will run but I only get values of 100 or 0. Nothing in between, and manual calculations prove that there are valid values between 100 and 0.
Solved! Go to Solution.
It's the integers. Take your first expression, (B/A) * 100. Since B/A evaluates first, you're stuck with whatever rounded integer value results from the division. That is, 0 or 1, which then multiplied by 100 gives you 0 and 100, respectively.
Try instead, (B*100)/A. By multiplying your integer first, you avoid truncating the divided value as drastically.
It's the integers. Take your first expression, (B/A) * 100. Since B/A evaluates first, you're stuck with whatever rounded integer value results from the division. That is, 0 or 1, which then multiplied by 100 gives you 0 and 100, respectively.
Try instead, (B*100)/A. By multiplying your integer first, you avoid truncating the divided value as drastically.
You are a legend! Thank you!