We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.
alteryx Community

# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
###### IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

## Challenge #35: Data Cleansing Practice

8 - Asteroid

Tricky formulas but learned a new one today.

8 - Asteroid

Great practice and prep.

8 - Asteroid

I have tried multiple solutions for each of the problems.

Spoiler
I have used Formula Tool to arrive at the solution. I have also alternatively used Regex - Replace, Regex - Tokenize and Regex - Parse to arrive at the solution. This was a fun learning experience and introduction to various Regex options available.

8 - Asteroid

Easy

Spoiler
8 - Asteroid

Here's my solution!

Spoiler
Solution

11 - Bolide
Spoiler
6 - Meteoroid

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.

IF Length([Safety Code]) == 6
ELSE [Safety Code]
ENDIF

Then repeated for "S"

Any idea why using PadLeft didn't work?

Cheers,

MB

8 - Asteroid
Spoiler

8 - Asteroid

My updated solution with additional different methods of solving the challenge.

Spoiler
I have now used various Regex Tool Modes (Replace, Parse, Tokenize) as well as Formulas (RegexReplace and ToNumber) to arrive at the solution. Great workout for the brain.

8 - Asteroid

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!