How do I sort months with financial years in KNIME

Hi Knime experts
I am using knime and not getting which node I need to use…

Requirement:
I want to the date sorted by month and still need keep financial year .

Document Date:
Fiscal Year Mth Name
FY2022AUG
FY2022AUG
FY2022AUG
FY2022AUG
FY2022FEB
FY2022JAN
FY2022JAN
FY2022JAN
FY2022JAN
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022JUL
FY2022NOV
FY2022OCT
FY2023OCT
FY2023OCT
FY2025JUL

Thanks in advance.

Hi @Chenfang and welcome to the Knime Community.

The only way to be able to sort by month is to convert the month to its numeric representation. I’m guessing that you would also want to sort by the year too?

So, something like this would do:
image

Input data (same as yours):

I transform them into dates:

I can then sort on the dates, which will also sort the original column:

You can remove the date column using the Column Filter node if you won’t want this column there.

Here’s the workflow:
Sort months with financial years.knwf (10.2 KB)

EDIT: And just in case that you really meant to sort by month only (that is not sorting by year first), I added these 2 nodes to the workflow:
image

And that’s how the data sorted by month would look like:

Here’s the updated workflow with the other sort option: Sort months with financial years.knwf (13.7 KB)

6 Likes

Hi
Thnk you very much for your workflow, it could wok .

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.