Hello everyone,
extarct table data repeats some data, that is, it writes some data more than once, as you can see in the picture, how do I prevent this?
Hello everyone,
extarct table data repeats some data, that is, it writes some data more than once, as you can see in the picture, how do I prevent this?
@lakshman
@lrtetala
@mkankatala
I can’t figure it out, could you help me pls
Datatablevaraible.AsEnumerable().GroupBy(Function(i) i.Field(Of String(“columnName”)).Select(Function(g) g.First).CopyToDataTable
HOPE This helps
I am new to UiPath, can you tell me how I should use this code?
Yes
You can place it in assign activity
Leftside datatablevariable=rightside place the above query
Datatablevaraible.AsEnumerable().GroupBy(Function(i) i(“columnName”)).Select(Function(g) g.First).CopyToDataTable
First try with above query if not works use below
Datatablevariable.defaultview.totable(true)
Can you use this
the second code you gave worked but I didn’t get the result I wanted. it deleted everything that was the same with each other, I don’t want this because sometimes one or two data can be the same (the numbers you see in the picture are the price list of ford cars). what I want to do is to prevent extract table data from reading the same data more than once.
thanks for your advice.
I Think before writing it to excel use the above query so that you will get the expected output
Cheers
I guess you didn’t understand what I said, let me explain with an example. extract table data writes a 2016 model vehicle with a price of 4000 dollars 3 times when it should write the vehicle once. at the same time, a 2017 model ford vehicle is also worth 4000 dollars if I use the code you gave, the price of the 2017 model vehicle will be deleted. what I want to do is to write the price of 2016 and 2017 model vehicles, although their prices are the same, and to prevent extract table data from writing the same data 3 times.
I apologize for my bad English.
Hi @emir_ozsimsir
For that you need to make your datatable should have atleast two columns of with model vehicle other column with dollar values
Yes, you are right, it can be solved in this way and I tried it, but extract table data repeats the same way when writing the models, so the models are written in the wrong lines and the prices do not match. I think I need to find a different way.
thanks for the help.
Can you share the sample data which you are getting with full columns
Can you preview the data in extract datatable and check if they are actually repeated or that is the exact data…
Ideally there wont be any repeatition
Cheers
I am trying to get the prices on the second hand car sales site, I save all prices on 14 pages to excel.
here is the website I use
https://www.sahibinden.com/ford-focus-1.6-ti-vct/otomatik?a5_min=2015
this is the excel file I saved
ford.xlsx (16.1 KB)
Hi @emir_ozsimsir
After extracting the data table use Remove Duplicate Rows activity
O/P Excel:
ford (1).xlsx (19.2 KB)
I hope you understand!!
cheers
If I use the remove duplicate activity, I will have removed all the vehicles with the same price and the same year, in short, in the photo I threw, the number of vehicles says 272 vehicles, there should be 272 vehicles in the file I saved, in the excel file you threw, all vehicles that do not repeat but have the same year and price are deleted.
https://www.sahibinden.com/ford-focus-1.6-ti-vct/otomatik?a5_min=2015
Hi @emir_ozsimsir ,
What is the Row Count received for the Datatable after using the Remove Duplicate Rows
Activity ?
Also, If there are multiple Vehicle Name searches to be performed, would suggest to add the name of the Vehicle also to the Datatable and then Perform the Remove Duplicate Rows
activity so that we can maintain the uniqueness of data as required.