RowIndex calculated wrongly?

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.

Now it all starts to make sense! :slight_smile:

2 Likes