Yes I see the same thing. Obviously “rowIndex()” is using zero-based indexing when hitting the “Evaluate” button as compared to executing the node; then it changes to one-based indexing.
Looks like a bug to me. It looks as if at some point during the development of the Column Expressions node rowIndex() was changed from zero-based to one-based, but somehow this correction did not happen for the code that is behind the “Evaluate” button.
Hi @Aswin, good to know that it is not just on my machine, so i don’t have to get paranoid about error messages i got the last days
In my opinion it would be more reliable if the preview calculation would use the exact same calculation as later on.
Right now i am using a rule based rowfilter which doesn’t have a preview but is there a way to look up what values functions calculate, in Excel you can watch formulas getting calculated step by step or a debugging modus?
…is there a way to look up what values functions calculate, in Excel you can watch formulas getting calculated step by step or a debugging modus?
Are you asking this for the Rule-based Row Filter? I am afraid this is not possible without evaluating the whole node and inspecting the output. I think the Column Expressions node is a bit of an exception to the rule in having an “Evaluate on first row” feature. Other nodes that do this in some form are the Python and R nodes, but in general these nodes should only be used if there is no Knime-native way of solving the problem.
Hi @elsamuel, do you remember this post re working out a Goal Seek, and initially your workflow had a small issue that you resolved?
Well on reading this new post, your post came back to me. This now explains it.
The issue was that you initially posted the Column Expression with the following code:
if (rowIndex()== 0)
{ variable("Volume")
}
else
{column("Volume")}
Whilst I couldn’t make your workflow produce the correct result, when I looked in the Column Expression, it evaluated correctly on first row, so I couldn’t work out why your code wasn’t working, as it all appeared good!
But the subsequent fix that you then posted was this:
if (rowIndex()== 1)
{ variable("Volume")
}
else
{column("Volume")}
That had me quite puzzled at the time because your code appeared to have evaluated ok, and yet here you were now saying it needed to say “== 1” But as it was now working, I figured it was all good and moved on. I just parked it away as “one of those things” for possible future reference.
It turns out … we had stumbled on this bug in Knime, but at that point, we didn’t realise it was Knime itself that had caused this trip up.
@TotalDataLoss … Yep. I’ll finally be able to sleep easy again. You wouldn’t believe the trauma and anguish this has caused me these past couple of weeks!
But… in all seriousness, you probably have saved me time in some future problem that now won’t happen because I’ll be aware of the issue. So thank you from my future self!