DataTable Normalization

In my scenario, i need to add all Different ID’s together (Normalization) in the datatable
ID Amount
A 20
A 260
B 300
B 100
B 600
C 100
D 60
D 05

Expected output DT
A 280
B 1000
C 100
D 65

@saikrishna1,

Can you please tell more details. what you want to do there ?

Hi @saikrishna1

Use this workflow this might helpweb.xaml (17.1 KB)

@saikrishna1

Let us assume to create datatable using build datatable activity and adding the values which you have mentioned

Then try this code

dtTest2 = (From p In dtTest1.Select
Group p By ID=Convert.ToString(p("Id")) Into GroupA= Group
Select dtTest1.Clone.Rows.Add(GroupA(0)("Id").ToString,GroupA.Sum(Function(r) r.Field(Of Int32)("Name")))).ToArray.CopyToDataTable

Using output datatable and print the value from datatable.(dttest2)

Thanks,

Pradeep Sridharan

2 Likes

Thanks for the solution, its working

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