Spend by vendor¶
The 25 vendors with the highest billed amount.
Run it with the run_report tool, passing the report id spend-by-vendor. If the workspace has more than one connected entity, also pass the connection_id of the one you want, from list_entities.
Output columns¶
vendorbill_counttotal_billed
SQL¶
This is the exact query Kipper runs, against your own data and under your own permissions.
SELECT
c.company_name AS vendor,
count(t.id) AS bill_count,
sum(t.total) AS total_billed
FROM v_ai_companies c
JOIN v_ai_transactions t ON t.company_external_id = c.source_id
AND t.data_source_id = c.data_source_id
WHERE c.type = 'vendor'
AND t.type = 'bill'
GROUP BY c.company_name
ORDER BY total_billed DESC NULLS LAST
LIMIT 25
Limits¶
- Capped at 100 rows.
- Covers one connected entity. To span every entity, use the
run_sqltool withall_entities=truerather than running the report once per entity. - Takes no parameters besides
connection_id, which picks the entity and is required when the workspace has more than one. Any date window a report uses is already part of the SQL above.