Calculated If statement

598
2
Jump to solution
10-12-2020 02:42 PM
JordanMiller4
Occasional Contributor III

How do you write an If statement based on a value from previous fields. If TYPECODE = 3 and MCF is > 500 calculate 1801 Engineering Dept as the answer? My statement below doesn't seem to work. Any help would be appreciated!

${TYPECODE}='3' and if(${A00MCFTOTAL}>500,"1801 Engineering Dept"))

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi Jordan

Your expression is almost there; try putting the and argument inside the if() statement. Also, if() statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false, i.e.

if(condition, value if true, value if false)

So your expression could look something like:


if(${TYPECODE}='3' and ${A00MCFTOTAL}>500,'1801 Engineering Dept','Some other value')

Replace 'Some other value' with the desired output if false (use '' for a blank).


Please find more on formulas here Formulas—ArcGIS Survey123 | Documentation 

Best,
Jim

View solution in original post

2 Replies
Jim-Moore
Esri Regular Contributor

Hi Jordan

Your expression is almost there; try putting the and argument inside the if() statement. Also, if() statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false, i.e.

if(condition, value if true, value if false)

So your expression could look something like:


if(${TYPECODE}='3' and ${A00MCFTOTAL}>500,'1801 Engineering Dept','Some other value')

Replace 'Some other value' with the desired output if false (use '' for a blank).


Please find more on formulas here Formulas—ArcGIS Survey123 | Documentation 

Best,
Jim

JordanMiller4
Occasional Contributor III

Thank you! this is perfect!

0 Kudos