Filter datatable based on criterias only based on Branch

Hi,
I have a datatable, and I have to filter it based on some criteria.
(It contains repeated values just get them once)
The Criteria is it must be divided only for plants and distribute the data in different datatables
I have attached the Input Sheet for the same.

According to the input we will get different datatables as output.
I have attached the output sheet for the same.

Please let me know how to solve the issue?
(Mainly how to get the non repeated values for the 1st column)
Thanks in advance!!

Assign Activity:
TableList | DataType: List(Of DataTable) =

(From d in YourInputDT.AsEnumerable
Group d by k= d("Branch").toString.Trim into grp=Group
Select g = grp.CopyToDataTable).toList()

Then loop over TableList and write out each Branch table to Excel

[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

Hi @ppr
How to get it in the form of different datatables and also will this code five the output same as I have provided the Output sheet containing 8 different sheets?
Thanks in advance!!

we mentioned the tablelist / here each group is split and a datatable

when 8 different Branches are within the Input then 8 different Tables are within the output

Also we can adapt and add some more filter and split logic.

However we recommend,

  • that you will start actively with modelling the first prototype
    And/Or
  • used the attached ressources when more training starter help is wished

Hi @ppr
I am a bit confused with the approach.
Because I have tried and ran the solution but it is not giving the desired output
It is just writing for Branch 1507 and Cost 10 and 7
image
And also repeated values are also there.
Thanks!!

sharp the requirements and we will finalize with you

Hi @ppr
We have the data mixed in the input sheet
But we need to divide the data based on Branch and all the value has to be written just once no repetition
I have provided the output sheet in which format the output is required.
OutputSheet.xlsx (14.6 KB)
The output has to be in the above provided format.
Thanks!!

Maybe you are looking for a more fine granular grouping where the groups as rated on Branch and Costs

thats why we also recommended:

so have a look on more grouping basics: Link above

And:

TableList | DataType: List(Of DataTable) =

(From d in YourInputDT.AsEnumerable
Group d by k1= d("Branch").toString.Trim, k2= d("Cost").toString.Trim into grp=Group
Select g = grp.CopyToDataTable).toList()

FYI (with an additional ordering)
grafik

(From d In dtData.AsEnumerable
Group d By k1= d("Branch").toString.Trim, k2= d("Cost").toString.Trim Into grp=Group
Order By CInt(k1), CInt(k2)
Select g = grp.CopyToDataTable).toList()


etc:

looks like your sample output has also shortened the input data groups