Pivoting into multiple columns

Sean_Tully
Sean_Tully Contributor
edited August 1 in Magic ETL

My dataset has a Month column. I want to pivot the data so that the months become the columns (so a column for June 2024, a column for July 2024, etc). Using the Magic ETL pivot tile it seems I'd have to perform the pivot for each month separately. Before I go down that route, does anyone know an easier way to do this? Thanks!

Tagged:

Best Answer

  • nmizzell
    nmizzell Contributor
    Answer ✓

    Hey Sean,

    Its best practice not to pivot on the dataset itself. Typically, we want to store the data in tabular, non-pivoted format so that we can easily feed it into the visuals such as the pivot table, where we can drop the months field of the dataset into the columns field of the pivot table to achieve the desired effect.

    If you really must pivot on the dataset level, and doing so by column in magic ETL doesn't work for you, try the SQL transform capability. This method will require that you research the proper functions needed to pivot your rows into columns, but once the initial research is done and you have a working dataset, you will never have to mess with it again.

    Best,

    NM

Answers

  • nmizzell
    nmizzell Contributor
    Answer ✓

    Hey Sean,

    Its best practice not to pivot on the dataset itself. Typically, we want to store the data in tabular, non-pivoted format so that we can easily feed it into the visuals such as the pivot table, where we can drop the months field of the dataset into the columns field of the pivot table to achieve the desired effect.

    If you really must pivot on the dataset level, and doing so by column in magic ETL doesn't work for you, try the SQL transform capability. This method will require that you research the proper functions needed to pivot your rows into columns, but once the initial research is done and you have a working dataset, you will never have to mess with it again.

    Best,

    NM