Column filter based on condition or value in other column

Hi, I am very new to knime

I want to filter column having name dec if month column have 12, if have 11 want to filter column having name Nov, if have 10 want to filter column have Oct & so on.

Please help

Hi @faizanmariner , and welcome to the KNIME community!

As the data in KNIME is based on tables, it isn’t possible for different rows to have different columns, which is how I read your message. What you can do is to derive the required column names that contain the data you require for the particular months, and then create new columns containing the data from the different columns for that month.

Once you have that, you can then filter the columns so that you just have the month number and the values for that month.

I don’t know if that answers your question, or whether you were looking for some other solution.

The attached workflow is an example of the above. It uses String manipulation to derive the required source column names based on the month number. It then uses a Column Expressions node to collect the data from the specified columns and create two new columns that can be filtered.

Knime Dynamic Column selection - demo.knwf (59.2 KB)

I used sample data from a spreadsheet contained in the workflow’s data folder. You can access this folder quickly by resetting and then executing the “Open File or Folder” component I’ve placed in the workflow. This component is not actually required for the workflow to run.

3 Likes

thank you so much

ur reply was very fast & my thanks reply to you got delayed sorry for that

ur ans helped me a lot and I understand & was able to complete the flow

i checked ur flow, string manipulation & column expression, this logic part still difficult for me to understand as i just started, hope soon i will understand

once again thank you.

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