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

6 - Meteoroid

Done! 🙂

8 - Asteroid

Hi MB,

The error is in the syntax of the PadLeft function. You should have accounted for the length that the String needs to be once you insert the prefix character. The below modified code should work for you. Hope this helps!

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

Spoiler
The complete formula using PadLeft (accounting for the other conditions) would look like this:
If Length([Safety Code]) = 6 then
ELSEIF Length([Safety Code]) > 8 then Left([Safety Code], 😎
ELSE [Safety Code]
ENDIF

7 - Meteor
Spoiler

5 - Atom

My Solution -

• Remove leading zeroes - just change it to numeric format
• Trim leading zeroes and/or descriptive text at the end - Use text to column to remove descriptive text and then change to numeric format
• If the data value ends with ID, remove the ID - Using if formula. If it ends with ID, remove ID
• If more than 8 chars, remove anything after 8. If only 6, add “SC” to the front. - Using if elseif formula

6 - Meteoroid

Solved

8 - Asteroid

See attached.

8 - Asteroid
Spoiler