Hi everyone,
I want to create a label expression which identifies if a string attribute contains a portion of text. If it does, return the value of that text.
e.g. In my head the logic must be something like...
If $feature.attribute Contains "text"
Return "text"
I'm sure its an easy answer, but I'm struggling to figure it out. Any help appreciated!
Could you give an example of the input values and its expected output?
Sure,
The attribute in question contains strings. Sometimes the strings are single words, other times they are separated by a comma.
For example, attribute is "Number". Some features in the feature class will have the values in text such as "one" or "two" etc. And some values will be concatenated such that they read "one, two" or "three, four" etc.
I want to create a label expression so that any record containing a value of "one" is labelled as "one". If I have a string value of "one, two", then I simply want the label to return "one" as well.
Hopefully that makes sense.
Check this out
var str=Find("ONE",Upper($feature.Attribute))
IIf((str>(-1)),"ONE","")