Group by variable and finding total numbers

Hi, I am beginner with KNIME,

I am trying to group data for column1 with other column values and need to arrive at number of grouped values. For example

Hotels C1 and Cancellation C2
Citadel, 0
Sherton, 1
Citadel, 1
Sherton, 0
Citadel, 0
Sherton, 0

Group by should result in
Citadel, 0, 2No
Sherton, 0, 2 No
Citadel, 1, 1No
Sheton, 1, 1No

How to achieve this in KNIME

Thanks
ChandraNR

Hi @chandra_nr77

Welcome to KNIME Forum.

One way to do this is to add a column with constant value → 1.
So GroupBy on Hotel and Cancellation and do a sum of the created value (with the constant value column.


See:
Group by variable and finding total numbers.knwf (15.8 KB)

gr. Hans

@chandra_nr77 Welcome to the Forum. Some sample data would be helpful, but it looks like you can use the Groupby node. Group by both columns and aggregate by count.

Thank you
Using group by and constant column able to achieve results

1 Like

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