Sort dates by week

Hey,
So I’m having another issue with Knime,
I’d like to sort dates as it’s in first week, second week, third week or fourth week of the month
I thought about a vlookup and an If function with a table having something like that:

First day Last day Week
1/1/2019 1/8/2019 W1
1/8/2019 1/15/2019 W2
1/15/2019 1/22/2019 W3
1/22/2019 1/29/2019 W4

if the date is between first day and last day , the column of week is affected to it.
How can I make it work?
Thank you

You will need Rule Engine (Dictionary) node.


to assign a week then sort.

Have you thought about extracting the week of year from the date?

kn_example_weeks_in_year.knwf (21.8 KB)

2 Likes