About EasyMorph Tutorials & Examples Web-help

Excel: Import Date Headings as number

Hi

Is there a quick fix on import for headings:

If I unpivot, text to number, and pivot back, the headings is still in numbers
If I unpivot, text to number, everything to text (dd MMM yyyy) I get date headings correct, but they appear in the wrong order 1 Nov 2020, 6 Dec 2020, 8 Nov 2020…

There is probably an easy solution.

Can anyone help me with that?

Thanks

The simplest solution would be to use another date format, the ISO format: yyyy-MM-dd (e.g. 2020-11-01). Dates in the ISO format are naturally sortable.

If the date format in your screenshot must be preserved, then the solution would be to insert a 1st row with correctly formatted dates, and then use the “Label columns” action to label columns after the values in the 1st row.

The trick here is to ensure that the order of columns doesn’t change. For this, we will use the feature of the “Append table” action that preserves the order of column of the main table to which the other dataset is appended.

See example below.
date-labels.morph (3.9 KB)

1 Like

Thank you Dmitry.

Great solution.

I have never used Column Metadata in this way and never used make time /date colums.

Regards

R

You’re welcome!

To learn more about EasyMorph visit easymorph.com.