2022: Week 44 - Creating Order IDs
Challenge by: Jenny Martin
When I started out in the data world, I had some naïve assumptions. For instance, I thought all datasets would come with a unique identifier. Unfortunately, I've since worked with many datasets where this has not been the case! Whilst it will depend on the data structure as to how you choose to work around this, for this challenge we'll we using a combination of 2 fields to create a unique identifier.
The idea for this challenge came from a member of DS35 Stephen, in his second week of training. He found a creative way to recreate the padleft function from Alteryx in Tableau Prep! Keep your eyes peeled for a full challenge created by Stephen in the near future!
Input
- Input the data
- Aside from our Order Number issue, you'll notice we have 3 fields for Order Dates. Bring these together into a single field
- We want our new Order IDs to have the following structure:
- The first 2 characters should be the Customers initials
- The last characters should be the Order Number
- If necessary, there should be 0's in between to create 8 characters for the Order ID length
- For example: AJ000746
- Output the data
Output
- 4 fields
- Order ID
- Order Number
- Customer
- Order Date
- 1000 rows (1001 including headers)