# Count Row

Hi

I am quite new to knime, could some one help, how to count the number of occurance in the row ? and also i like to use if statements (as in excel).

E.g.,

No.  Prediction 1   Prediction 2    Prediction 3   Count_INACT      Count_ACT

1      ACT                    INACT          INACT               2                                 1

2      INACT                ACT             INACT                 2                                   1

3      INACT                 INACT          INACT                3                                    0

4       ACT                   ACT              ACT                   0                                    3

5       INACT                ACT              ACT                   1                                   2

---------------------------------------------------------------------------------------------------------

I would like to have coloum as shown in bold letters.

Nathan

I think you should be able to do this using the Maths node under Misc. In there you can use IF statements, so (IF Prediction 1="ACT", 1, 0)+(IF Prediction 2="ACT", 1, 0)+ etc..

There is also a Rule Engine node (Data Manipulation/Row/Misc) which can do IF, and other logic statements.

Hope this helps, Simon.

Hi

thanks for your reply and i have tried following excel formula and it doesnot work in math node.

This formula is used to return the more frequently availabe ''word'' in the columns (A1 to G1)

=INDEX(\$A1:\$G1,MODE(MATCH(\$A1:\$G1,\$A1:\$G1,0)))

Can we do some kind of analysis in math node ?

Best regards