We’ve been thinking what to suggest.
One possibility is to actually hold this data in a single table, with columns (date, type, amount, invoice, receiver, comment, hours), where
type is “income” or “payout”, and where some fields are used for
type=="income", and others for
type=="payout". Then you could summarize easily by date, or by combination of date and type.
If the data is in separate tables, combining records from them is somewhat tricky. Grist doesn’t yet offer a convenient tool for it, but there are some approaches. Let me clarify first what you are looking for: a table with one row per date, containing a sum of income, sum of payouts, and sum of both? Or a table with one row for each row in income table, and one row for each row in payouts table (even if there are many rows for the same date)?
A table with one row per date is easy to make as a summary of one of your tables, e.g.
Income, grouped by
date. In each row, the
$group column (described here) will contain the summarized records from
Income. The records from the
Payouts table can be obtained using lookupRecords:
Payouts.lookupRecords(Date=$Date). So you can get the totals per date as:
The remaining difficulty would be if Payouts contains some dates that are not in Income; then the summary table wouldn’t include those. That’s where we’d need to find a workaround, if that’s a problem for your case.