Combine duplicates into a single row based on column value

Hello,

I’d like to combine duplicates in a datatable from an excel file into a single row with a dissimilar cell combined.

From:
image

To:
image

Like this:

Processusvierge.zip (8,8 Ko)

@Anthony_Humphries

What’s your Book1.xlsx?

I’ve matched your example as given in Book1.xlsx.

@Anthony_Humphries

I applied my version of datatable and this happened:

It’s showing:

How to solve this issue?

@RailCay
have a look here as it is similar

Your version of the datatable must convert the columns to strings as my workflow shows. I ran into this same issue before I converted the datatypes.

@Anthony_Humphries

How do I convert columns of my datatable to string?

Just realized that the solution for converting columns isn’t in the XAML file I provided.

Like this:

Processusvierge.zip (2,3 Ko)

I built the datatable using Build Datatable, but the method used is in the For Each loop.

@Anthony_Humphries

How do I insert ‘Column.DataType’ to your previous xaml?

You can copy the For Each section of that file into your workflow. Just change the name of the datatable to match the one in the other XAML file.

@Anthony_Humphries

Do I have anything to change in For Each Row?

No, this For Each loop will come before the one in your screenshot. The one that changes the datatypes just iterates over the columns, rather than the rows, to update the type of each. It’s best to do this before adding data, since changing the datatype will throw an error or erase the data.

@Anthony_Humphries

DtOut or DtBook?

This should be used on DtOut.

@Anthony_Humphries

What if I want to add more columns to based on?

If you want to collapse more columns, you can make this workflow a separate sequence and have the datatable and column name passed as parameters. Then you could reuse it to collapse the data using several different columns.

@Anthony_Humphries

Are you referring only to the assign activity?

I mean that you can take what I’ve created in Main.xaml, and turn that into a reusable component for your project. You would need to create arguments to pass in a datatable and column name and replace what I’ve hard-coded for the datatable and column being collapsed.

@Anthony_Humphries

I want this datatable from:

image

To:

image

How do I do this from your xaml?