Assign working days to month during change of month

Hey everyone,

I have an issue when the change of month happens during a week (so eg. 30.11. → 01.12.).
Therefore, I need to find a way to get the share of the working days belonging to which month in these weeks. Like in the example date, 3/5 (0.6) belong to November and 2/5 (0.4) belong to December. And I need to get this share for every upcoming month.

Any suggestions on how to do that as I’m pretty new to Knime? Thanks in advance!

Hello @ricobitsch and welcome to the KNIME community

You may find useful ‘Extract Date&Time Fields’ node. You can extract date descriptive fields in columns from input date. For example you can extract Month in number or name format + week of the year.

After that you may need to assign the reporting month based in a logical criteria; like this week owns to the month that ‘last working day (friday)’ belongs.

Based on previous example, you can create a full year range in a separated table with ‘Create Date&Time Range’ node; then filtering Friday days and extracting month and week number, you can JOIN resulting reporting month to your data, based in week number JOIN criteria…


Aiming to extend this solution to upcoming years, you will need to extract ‘Year’ field together for input data and reporting table (extended range) as well. The final JOIN criteria will be double: Week Number + Year

I hope this helps

Thank you I get what you’re saying, but how do I get a share like mentioned in the beginning out of this?

Hello @ricobitsch
I’ve prepared a workflow deploying the previous idea:

20221208_reporting_month_by_closing_week_v1.knwf (38.2 KB)

Let us know if further explanation is needed.

Regarding the links, you can drag them from the browser into your KNIME desktop. Besides, they are KNIME base nodes, so you can search by typing in the Node Repository. Building in KNIME to avoid spreadsheet work is really satisfactory, but I recommend you to complete some of the beginners training resources available.


Oh thank you very much, that really helps.

I know how to insert the links into my KNIME. What I meant by “share” is what I wrote in the beginning of the thread. I need to find a way to give an output of what share of days belong to which month in that specific week with the changing month. Like in the example date, 3/5 (0.6) belong to November and 2/5 (0.4) belong to December. I would really appreciate approaches to do that.

Is this ‘3/5 (0.6)’ a String? Could you explain further?

I interpreted 3 (wed.) / 5 working days…

You caan extract Day of Week with number format as well. The 0.6 is a Math Formula node. Combining together is a String Manipulation node. But I am just guessing right now.

I see now. Then you can calculate with Group by percentage (Month), stepping on week number.

I am not connected now. Maybe in the evening I can deliver an upgraded workflow.


Hello @ricobitsch
Please check this view of the challenge. Despite you didn’t clarify your use case or expected output. I’ve anticipated a possible outcome.
Whatever is related to your shared month proportions in a week, based in number of days; you can find the mechanics in this workflow. As you see it is all about groupings, joiners…

20221208_share_weekly_totals_by_month_v01.knwf (76.0 KB)

If it’s not clear, you could describe an expected formatted output.


thank you very much! that really helped me! appreciate your help :slight_smile:

1 Like

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