Merge Columns with different values

Hi

How is it possible to merge columns together like this:
Example:

Table A:
— A1 A1 A2
B1 1 0 1
B2 0 1 0
B3 0 0 0

Result:

Table A:
— A1 A2
B1 1 1
B2 1 0
B3 0 0

how is this possible to merge the same columns?

Hi there!

By merge you mean if there is 1 in any column write 1 else write 0?
You can do it with Rule Engine node :wink:

$First_A1_Column$ = 1 => 1
$Second_A1_column$ = 1 => 1
TRUE => 0

If you encounter any problems with it feel free to ask.

Br,
Ivan

1 Like

Hi thank you for your answer.
But I want to merge columns with the same name together.

The table A is a output from One to Many Node.

Or another one I got this:

------------ A B C D E
category 1 0 0 0 0 0
category 0 0 0 1 0 0
category 0 1 0 0 0 0

I want this:

------------ A B C D E
category 1 1 0 1 0 0

Hi!

A bit confused now. You want to merge columns or rows? If you can explain it better I (or someone else) can help. Maybe to share a workflow you working on or data…

Br,
Ivan

This table represents the data and I want to merge these rows to one.

------------ A B C D E
category 1 0 0 0 0 0
category 0 0 0 1 0 0
category 0 1 0 0 0 0

The this the result that I want to solve:

------------ A B C D E
category 1 1 0 1 0 0

Thank you.

Hi,

If you want to merge columns in one, you can use “Column Aggregator” node. Select columns to aggregate and choose the method (in your case it would be “Maximum”).

If you want to merge rows in one, you can use “GroupBy” node. Select grouping column(s) or even leave it empty then select the column(s) to aggregate and choose your aggregation method (again in your case would be "Maximum).

Best,
Armin

4 Likes