Hi,
My KNIME routine does calculations on financial data. Until now, I have been doing these calculations using Java Snippets. I have to do the same calculations for each year, meaning there is a great deal of manual adjustment in changing the years in the code for each snippet, and naming the column names with the year attached appropriately. Below is a *very* simplified version of how this data looks initially.
In the end, I would have several additional columns added for each year using Snippets (columns named e.g. 2011_Upsell, 2012_Upsell, 2013_Upsell) Let's say I have twelve different annual calculations that need to be done - this implies there are 12 x 5 (2011-2015) Java Snippets that need to be made with largely similar code. And in reality, it's much more complex than this..
Customer_ID | 2011 Bookings | 2012 Bookings | 2013 Bookings | 2014 Bookings | 2015 Bookings |
---|---|---|---|---|---|
1 | 100k | 110k | 120k | 130k | 140k |
2 | 20k | 30k | 40k | 50k | 60k |
It has since come to my attention that I may be able to automate this process using the Loop nodes. The goal is that rather than creating a seperate Java Snippet for each year, I would create just one using the year as a variable - it would also need to name the column by inserting the year into the name of that column also.
Could you please help with this? (And please work with the structure given rather than suggesting an alternate way of arranging the data..)
Hami