Feature Request: Lag Column with negative interval and wrap-around

The more I work with Knime and the more I read in the forums, the more use cases I find for this node, far beyond its original purpose. It's one of the simplest ways to achieve vertical references, after all. But in several of these cases, a negative shift would be more apropriate. In some of these, it's just a matter of column names, but in others the positioning of the retained columns has to be adjusted, too. It's possible of course, but it would be easier to just allow negative intervals.

The "premium version" would be able to produce both directions at the same time, allowing the user to choose which copy to use as the base. This version wouldn't necessarily need negative intervals, of course.

Another option would be to allow the user to choose wrap-around instead of the current fill-with-missing or cut-policies. It's not entirely unrelated, as many cases of negative shifts are trivial cases of positive shifts with wrap-around (and optional cutting).

A quick glance at the code reveals that a ring buffer is used internally, so both additions sound relatively simple to me.

On an unrelated question: does the internal usage of a StreamableOperator mean that if several Column Lag nodes are concatenated, they are internally combined to use only one iteration? That would be so awesome.


1 Like

Hi Marlin, 

Thanks for the feedback, this is a very reasonable request and you aren't the first to make it. Your comments are now attached to our internal ticket. 




1 Like