Hi Guys! I have a question for you!
In this case I need the repeated values of the “Clients” column to sum the “Quantity” and “Value” values and summed up, resulting in a single client row.
Input:
Expected output:
Hi Guys! I have a question for you!
In this case I need the repeated values of the “Clients” column to sum the “Quantity” and “Value” values and summed up, resulting in a single client row.
Input:
Expected output:
Hi @Enzo nzo,
Find the below attached workflow.
Change data & column as per your sheet.
SumOnGroupBy.xlsx (9.1 KB)
SumOnGroupBy.xaml (9.8 KB)
Thanks @ermanoj3101, but how can I do to sum two columns like the input in the question?
Hi @Enzo
Please check the workflow attached
Sum Multiple Columns and Delete Repeated Clients.xaml (8.5 KB)
The LINQ used is as follows:
(From row In inputDT
Group By clnt = row("Clients")
Into grp=Group
Let quantSum = grp.Sum(Function (r) CInt(r("Quantity").ToString))
Let valSum = grp.Sum(Function (r) CInt(r("Value").ToString))
Select outDT.Rows.Add({clnt, quantSum, valSum})).CopyToDataTable
Here, inputDT is the Data Table which holds the input from the excel file. To read the input from excle file use Read Range Activity and store it in the Data Table Variable inputDT.
outDT is the output Data Table Variable which will hold the resulting Data Table.
Hi @Enzo ,
Find the update code below.
SumOnGroupBy.xlsx (9.2 KB)
SumOnGroupBy.xaml (10.2 KB)
@Enzo , is this worked ?
Yes, ermanoj3101! Thanks!!!
Hey, Ermanoj! How can I do to add a new column in this rows like this?
To obtain this
Thanks Ermanoj
You have to add one condition only, anyways let’s check the files
SumOnGroupBy.xaml (10.3 KB)
SumOnGroupBy.xlsx (9.3 KB)
@ermanoj3101 Thanks man! You’re the best!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.