Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEARegEx tool is so useful. Now I like Alteryx more than Python because of annotation for RegEx patterns.
1) We can use either "select" tool by converting string to numeric value
or we can use formulas TRIMLEFT([Field1],"0") which will remove all zeros from the beginning
2) Same here we can use select of formula tool. but the easy way is to go with select tool and convert string to double or float which I did here
3) Using formula tool will be ideal in this case.
if Right([ID], 2) = "ID" then left([ID],Length([ID])-Length(Right([ID], 2)))
else [ID]
endif
4) same here use formula tool
if Length([Safety Code]) > 8
then Left([Safety Code], 8)
elseif Length([Safety Code]) < 8
then "SC" + [Safety Code]
else [Safety Code]
endif
Here's my solution.
Thank you for another great opportunity!