Remove duplicates in first database column

I have a data table. I need to highlight the first column and remove duplicates there. Please tell me how can this be done?
I tried to use the command assign but it gives me an error


image

looks like i.Field is failing for non parseable value(s). this can be an empty value or any other non double default format.

Analyse the values within the datatable and check for strategies like:

  • filtering out blanks
  • using alternate parsing methods

Fell free to share with us the screenshot from immediate panel when inspecting the datatable

Thank you, but there is no space in my table. How can this expression be corrected so that there is no error?

Datatable inspection in immediate panel only is reliable. Can you share with us the analyis result?

What we also can do within the immediate panel is executing a LINQ running for non parseable doubles like:

dt_file1.AsEnumerable.where(Function (x) Not Double.TryParse(x("Service Agent").ToString, nothing)).ToList

I agree with you that the problem is in the data, I tried to run the code on another table and everything worked. I analyzed the table, I have blank lines in other columns, as well as lines containing “.”, “,”, but they are in different columns. There are no blank values in the first column. Still not sure what needs to be fixed?

do not focus only on blanks as also others can block the conversion

we shared with you:

what is the result of this statement execution?


gives an error message

Hi!

Try like this:

Method1:

  1. In Build Data Table you can check the unique for that particular column. This will not allow you to enter the duplicate rows.

Method2:

  1. You can do like this
Dt.DefaultView.ToTable(True,ColumnName1,ColumnName2)

Regards,
NaNi

was not executed within immediate panel as told:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

You can rewrite the statement by conversion to string, but we would not recommend when it is not tested on side effects

dt_file.AsEnumerable().GroupBy(Function (x) x("Service Agent").toString.Trim().toUpper).Select(Function (g) g.First()).CopyToDataTable

it is works, thank you very much!!!You helped me a lot!

thank you, it is works!

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