Pivot/unstack/crosstab

Hi all, I’m trying to transform a table that has a list of values into rows of values. The source table has five columns. The first column is a “TestID” and for each “TestID” there are ten rows of data that are related.
The transformed data should have the “TestID” in the first column but only one value and the 10 related values in the adjacent columns. I’ve seen this operation called unstack in Excel or Pivot. I tried the pivot function in EasyMorph but each new value is on the next row. I’ve been able to recreate the function using a crosstab query in MS Access.

Result:

What I want:

Hey Rick,

In this case, you have to Unpivot once, delete a column that gets created with the unpivot, and then Pivot:

Here you can download this sample project: Vertical to horizontal.morph (4.1 KB)

When pivoting, the columns are automatically ordered by column name (from A to Z). If you want to keep the original/specific order in the columns, check out this article:

Regards,

Roberto

1 Like

Thanks for the help. I actually got what I want by deleting one of the columns (StatName) in the source before the pivot. I used the “ColumnNumber” as the column Labels to get them in the order that I wanted.

Now you can use the “Rename by lookup” action to rename the number-named columns to their original names.

1 Like