I have a data model with orders and refunds in separate tables. I would like to use MAQL to create a metric showing the sum of all the order totals, less the sum of all the refund totals for a particular date and/or date range.
The problem is that the two tables are using different dates. The orders table has “date the order was created” and the refunds table has “date the refund was created”. This is fairly simple in pure SQL using 2 sub-queried, Is there a way of making this work in an MAQL query?
Edit: I should also mention that the order refunds table is linked to the orders table via the order id which complicates things further.
Best answer by Joseph HeunView original