This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!
Submit FeedbackRegEx 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!