Frequency of string entries based on another numerical column

Hi,

 

The problem is simple. There is a column years (integer) and a column clinic name (string).

Years  Clinic

2013    BAS

2013   BAS

2013   MAS

2014  MAS

2014  BAS

2015  MAS

How can I fliter by a specific year (I guess row filter node eg. Year=2013) and then, to count home many BAS and MAS I have inside 2013? ... I am struggling with the second part.. the counting of the string.

I am open for advice.

 

Hi,

You can indeed use a Row Filter node to select a year, then use the Value Counter node to count how many times each clinic appears in that year.

As an alternative, after having filtered on the year, you can use the Constant Value Column node to add a new column "count" with the value 1 on each row, then use GroupBy node to group on the clinic column and aggregate with method Sum on the count column. This will produce a count for the occurrence of each clinic in that year, just like above.

Cheers,
Marco.

Many thanks!!