Pivoting (and un-pivoting) your data
In Applying data transformations to more than one field at a time (the third recipe in Chapter 3), we worked with a file that had all the monthly sales data in columns, and we performed a series of transformations to all of the columns simultaneously with the Multi-Field Formula tool.
Now, we will apply different kinds of transformations to a very similar file, to see what is possible. We’ll transpose columns to rows and back (Cross Tab) so that we can shape our data to perform complex calculations in a very simple way.
Also, this kind of pivoting is beneficial when working with BI/visualization products because we need to reshape the data from columns to rows (pivoting), so this recipe will apply to those cases too.
Getting ready
We prepared another test set for this recipe that you can download from here: https://github.com/PacktPublishing/Alteryx-Designer-Cookbook/tree/main/ch4/Recipe1.
The sample set contains CASH SALES...