Expanding Values Downwards in a Table

Hello,

I’m having some problems developing a KNIME flow.

I’m trying to expand values downwards and stop until they find an already filled value.

Example:

image

The objective is to have the columns expand values to the missing values downwards and stop whenever they find a non-missing values.

The objetive is that the result would be this:

image

I’ve tried the following:

  • Extract the Row ID into its own table and removing “Row” so I could have an index column
  • Filtering out the empty rows, that way I have the starting index of a value
  • Looping with Table Row to Variable in the table where Type is not empty
  • Using a Java Snippet with the following code:

if(tblIndex>=varIndex)
{
out_values = v_Type;
}

However, at the end of this loop, only CCC is filled, and I’m at a loss, I’m pretty sure there must be a simpler solution here that I’m not aware of.

image

Does anyone have any idea on what to do?

Thanks.

Welcome to the forum, @CCosta.

I’m pretty sure there must be a simpler solution here that I’m not aware of.

It’s a common enough task that there’s a dedicated node for it, and that would be the Missing Value node.

Starting table:
image

Missing Value node configuration:

Result:
image

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.