Create column with count of items in a string set

I’d like to create a column that counts the number of items in a string column.

String column examples:

98, 135, 161, 101
100, 200
88

Count column should read:

4
2
1

How can you do this?

Thank you…

Hi,

Simply use a GroupBy node, just don’t select any Group column on the Groups tab and on the Manual Aggregation tab select each column, choose Count as the aggregation method and make sure Missing is not selected.

Let me know if this helps!
Medzi

3 Likes

Hi,

I guess this is what you are looking for:
count

Output:
count1

Use a “Cell Splitter” and set “,” as the delimiter and check the “List” option for Output.
Then in “Column Expressions” node use this expression which returns the length of the list column:
column("example_SplitResultList").length

Best,
Armin

solution

2 Likes

@armingrudd…thank you! Works perfectly!

1 Like

Or if you want to avoid collection column creation : length.knwf (10.0 KB)

3 Likes

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