Ungroup/Expand rows into the number of rows specified by column

I need help to see how I can ungroup/expand rows into the number of rows specified by a column value

for example:

I am here:

Start Date End Date Days Number of Months Number of Months +1
3/1/2026 5/31/2026 92 2 3
6/1/2025 6/30/2025 30 0 1
8/1/2025 9/30/2025 61 1 2

I need help accomplishing the following 2 steps:

STEP 1:

Ungroup/Expand into the number of rows specified by “Number of Months +1” EX:

Start Date End Date Days Number of Months Number of Months +1 Month List
3/1/2026 5/31/2026 92 2 3 1
3/1/2026 5/31/2026 92 2 3 2
3/1/2026 5/31/2026 92 2 3 3
6/1/2025 6/30/2025 30 0 1 1
8/1/2025 9/30/2025 61 1 2 1
8/1/2025 9/30/2025 61 1 2 2

STEP 2:

Assign End of Month value for each row starting with end date and working backwards (EOM(service end date -“Number of Months +1” +" Month list"))

Start Date End Date Days Number of Months Number of Months +1 Month List EOM
3/1/2026 5/31/2026 92 2 3 1 3/31/2025
3/1/2026 5/31/2026 92 2 3 2 4/30/2026
3/1/2026 5/31/2026 92 2 3 3 5/31/2026
6/1/2025 6/30/2025 30 0 1 1 6/30/2025
8/1/2025 9/30/2025 61 1 2 1 8/31/2025
8/1/2025 9/30/2025 61 1 2 2 9/30/2025

Hey there and welcome to the forum.

Thanks a lot for making it easy to help by providing data and concrete examples :-).

You can use:

  • One Row To Many to duplicate rows as per your Month + 1 column
  • The new row key holds a numeric suffix starting with 1 to distinguish each of the duplicated rows. You can extract that so you know by how many month you need to shift your Start Date forward
  • use either Column Expressions (legacy) if you are on a version before 5.5 or
  • use Expression nodes to manipulate the date by first shifting start date forward by the number of months extracted from the row key and then shifting that result backward by one day

Overview:

Workflow:

explodeDataSet.knwf (61.2 KB)

4 Likes

Hi @courtneyhoffman

A slightly different approach than @MartinDDDD offered. See ungroup-expand.knwf (80.6 KB).

It uses a loop, oke I know, but has less complex expressions :slight_smile:

Happy KIMEing.

gr. Hans

4 Likes

As always there are many ways to achieve the result.

Here’s my approach without expressions or loops:

The “Date Rounder” node does the trick regarding EOM.

4 Likes

Thank you everyone for the help, it’s appreciated. I’ve attempted several of the options and can make them all work.

1 Like