I am trying to calculate a fee based on a entered amount and I have that field set to a integer type.
I am thinking possibly an if statement.
if(${estValueofWrk}<1000) then ${estValueofWrk} div 100) * 2 + 25) or if(${estValueofWrk}>=1000 and${estValueofWrk}<49,999 then ${estValueofWrk} div 1000) * 5 + 50) or if(${estValueofWrk}>=50,000 and${estValueofWrk}<99,999 then ${estValueofWrk} div 1000) * 4 + 250) or if(${estValueofWrk}>=100,000 and${estValueofWrk}<499,999 then ${estValueofWrk} div 1000) * 3 + 450) or if(${estValueofWrk}<500,000 then ${estValueofWrk} div 100) * 3 + 1500) or if (${estValueofWrk}>=16,166,666, then 50,000)
I am lost, thank you to anyone that can assist me in advance.
Solved! Go to Solution.
if(${estValueofWrk} < 1000, (${estValueofWrk} div 100) * 2 + 25,
if(${estValueofWrk} >= 1000 and ${estValueofWrk} < 50000, (${estValueofWrk} div 1000) * 5 + 50,
if(${estValueofWrk} >= 50000 and ${estValueofWrk} < 100000, (${estValueofWrk} div 1000) * 4 + 250,
if(${estValueofWrk} >= 100000 and ${estValueofWrk} < 500000, (${estValueofWrk} div 1000) * 3 + 450,
if(${estValueofWrk} >= 500000 and ${estValueofWrk} < 16166666, (${estValueofWrk} div 100) * 3 + 1500,
if(${estValueofWrk} >= 16166666, 50000, 0))))))
if(${estValueofWrk} < 1000, (${estValueofWrk} div 100) * 2 + 25,
if(${estValueofWrk} >= 1000 and ${estValueofWrk} < 50000, (${estValueofWrk} div 1000) * 5 + 50,
if(${estValueofWrk} >= 50000 and ${estValueofWrk} < 100000, (${estValueofWrk} div 1000) * 4 + 250,
if(${estValueofWrk} >= 100000 and ${estValueofWrk} < 500000, (${estValueofWrk} div 1000) * 3 + 450,
if(${estValueofWrk} >= 500000 and ${estValueofWrk} < 16166666, (${estValueofWrk} div 100) * 3 + 1500,
if(${estValueofWrk} >= 16166666, 50000, 0))))))
That worked perfectly, now how do I format it that it will return the value in $##,###?
I'm not sure there is anything built-in to do it. There's a way mentioned here
Well after some testing it is not quite working perfectly. When I put in like 1,700,000 it is calculating 52500 if I put in 1,100,000 it calculates 34500. I currently have my set as a text maybe I should have it set as an integer?
That seems to be correct values from the logic of the first question. What are you expecting as the results?
(1,700,000 / 100) * 3 + 1500 = 52500
(1,100,000 / 100) * 3 + 1500 = 34500
I got it figured out, one of the div was a 100 and not 1000 and it was throwing everything for a loop.
Take a look at this community thread: https://community.esri.com/t5/arcgis-survey123-questions/conditional-if-then-else-logic-in-survey123...
Survey123 doesn't use quite the language you'd expect. There's no "then" for example. Doug does a good job showing how an if statement could work here.