Source
FOCUS use-case SQL
Status
Not in v1.0 sample
Results
Not run
Mode
Read-only
Library snapshot (UTC)
2026-10-08

The Invoice Detail dataset and InvoiceId are absent from the v1.0 sample, so tax and service amounts cannot be totalled per invoice.

Review the original SQL below and the required columns before using a newer FOCUS dataset.

Original FOCUS SQL
SELECT
  InvoiceId,
  SUM(CASE WHEN ChargeCategory = 'Tax' THEN BilledCost ELSE 0 END) AS TotalTaxAmount,
  SUM(CASE WHEN ChargeCategory <> 'Tax' THEN BilledCost ELSE 0 END) AS TotalServiceAmount,
  SUM(BilledCost) AS GrandTotalPayable
FROM InvoiceDetail
WHERE
  InvoiceId = ?
GROUP BY
  InvoiceId