alteryx Community

# Weekly Challenges

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

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

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

## Challenge #49: Reformatting Transactional Data

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.

12 - Quasar
Spoiler
6 - Meteoroid
Spoiler

My solution slightly different but gives the same results.

Alteryx Alumni (Retired)

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

Spoiler
Tara McCoy
9 - Comet
Spoiler

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

9 - Comet

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

Alteryx Alumni (Retired)

@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!

9 - Comet

@JoeM Okay, here is an alt solution.

17 - Castor

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:

17 - Castor

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