Merge columns differents values with same Row ID

Hello I am trying to make the columns Dif. Child 1 and Dif. Child 2 to stay in one column, associating the age of child 2 to the row “{PFN.1} [V33] Name: Full name child 2: .” and the age of child 1 in the row “{PFN.1} [V32] Name: Full name child 1: .”. Taking into account that each child has a different age

Pruebas.knwf (8.5 KB)

Hi @slunah,

Could you please provide an example of your input dataset and your desired output?

Hi, this is what I have:

And this what I expect as a result

I attach the excel file if you need

Results.xlsx (307.5 KB)

I hope to be able to make a kind of age mixing by associating the age of the column “Dif.Child 2” to the row with code {PFN.1} [V33] and the column “Dif. Child 1” to the row with code {PFN.1} [V32]. So that I have only 1 column of ages left.

1 Like

Thank you for providing the sample file.

There are several ways to achieve your desired output but I suggest using the Column Expressions node to do all steps at once. You need to select a value from 2 options for date and age based on a condition. So, I would go with something like this:

if (regexMatcher(column("ColumnNames"), ".+\\[V32\\].+")) column("Fecha Nac. Niño 1")
else column("Fecha Nac. Niño 2")

This is for date values and you can apply the same method on age.

Here is an example workflow using your sample data:

3 Likes

Hello, thank you very much for the solution, it worked perfectly.

1 Like

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