Solutions to "Just KNIME It!" Challenge 04 - Season 2

Hi Everyone

I’ve made 2 solutions for this challenge, one with a loop and one without :slight_smile:

Firstly, the solution with the loop:

After reading the table, I have used a -Chunk Loop Start- node to loop through one row at a time. During each loop, a -Rule Engine- node is used to assign the Number of Rows as 12 or 4 depending on whether the Area is A or B. I have then used the -One Row to Many- node to duplicate the rows either 12 or 4 times. I have calculated the new expenditure using the -Math Formula- node by dividing the original expenditure by the Number of Rows.

In order to assign the month or quarter, I have created a new column called the Row Number, which assigns consecutive numbering to each row. A set of rules is then applied using the -Rule Engine- node:

image

I then finish the loop with a -Loop End- node and tidy up the columns.

Here is an image of the workflow:

You can find it on the Hub here:

My second solution to follow…

Thanks :slight_smile:
Heather

3 Likes