Hello,
i have data like below
my expected output is like below

how can i achieve this ?
help me on same
Hello,
i have data like below
my expected output is like below

how can i achieve this ?
help me on same
Use the “Group By” LINQ expression
dtOutput = (From row In dtInput.AsEnumerable()
Group row By ProjectKey = row("Project Key") Into Group
Select dtInput.Clone().Rows.Add(ProjectKey, Group.Sum(Function(r) Convert.ToInt32(r("Hour Total"))))).CopyToDataTable()
Try using DefaultView in assign activity like this
dtUnique = yourDataTable.DefaultView.ToTable(True)
Hi @Mathkar_kunal ,
Try this:
dt.DefaultView.ToTable(True) - removes duplicate rows by comparing all columns in the DataTable.
dt.DefaultView.ToTable(True, “Project Key”, “Hour Total”) → removes duplicates only based on the specified columns (Project Key, Hour Total) and returns a table with just those columns.
dt - your datatable name
Datatable.DefaultView.ToTable(True) is the fucntion you can use
it is not removing duplicates
check below ss
i am reading range from sS1:T2000 and saving i variable DT5
and using same in function and writing table again from J1
but you can see it is showing me full column data
my expected output is
write dtunique not dt5
You are writing the original datatable to excel file. Code will not update the original datatable but will return the unique data into dtUnique datatable.
Write dtUnique datatable with Write Range.
Hello @Mathkar_kunal
Use below solution
step 1 : read input excel sheet as per your data (define output variable “DT”)
step 2 : assign key = DT and Value = DT.DefaultView.ToTable(True)
step 3 : Write new update DT data in another excel sheet, check your output
You can consider below approach:
read range activity to read data from excel and save it in a datatable
remove duplicate rows activity to remove the duplicates from the datatable
write range activity to write the datatable retrieve in step 2 to excel
Hope this helps.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.