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

Hi again,

I’m back to explain my second version without using a loop :slight_smile:

The workflow starts with the same nodes (except the loop):

The -Rule Engine- node assigns the number of rows based on Area A or Area B and the -One Row to Many- node duplicates rows 12 or 4 times respectively. The new expenditure is calculated using the -Math Formula- node and then a consecutive row count is generated using another -Math Formula- node.

The next part of the workflow uses the following nodes:

The -Rank- node is then used to rank each row per area/project, so projects in Area A will each be assigned a rank from 1-12 and projects in Area B will each be assigned a rank from 1-4.

Afterwards, the -Row Splitter- node is used to separate rows based on Area. For those in Area A, a Date is created using the -String Manipulation- node by joining the Year, Rank and β€œ01” to create a date for the 1st of each month. After being converted from String to Date format, the month is then extracted as a name using the -Extract Date&Time Fields- node. This name can then be shortened to 3 letters using the -String Manipulation- node.

For Area B, the -String Manipulation- node is used to join β€œQ” and the rank, therefore creating the time period e.g. β€œQ1”

Area A is then concatenated with Area B and the columns are filtered and tidied up.

I used the -Timer Info- node to compare the time taken to run this solution versus my previous one, which shows that the workflow without the loop is faster.

You can find the workflow on the hub:

Hope you enjoy both solutions this week :slight_smile:
Thanks
Heather

2 Likes