Compare 2 DTs - find unique cells in column 2 and output entire row

Hey,

Reading DT1 at start of process. Uses DT1 as worklist.
Once worklist worked completely, robot will go to website it scraped DT1 from, and scrapes it again, creates DT2 (DT gets updated hourly with new work).

What I need the robot to do:
Compare DT1 and DT2. If column (Ctwo) in DT2 contains a value that is NOT found in DT1, assign that ENTIRE ROW to either DT1 or a while new DT (whichever will work at this point lol)

I have exhausted all questions on the forum regarding this and every suggestion has failed. Please help :confounded::tired_face:

An example of what DT1 and DT2 will look like:

I dont see both data tables but have explored ‘Join’ tables and querying it if you already know the column names?

it should be pretty easy. Try and revert if you face issues - here are the steps-

  1. Read both dt
  2. Use join on a certain column (Ctwo or some primary ID column)
  3. Then write a select statement or use filter data-table activity using the columns you need under ’ keep ’ section of the activity. Store result in a new dt.
  4. Merge the data table with either dt1 or dt2
  5. Repeat every hour as much as data refresh happens.

Hope this helps :slight_smile:

@Sconnolly13
As a variation / alternate to the option from @Raghavendraprasad:

1,2 Same as above, For 2 decide what to retrieve (dt1 or dt2 row)
Then the remaining task can be realized with e.g. an EXCEPT statement as it can be understood as a set operation

Just share some excel sample data with us and we can help you faster with this

1 Like

Sample Scrape.xlsx (11.2 KB)

Uploaded a sample of the data. The two datatables will be identical in structure.

Joining does not work unfortunately.

Thank you

@Sconnolly13 Will you please attach the both xlsx files dt1 and dt2.
Then it would be helpful for solve this clearly.
Sorry about that.

Sample Scrape.xlsx (11.2 KB)

Hey, they will be identical in structure. I’ve uploaded an example of DT2, which has two unique values in columns 10 and 18 which we want to isolate.

Hey, has been this resolved? I am facing the same issue, I want to automate filtering a table ( I have done this ), then I need to automate the comparison of the filtered table with another excel file, and only copy over to the excel file the new rows from filtered table. Is there any way to do this?

@Renee_Lua May be we could use filter datatable activity here and delete the items or rows which are same like and keep the remaining.
Or
we could use for each row in datatable2 and assign the item to a keyword then inside another for each row for datatable1, it will check each object in datatable2 to each object in datatable1. then put an if condition stating that if the keyword equals to item in datatabl1 keyword then leave it, else if datatable doesn’t contains it, then extract the row and join it to your desired dt.

Give it a try and let me know if any of it works!

Happy automation!
@Chaitanya_podilapu

@Renee_Lua
Just Open a new topic for your question and Share along requirement details some Sample Data with us. So WE Work for you on an individually solution. Thanks