Validate detail and aggregate total across tables


I’m looking to see if Great Expectations can help with validating some rules before importing data to our product’s relational database.

One check that comes up a lot is ensuring that the totals of item details in a detail table match the aggregate total in the linked entity table.

Take Invoices and InvoiceItems for example. We’d want to ensure that the total of all Invoice items with InvoiceID = 1 matches the Total column on the Invoice with InvoiceID = 1.

Is there are suggested technique for doing this sort of check with a SQL data source?

Many thanks