Hi all,
I have 6 numbers in an ID that I want to split up with a hyphon. The expression I have been using is:
LEFT([assetid],2) + "-" + RIGHT([assetid],4)
So if I have 123456
I would get 12-3456. Which is great, The only issue I am having is that if the right side of the string is less than 4 digits, it doesnt seem to include it in the output.
Any help to rectify this so that I could have 12-3456 or 12-345 or 12-34 would be greatly appreciated!
Solved! Go to Solution.
RIGHT([assetid],4)
becomes:
right([assetid],length([assetid])-2)
You are a hero sir! Thank you
Thanks! Fyi - a regex way to do the same split would be:
REGEX_Replace(tostring([Field1]),"(\d{2})(\d+)","$1-$2") (match the first 2 digits, in group 1, match the remainder digits in group 2, and then output group1 "-" group 2)
but If the everything is fairly static I'd stick with left/right stuff...