Filtering data table without loop


I have two datatable. One is the history data table and the other is a datatable that the robot create run-time.
I need to check if in the data table that the robot create runtime there is a match in with the history file and delete all the matches row in the data table that the robot create runtime.

I’ve already tried using For Each and a filter data table but I no want to iterate the History data table for speed reasons.

This is the historical file

This is the run-time file

I need something that don’t iterate the historical file but give me as a result all the rows that are not matched in the history file


In StudioX, I would try something like this:

For each row in the Robot File
Filter the rows in the History file by IdDoc or Business Partner (not clear which one you need)
If after filtering the row count is 0, write True in a new column in the RobotFile called HasHistoryMatch

After all rows in RobotFile have been processed
Filter the RobotFile by HasHistoryMatch = False
Delete all the resulting rows using DeleteRows - only visible

This uses Excel filtering, which should be faster than iterating throw all the rows. Here are some screenshots for reference: