# COUNTIF help needed

Hi -

I'm pretty new to KNIME and try to migrate from Excel to KNIME. I quite cannot understand how to perform COUNTIF in KNIME. Here is the problem:

1. I want to keep my original table

2. I want to add additional column that would do the countif

3. CountIf is basically performed against one column against all the values in that column (pretty much looking for frequency for each cell in the row, based on its value

4. Again, I want an additional column that would tell me the frequency

For example

 Value COUNTIF 1 3 7 1 1 3 6 1 1 3 5 2 2 2 2 2 5 2

So we have 3  x 1s, 1 x 7, 1 x 6, 2 x 5s and 2 x 2s..

THANKS SOOOOO MUCH!

Darko

Oh, yes... the values I am counting are not the number and constant values, I don't know the full population of values that I want to count... let me redo the sample using names (again, cannot use names are parameters, as I don't know how many names I have in the table)

 Value COUNTIF Mark 3 Sally 1 Mark 3 Theresa 1 Mark 3 John 2 Andrew 2 Andrew 2 John 2

So, 3 x Mark, 1 x Sally, 1 x Theresa, 2 x John and 2 x Andrew

THanks again

Oh, yes... the values I am counting are not the number and constant values, I don't know the full population of values that I want to count... let me redo the sample using names (again, cannot use names are parameters, as I don't know how many names I have in the table)

 Value COUNTIF Mark 3 Sally 1 Mark 3 Theresa 1 Mark 3 John 2 Andrew 2 Andrew 2 John 2

So, 3 x Mark, 1 x Sally, 1 x Theresa, 2 x John and 2 x Andrew

THanks again

Hi there…
If I understand the task correctly…
Here an approach:
Use a group by Value and set the count on the value
Then left join the count table to the original table using value as key.

Adaptagis... thanks so much... worked like a charm... in Excel it's just a magic COUNTIF(Range, Value)... however in KNIME is a too step process...

For furture references and readers, here is the steps:

1a. Use Group By - first tab Group by - use the column that contain values that you want to count

1b. Manual Agregiation - use the the column that countain values that you want to count, select "Count" as method

2. Use Joiner node to left join based on the identifier (unique values that you counted) and the count number will apprear as additional column....

Super Nice... thanks again!

Darko