Sorting when pivoting


De action to pivot a dataset always sorts alphabetically. Is it possible to change this so that we keep de order in which the dataset was in de original long format ?


Yes, a separate table should be created with the correct order of columns and no data. Then the pivoted table is appended to it.

See the example below.
ordered-pivot.morph (3.1 KB)

Thanks for the reply. Could this feature be added to the pivot transformation .e.g. a checkbox that says “keep sorting order” so that we can simplify our flow?

Not at this point.


This seems to no longer be working in EasyMorph 4.4 when you have more than 9 columns to sort, because the column “10” gets sorted just after column “1”, instead of getting sorted after column “9”.

This was working for me in EasyMorph 4.3, is there a different behavior regarding this after the update?

I attach the modified project where the sorting is not done correctly in EM 4.4.

ordered-pivot v2.morph (6.0 KB)



Hi Roberto,

we’ll investigate it.

The issue has been fixed. You can download the updated version from our website: Download

1 Like

This is one reason why I always do multi-digit numbers for scenarios like this. If I know I’m going to have 100+ columns then I’ll use numbering of 001, 002, 00x…