Use VLookUp Method in UiPath
Shift Duplicate Row into Column
No Solution given on Youtube and other form
Please do it
Regards…
Welcome to UiPath community
Try with this LINQ expression
(From d In DtBuild.AsEnumerable
Group d By k=d("Reference").toString.Trim Into grp = Group
Let ra = New Object(){k,grp.First()(1),grp.First()(2),grp.First()(3)}
Select r = DtOutput.Rows.Add(ra)).CopyToDataTable
Regards
Gokul
In Addition to @Gokul001 steps I guess you need to modify like this
Let ra = New Object(){k,grp.First()(1),grp.First()(2),grp.First()(3),grp(1)(3)}
cheers
For such type of duplication identification we can use groupby
in addition to:
from your excel we can derive:
- grouping on Reference
- take first groupmember Ref, date Desc, Amount
- take last groupmember Amount and store it on TVS column
We do have some doubts and would recommend to recheck and redefine the Requirements (e.g. the case when more then 2 group members will occur.
In the meanwhile you can do:
dtResult = dtorig.Clone
Add TVS Column to dtResult
dtResult =
(From d In dtOrig.AsEnumerable
Group d By k=d("Reference").toString.Trim Into grp = Group
Let ra1 = grp.First().ItemArray
Let ra = ra1.Append(grp.Last()("Amount"))
Select r = dtResult.Rows.Add(ra)).CopyToDataTable
Data is correct mate
We have to do this in UiPath
dtorig.Clone is not showing in Variable type
dtorig.Clone is not a variable type…you have to sue it in assign activity…it is to clone or get the structure of dtorig to the target datatable
Hope this helps
cheers
i get that but not working
Did you use assign before it…can you attach your xaml here please…or the properties of the current activities
Cheers
Before the assign activity…try adding one more assign and use newdt = dt.clone
Cheers
same error
and using this
(From d In DtBuild.AsEnumerable
Group d By k=d(“Reference”).toString.Trim Into grp = Group
Let ra = New Object(){k,grp.First()(1),grp.First()(2),grp.First()(3)}
Select r = DtOutput.Rows.Add(ra)).CopyToDataTable
ensure that the output variable from read range (we assume DtBuild) is correct set and valid
we would also recommend to write the result to another Worksheet as long you are within the RnD / Development phase. It will give a better trace and validate option when comparing input / output
when going ahead within the modellign kindly note:
- your output description is defining the TVS column
we suggested:
done e.g. with Add Data Column Activity
in your last screenshot we dont see this step and it is also not handled within the LINQ
vs.
This is the Worksheet
and i am not getting your Point
(From d In DtBuild.AsEnumerable
Group d By k=d(“Reference”).toString.Trim Into grp = Group
Let ra1 = grp.First().ItemArray
Let ra = ra1.Append(grp.Last()(“Amount”))
Select r = dtOutput.Rows.Add(ra)).CopyToDataTable
it still getting error
as you can see there are duplicate value in the input
we have to take TVS Row as a Column and the negative values comes Under TVS Column
and in the last From 32 to 44 Rows TVS Value wll be zero
and they are different values AB123456789
AB123456788
AB123456787
like this
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.