creating lag time series columns

I'd like to create time series delay taps and features based on this idea. 

For example, I have Customer ID, date of visit.

I'd like to compute: days since last visit, # visits in past 7 days, etc.

With other tools, I can sort the data by Customer ID and Date. Then I'd use a function that can select a value in a column from the last record, or sum values in the last X records.

I don't see anything in KNIME for this, though I presume I can do it using Javascript. What would you recommend?


Well you have the Time Series of nodes which should help.

Use the "String to Time/Date" node to put the date in a useable format.

You can then use the "Time Difference" node to work out the difference in days between the current date and the last date of visit, and then filter on this for the 7 days to find out who has visited within 7 days etc

In terms of looking at values in previous records (ie. previous rows), the best way to do this is using the Delegating Loop Start and End nodes, but its not overly simple to do this part. There are more details in other posts on using these Delegating nodes.