Weekly Challenge

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

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

Submit Feedback
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.

Challenge #49: Reformatting Transactional Data

Highlighted
Alteryx Alumni (Retired)

The link to last week’s challenge is HERE.

 

This week’s exercise is another example of how Alteryx can take poorly formatted data such as transactional log files and turn it into usable data.

 

Use Case:  A customer has some data that comes with key product information stored at the top of the file.  Each data column contains three lines of header information per product (product, market and type).  The customer wants this information to be shown in rows for each product.

 

Objective:  Reformat the input data to match the output example.

 
Highlighted
12 - Quasar
Spoiler
Weekly 50.png
Highlighted
Alteryx Partner
Spoiler
Exercise 50.PNG

My solution slightly different but gives the same results. 

 

Highlighted
Alteryx
Alteryx

A solution has been posted (it looks just like yours @Joe_Mako). Thanks for sharing yours too, @MichelKars.

Spoiler
2016-11-21 08_44_49-Alteryx Designer x64 BETA - DataPrep_ReformattingData_Solution.yxmd.png
Tara McCoy
Highlighted
Alteryx Partner
Spoiler
Weekly Challenge 49 Alt Submission.png

 ...and here's another alternative with a hard-coded shortcut.  Only works insofar as 1-to-1 relationship between Product, Market and Type remains valid.

 

 

Highlighted
Alteryx Partner

Michael, I like the simplicity of your solution.  Any chance I could see the .yxmd?  I'm at dupton@decisionlab.net.  My solution (just posted) also works, but uses hard-coding based on observed values...

Highlighted
Alteryx Community Team
Alteryx Community Team

@DanielUpton, with our latest release of Community, you can now upload solutions right into the thread and no longer have to share just via spoilers! 

Highlighted
Alteryx Partner

@JoeM Okay, here is an alt solution.

 

 

Highlighted
Alteryx Certified Partner

I think my solution is the same as some others.

Spoiler
I separated the input into two streams by using the sample tool to select the first three rows, and skip the first three rows respectively.
I then used the Transpose and Crosstab tools to pivot the data into the correct format, using the first three rows as a reference file. This was then linked back on the header type:


Solution.PNG




 

 

Highlighted
16 - Nebula
16 - Nebula

very similar to all the others.    Seems that this may be the natural choice (given that so many folk arrived at this independantly)