In this series, Liz Jensen tackles specific cases from the Alteryx Weekly Challenge initiative. She wades through the countless tools and options available in Alteryx and shares her problem-solving process along the way.
We know what dates Halloween, Christmas, and US Independence Day are on. But what about National Dogs in Politics Day or National Raisin Day?
This Alteryx Weekly Challenge starts with a list of unofficial holidays, and the goal is to put them in order from January 1 to December 31. Pretty straightforward, right?
Choosing the Best Tools for the Challenge
Those of you with eagle eyes (not me!) may have noticed some leading spaces in the Day field. However, we can see in the Input step that there are small red triangles indicating bad data. If we hover over, there will be an indicator that there are leading and trailing spaces in both fields. No eagle eyes needed here:
I added a Data Cleansing tool to remove them and then a Text to Columns tool, so I could isolate the month and day from my holidays:
Next, I added my favorite tool, which is the Select tool. I love the Select tool because it allows me not only to choose what fields I want to keep but also to rename them and change their data types. For this workflow, I added this first Select tool in order to rename some fields, as well as make my Day of Month that I split off numeric. This is important for later sorting; I want to ensure that these days are recognized as numeric, so I can start from the first of the month and go to the end of the month:
Next, I had to do the same with my months. Since they were the full month names, I used a Formula tool in order to assign each month its corresponding number:
As you’ll notice, I also made this an integer, so I could numerically sort these in the next tool:
If my months and days of months were not numeric, this sort would not be possible. I followed it up with a final Select tool to rename my fields to match the Weekly Challenge’s field names, and voila! I now can plan for National Umbrella Day!
Special thanks to Henry Arend for helping with this one! Stay on the lookout for more Alteryx Weekly Challenges to come.