Months and quarters: Jan-24 and Q3 2024 as sortable periods

Monthly and quarterly figures come labelled Jan-24, Mar-24 or Q3 2024. Sorted as text, April comes before January; converted to a date, Jan-24 becomes the 24th of January or the 1st of January 2024, which is a day, not a month.

Column type: YEAR_MONTH

In the fileCleanedStatus
Jan-242024-M01clean
Feb-242024-M02clean
Mar-242024-M03clean
Apr-242024-M04clean
May-242024-M05clean

Column type: YEAR_QUARTER

In the fileCleanedStatus
Q1 20242024-Q1clean
Q2 20242024-Q2clean
Q3 20242024-Q3clean
Q4 20242024-Q4clean
Q1 20252025-Q1clean

What happened

A month stays a month and a quarter stays a quarter: the type is YEAR_MONTH or YEAR_QUARTER, written 2024-M01 and 2024-Q3, which sort correctly as text and say exactly which period a figure covers.

Do it yourself

curl -X POST https://data-cleaner.com/clean/v1/column \
  -H 'Content-Type: application/json' \
  -d '{"values": ["Jan-24", "Feb-24", "Mar-24", "Apr-24", "May-24"]}'

The answers above are the API's own, captured when this page was built.

More guides