Hi guys, I need a little help on a loop with a rule engine node.
Actually I have this tab
ID
202101
202102
202101 (1)
202102 (1)
202101 (2)
202102 (2)
1
1
3
3
2
3
6
3
2
4
4
1
1
1
5
4
4
1
6
7
6
And i need something like this
ID
Jan
Feb
Tot
1
1
3
4
2
3
6
9
3
4
2
6
4
1
1
2
5
4
1
5
6
6
7
13
Each month the loop will need to add the additional month (202103 and so on.).
Actually I have different rule engine nodes, one for each month but it is becoming time consuming,
if I got it right you can use Column Aggregator node with wildcard selection (202101* for January, 202102* for February…) to define column you want to aggregate. From your example seems First as aggregation method with missing values excluded will do the trick. In case you have only two months I would avoid loop and simply use two Column Aggregator nodes while in case there are more months looping can be done. Do you know how many months you have? Maybe fixed number of months?
I have put together the following attached flow, but it uses neither the loops nor Rule Engine. It should perform the functions you require though, and it should not require any editing for each month provided that you continue to include new columns in the input table in the same form that you are currently doing.
The top of this flow contains your original flow for the purposes of comparing (testing) the new flow.
The section in the box to the right is only used for testing.
Help table with new column names and wildcard patterns which are then used to parameterize Column Aggregator node inside variable loop. For new month simply add another row to Table Creator node. This could be automated as well if needed…