Greetings,
I am trying calculating a field based on an If statement: if(selected(${section},'>=1'),${town},${permit_area}). However, this does not appear to be working because it always produces the false response (${permit_area}). If I do this: if(selected(${section},'1'),${town},${permit_area}) and set ${section} to 1, it produces the true response (${town}. I'm assuming it's a syntax error in the former and I've tried everything I can think of. I do not get error messages with either of these approaches. The evaluation attribute (${section}) is integer. I have tried it with the field I am trying to calculate defined as string and with no definition. Any help would be greatly appreciated.
Bob
If I follow I think your issue is that drop down lists are always strings. So using a >=1 makes no sense.
The way it is written you are asking if the string '>=1' has been selected.
Hi Doug,
Thanks for the response. It is straight data entry, or a feed from Explorer for ArcGIS. See below. If the user enters a value for Section, then I want to calculate the field of interest (hidden) with Township ($). If Section is missing, I want to populate the field of interest with DPA. All are of type Integer. Does that help any?
Bob
The selected command is for drop downs not data entry. And I think all drops downs are string. So you are kinda losing me.
Sounds like the Select option is the wrong approach, but if so, I’m not sure why a specific value works. (I did try it Section as a string format.) Here is what I am trying to do: “If there is a legitimate value for Section, then the location resolution ($) is “TRS”; otherwise it is “DPA”.
If you mean just check if it is blank then
if(${section}="",${town},${permit_area})
If section is a number I think you have to do this if I remember right. Yea I know string length on a number but until it is filled in it is blank.
if(string-length(${section})=0,${town},${permit_area})
Two suggestions:
if(${section_num} >= 1, ${town}, ${permit_area})
This will return {town} for any value grater than 1 if it is selected/input in {section_num} and {permit_area} if zero or less. I am not quite sure if you are using a dropdown or text field.
Lance Cole I did try the code you suggested with ${section}, but was still getting error messages. I did not know section was reserved, hence the unexplained squirreliness. Your suggestion to use something else worked. Thanks!
Opps missed the Reserved Word. Note that in Excel on the Types tap it lists all the reserved words for you.