I’m trying to add a new row to a dataset for a time series analysis. The problem is that in some months of the year there are no records of the variable that I want to analyze in the time series, so the dataset loses the sequence in the time.
For example here:
March does not appear because there are no records of the variable in this month.
How can I add the monthe and a 0 that represent that there are no records of the variable in this month.?
I don’t think there is a super easy way (e.g. with one or two nodes) to solve this in KNIME, but there is a small solution that should get you on the right track.
I created a similar data set, and joined it with a dataset that has all the year/months.
Example:
Data set 1:
Data set 2:
Create a key for both of them to join on (i.e. Year-Month):
Join the two tables where the second table is the top input, and the first table is the bottom input. Join on the key you created, and make sure it’s a Left-Outer Join.
From here, you can probably use the Rule Engine node to fill in what the Year and Month should be based on the key, and use the Missing Value node to fill in the Count column with a 0.
There may be a more elegant solution to this problem, but this should at least get you started in the right direction.