replicate Multi-Row tool from Alteryx

I have been asked in the last few weeks to help colleagues with replicating an Alteryx workflow that heavily used multi-row functionality, in particular the embedded grouping feature. I am trying to find a way to do this that is streamlined. Is there a metanode or custom component that does this that is not immediately available, OOTB?

This is a huge pain point for us and any guidance would be helpful. Been going down a rabbit hole of lags and porting the if, then-else logic into a Java snippet or Column Expressions node and Group Loops. I can eventually get something, but it is a brute force exercise.

Here is example of the Alteryx tool

Hi @aehrenworth ,

our Expression – KNIME Community Hub node supports accessing previous and next rows using the following syntax.

$[“column_name”, offset] to reference previous or next rows relative to the current one. The offset is a static number. Negative offsets point to previous rows, positive offsets to rows next the current row. Replacing a column will only take effect after evaluating the expression for the whole table. This means that the expression only uses the original data from that column.

Regarding the grouping, you could try the Group Loop Start – KNIME Community Hub and enclose the expression in the loop.

Hope this helps,
nan

2 Likes

The same question was asked in this post. See if my workflow works for you.

1 Like

Thanks that is the path I was heading down, was just making sure I wasn’t missing a more direct option.

Thanks, this seems to work. However, if my data, there are values that are generated that are “infinity” for 0 divided by 0 or 0 divided by a negative number. Is there a way to manage that?

What does “this seems to work” mean? Are you referring to my workflow or something you developed? What do you want to do with the 0 divided by?

Yes, I had something I was working on in parallel, but yours also worked.

I think I want anything that would be an error to just be 0.

Thank you for your help here.

Try this to correct div by 0 errors. Also, please mark my workflow solved so others know that it works.
Division by 0 Corection.knwf (751.3 KB)

3 Likes