Hi Everyone
I’ve made 2 solutions for this challenge, one with a loop and one without
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:
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
Heather