How to derive a new column depending on how many out of three columns it fulfills


The products are able to be categorised into a maximum of 1 category and 2 sub categories. The numbers under each column represent which category they are in. What I’m trying to do is create a new Integer column that shows an integer for each product depending on how many product categories they are in. For eample, 001 will have an integer of 3, 002 will have an integer of 1. How do I go on about doing this?

Hi @mddaysh

Welcome to the KNIME community!

You can use the Column Aggregator node for this. Steps:

  • Add the node in your workflow and enforce the exclusion of the Product ID so that you are only considering the Product Cat x

  • Go to Options, add a Count aggregation and make sure that the Missing field is unchecked.

This will result in the desired count:


Hope this helps.


thank you so much, it works! for those products with all missing values in all categories, I need to display a 0 in the Count column, how do i do that?

Nothing different :slight_smile: Is done automatically.


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