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 FeedbackI have tried multiple solutions for each of the problems.
Easy
Hey Tony,
I'm relatively new to Alteryx and am working my way through these. I wonder if you might help me on an alternative solution.
I missed your super-simple: "SC"+[Safety Code], probably because I over-thought it.
I had originally tried, unsuccessfully, to use PadLeft, using variants of:
IF Length([Safety Code]) == 6
THEN PadLeft([Safety Code], 1, 'C')
ELSE [Safety Code]
ENDIF
Then repeated for "S"
Any idea why using PadLeft didn't work?
Cheers,
MB
My updated solution with additional different methods of solving the challenge.
Hi MB,
Pad Left and Pad Right functions are used for adding fillers rather than prefix strings. For example, if you have 1234, 123 and 12 under Field1 where field length has been specified to be 4 characters long. You can use PadLeft([Field1], 4, "0"). This would result in the output 1234, 0123 and 0012. Similarly PadRight would result in 1234, 1230, 1200. Hope this helps! Once you get comfortable with Regex Tools and RegexReplace Function, you can use it prefix any string too. I have just posted my solutions using multiple modes of Regex and different Formula Tools. Hope this helps!