Return data excel / dictionary

Hello, colleagues .
I am trying to obtain a certain result by extracting data from a table but I cannot solve it.
I’m creating a dictionary for it and I can’t get to the result I’m showing you; starting from the original table, I would like, in case of a row is repeated, the final table would show the lowest data if it exists and if it does not exist (indicates Doesn’t apply), replace it with the lowest value in the column.

Example:

image

Thanks in advance

@mbercianop

First get the lowest value of each column usinng the below expression

Lowestvalue = dt.AsEnumerable.Where(function(x) Not x.ToLower.Contains("does")).OrderBy(function(x) Cdate(x)).First()("Lap Time").ToString

Now use below to get the lowest rows into one group

Finaldt = Dt.AsEnumerable.GroupBy(function(x) x(0).ToString).Select(function(y) y.Where(function(x) Not x.ToLower.Contains("does")).OrderBy(function(x) Cdate(x)).First()).CopyToDataTable

Now use the below to replace does n’t apply with lowestvalues found in invoke code and send finaldt as in/out argumnet

Finaldt.AsEnumerable.Where(function(x) Not x.ToLower.Contains("does")).ToList.ForEach(sub(x) x("Lap Time") = LowestValueOfLapTime)

First and last one needs to be repeated for each column …

Hope this helps

Cheers

Thanks a lot, Anil.

I’m going to try it!

1 Like

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