<< Back

How to restructure data in Alteryx to get better visualizations

Nikita Parab

This week I will be showing you how to restructure your data in Alteryx to make better visualizations. Have you ever come across a data set that has so many columns it’s almost impossible to visualize? Well, worry no more! With this easy tutorial you can get a properly structured data set and with it gain meaningful insights.

Why?

Tableau works better with long and narrow data than with short and wide data. For example, the data I will be using today has months as various column headers and years as row headers. As soon as I add that data in Tableau it gives me something like this

This data format makes it difficult to compare our yearly sales on a monthly basis because each month is a different field. It would be better if all dates were in one single column with corresponding sales values. In this tutorial I will be showing you how to do just that.

Alteryx

First off, I will show how to get data into its proper format in Alteryx. To begin, we will first get our data by dragging a input tool onto the workflow. It is the second tool in the favourites palette. Drag that tool and select the file that needs to be restructured.

restructure data in Alteryx

Once you have configured the input tool, you will be able to see a quick preview of records. The next step is to actually change the structure of our data using the transpose tool. It is in the Transform Palette.

restructure data in Alteryx - transpose tool
Restructure data in Alteryx

Drag the transpose tool and configure it by selecting the key columns. Key columns are the columns you do not want to pivot. They act like a identifier on which basis the data is aggregated after being transposed. In this case, the key column would be Year as I want to transpose all the Months.

restructure data in Alteryx

After running this you will find that the data is now long and narrow as opposed to the previously short and wide data.

After adding a simple formula to merge the year and month field. I have the final result which I can save using a output tool.

You can use this data to build fun visualizations in Tableau which will also give you some new insights!

If you have any questions or feedback feel free to reach me at LinkedInTwitter.

The Information Lab Ireland is at the forefront of creating a data-driven culture in Ireland. 

As part of its vision, The Information Lab Ireland regularly hosts free events throughout the country to show how being data-driven can improve decision making and lead to a better understanding of the world around us. For more on these events please like us on Facebook, follow us on Twitter or catch up with us on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *