Need help Comparing two data tables

Hello fellow developers. I need some help. I have created two data tables. See print screens below. I need to compare the columns from each DT. How do I create a DT comparing the columns and showing if they are True or false

table1 table2
Agency = Agency >> if true or False
GBL = GBL
TransId = Transid
Name = Name

Table created extracting info from PDF (table1)
image

Table created from email subject line (table 2)
image

Hey gustavo,

Your tables would need a common entity. Is the TransId the primary key for each dt?

If that is true, use a for each row over the first dt and filter the second dt by the TransId. The compare the 2 rows to see if the values are equal. It could look like this…

IF CurrentRow.Item(“Agency”).tostring.equals(FilteredDt2.rows(0).item(“Agency”).tostring) Then Assign Bol_Agency = True

hello Thomas. Thanks for your response. I would have to say that Agency is the primary key, then followed by GBL, TransID, and then Name. Would you be able to provide a xaml demonstration?

Hey @gustavo_marrufo,

Are you hoping to compare each of those fields to see if they are true? If so, does it matter which one may be false? Or, if one is false, does it handle it the same as if another is false?

I am hoping for them to be true, but also need to identify those that are false. If True then they will be handle one way. false will be handle another way. I just need to compare these DT, identify which columns are true and false, and create an output DT with the results

write both the tables into an excel file and add Vlook up if you need to compare it with specific Column.

if you need to check if whole table is same or not you can do it as below

SELECT * FROM TableA
UNION
SELECT * FROM TableB
EXCEPT
SELECT * FROM TableA
INTERSECT
SELECT * FROM TableB;

if this returns anything then those are different rows you have in second table