Hi,
I am new to Arcade Expressions and after some assistance with a query i have below:
I have a dataset that I would like to label using the label Expression in MapViewer.
Most of my data contains an attribute starting with 'MDU ', ( including a space after the MDU) so I would like to remove this part of the record which I have managed to do with the expression below:
Right($feature.MDU_NAME, Count($feature.MDU_NAME) - 4)
So this is fine and works for all records starting with 'MDU' but removes the first 4 characters of records that do not contain MDU which is an issue, such as the record below High Speed 1.
If anyone can help me with the IF statement to only apply the expression to records that 'MDU ' is present, that would be much appreciated.
Cheers,
Steve
This will remove "MDU " from your string if it contains it. Otherwise, the original string will be returned
var label = $feature.MDU_NAME
return iif(Left(label, 4) == 'MDU ', Mid(label, 4), label);