Best Node to Measure Year-Over-Year Monthly Changes for Many Years

I need to measure/calculate year-over-year percentage changes for multiple years by month. For example, January 2010 compared to January 2009, then January 2011 to January 2010, January 2012 to January 2011, etc. Then February 2010 to February 2009, etc., until I filter through all years and months. (Sample data attached)

I can certainly set up the Groupby Node by Year & Month and calculate the Mean Close Price, then set up the math node to complete the percentage change formula, but is there already a node that will run an operation of automatically completing these steps and comparing monthly data year-over-year?

There are so many knime nodes now days that I’m thinking something like this already exists? I just don’t know which key words to search and find it by. Thanks!

sample-data.xlsx (14.8 KB)

Hi @smithcreed , since your data is stored vertically (that is each year+month is on a row instead of column), you can easily do this using the Lag Column node:

You just need to lag 12 rows and each row will have both the year+month and the month of the previous year. Then use the Math node to do the calculation for each row.

1 Like

This kind of thing lends more towards a component than a node because of the wide array of input structures and output requirements. If you find yourself dealing with similar situations a lot, then I would recommend creating a user friendly component that meets your needs to save time.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.