I have a simple label expression that I use for utility lines that give me size and material in a mapbook.
[diameter] + "in " + [materialType]
I have values that are <Null>. Thru the label expression is there script that I can add to replace the <Null> with a question mark etc. I know I can just change the field, but would be nice to have the expression do it
Thanks
Thanks for quick response.
My label expression box only shows Jscript and VBScript parsers. I have ArcMap 10 does that matter.
Sorry I am a GIS/CAD guy and don't know much about scripts.
Thanks
Mike Froese the syntax is different maybe someone else will chime in with the proper syntax
Wes,
I had something similar, but ended-up using falsy logic on the null string check:
def FindLabel ( [NominalDiameter], [Material] ): ins, material, nd, q = ' in ', str([Material]), str([NominalDiameter]), '?' if not [Material]: label = ''.join([nd, ins, q]) else: label = ''.join([nd, ins, material]) return label
In Python? See Picture below vbscript you would test for isNull
Thanks for quick response.
Sorry I am a GIS/CAD guy and don't know much about scripts.
Is the fieldvalue a default name or do I put my values in. Plus what is FLG=
Mine comes up with either diameter= or materialtype=
Thanks
One trick to format the field name correctly is to place your cursor where you want to insert the field then double click on the name of the field list in the box above. The field name should be inserted properly formatted for the scripting language you are using.
Hope this make sense!
My field, called "NULLS", has some nulls and some values. Use IsNull() to test in VBScript:
Function FindLabel ( [NULLS] ) if IsNull([NULLS]) then label = "?" else label = [NULLS] end if FindLabel = label End Function