Filter Row/ Column

Hey,

I´m new in the “world” of KNIME so please be indulgent with me.

I have a table like this:

Column Header: A B C D E
1 Product 1 True Product 2
2 Product 1 Product 2 True
3 Product 1 True Product 2 True

And I want the table like this:

Column Header: A B C D E
1 Product 1 True
2 Product 2 True
3 Product 1 True Product 2 True

I tried the Rule based Row Filter and filtered the rows for the “true”, but then nothing changed because every row contains at least one “True”.

So I thinking about using different Row filters for every column and mix the tables in the end again. But is there a smarter and faster solution for this?

If you need more informations let me know.

thanks
KoSS

Hi @KoSS,

welcome to the Forum.

I hope i’m understand your data correct.
You try to remove entries where either in column C or in column E are empty (not True) and shift column D and E to column C and D if C and D are empty?
Further do you only have this 4 columns to check or does your real dataset contains a lot more columns to check?

BR

1 Like

Hi @morpheus,

yes you understood it correct. I´m try to remove the empty entries (not True) and shift the other column to the front so i have no empty entries in between.
I have in total 6 columns to check.

thanks

Hi @KoSS and welcome to the Knime Community.

Based on your sample data, I can’t even tell what makes a column.
Is “Product 1” one column, or actually 2 columns “Product” and “1”? In the event that a space is part of the data, can you instead use a delimiter other than space? In any case, it is perhaps better to use a delimiter other than space in any case, as it is hard to see the empty cells with space as delimiter.

Hi @KoSS,

hopefully this example helps you to go more inside. I’ve build it on a generic approach, which is independent of column numbers. In addition you could modify the math formula to bundle e.g. 3 columns instead of 2 columns by changing the formula from floor(($COLUMNGROUP$+1)/2) to floor(($COLUMNGROUP$+2)/3).

Example 2

Example.knwf (495.9 KB)

BR

2 Likes

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