Input:
Expected Output
@Anil_G
Hi @Garyy
Please find the attached workflow which will solve this problem statement:
ForumProcess.zip (245.9 KB)
As you can see, the input was like this, similar to the use case that you have:
The final output after processing will be:
Similar to your case, if the Value1 data is available, the common names will be updated accordingly.
Hope this helps, kindly let us know if you face any challenges in implementing the solution.
Best Regards.
Thank you for help But i want to check two column at a time if its match then i want to update Value1 column value
Try this
dt.AsEnumerable.GroupBy(function(x) x("ID").ToString + x("Name.ToString").ToString).SelectMany(function(x) System.Linq.Enumerable.Repeat(x.First, x.Count)).CopyToDataTable
for safety can add orderby as well
dt.AsEnumerable.GroupBy(function(x) x("ID").ToString + x("Name.ToString").ToString).SelectMany(function(x) System.Linq.Enumerable.Repeat(x.OrderByDescending(function(y) y("Value1").ToString).First, x.Count)).CopyToDataTable
cheers
Thanks @Anil_G for help from your query it changes next all (e.g Value2, value3) columns but i want to update only Value1 column
Hi @Garyy ,
Could you maybe Check the below Workflow :
DT_UpdateRowValues_BasedOnGroups.zip (9.5 KB)
We are First Collecting the Groupings based on ID and Name, and Storing the Combination as Dictionary, which would contain Key → (ID + Name) column, Value → (Value1) column.
Next, we are iterating over the Input DT and updating it based on whether the ID+Name combination is present in the Dictionary and using the value to update the column.
then try this in invoke code send dt as in/out and dt1 as in both can be same datatables
dt.AsEnumerable.Where(function(x) x("Value1").ToString).Tolist.ForEach(sub(r) r("Value1") = If(dt1.AsEnumerable.Where(function(x) x("ID").ToString.Equals(r("ID").ToString and x("Name").ToString.Equals(r("Name").ToString)).Count>0,dt1.AsEnumerable.Where(function(x) x("ID").ToString.Equals(r("ID").ToString and x("Name").ToString.Equals(r("Name").ToString)).OrderBy(function(y) y("Value1").ToString)(0)("Value1").ToString,""))
cheers