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.?
It would be really great the help!
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.
Data set 1:
Data set 2:
Create a key for both of them to join on (i.e. Year-Month):
(do this for both tables)
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.
This is your result:
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.
@LilianaGarcia the same idea proposed by @Snowy. Check this prueba.knwf (32.0 KB)
You could try some imputation for example with the help of an R package like Amelia
I used R’s Amelia to impute a few missing values. I have attached a sample workflow. The steps basically are:
you have a flat file with a variable “Target” 0/1 and string as well as numeric variables
you decide which variables need imputation (the blue frames)
you create an artificial ID variable
you send the data you want to impute to R and Amelia and run 10 iterations
you read back the resulting CSV file into KNIME and take the mean value as the newly imputed value
you bring back together th…
you can try Pivoting/Unpivoting trick. See here:
I am looking for a solution as follows. I am extracting data into a table and group it by Code and period. That is fine and it works. But sometimes I have for some codes not the same number of rows. That is something I need. How can I loop through the table and add a row, to but values into the specific fields.
Here a short example.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.