- Source
- FOCUS use-case library
- Data
- FOCUS 1.0 sample
- Status
- Not in v1.0 sample
- Mode
- Read-only
- Library snapshot (UTC)
- 2026-10-08
Loading sample results
The Invoice Detail dataset and InvoiceId are absent from the v1.0 sample, so tax and service amounts cannot be totalled per invoice.
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