BigQuery
BigQuery daily revenue threshold alerts
Check yesterday’s revenue without opening a dashboard each morning. Get the date range and revenue definition right, then set a scheduled Slack alert.
A revenue check for yesterday, not today so far
Illustration · scheduled checks every 12 or 24 hours
Was yesterday’s revenue lower than it should have been? You can answer that with a short BigQuery query and let Kisu handle the scheduled check. We’ll total completed-order revenue for yesterday in UTC and compare it with an example threshold of 1000 USD. That means a full calendar day, not the last 24 hours or today’s sales so far.
1. Define revenue before writing the query
For this query, you’ll need one row per order, a TIMESTAMP completed_at, a numeric net_revenue, plus status and currency fields. We’re assuming net_revenue already handles refunds and discounts the way your team expects. If it doesn’t, adjust the query to match your definition of revenue.
Check two easy-to-miss problems: mixed currencies and duplicated order totals from a line-item join. Convert currencies before summing, and make sure each order contributes only once. Compare the result with your existing report for the same day before enabling notifications. The 1000 USD threshold is an example, not a target you need to adopt.
2. Query the previous complete UTC day
SELECT COALESCE(SUM(net_revenue), 0) AS daily_revenue
FROM `your-project.analytics.orders`
WHERE completed_at >= TIMESTAMP(
DATE_SUB(CURRENT_DATE('UTC'), INTERVAL 1 DAY), 'UTC'
)
AND completed_at < TIMESTAMP(CURRENT_DATE('UTC'), 'UTC')
AND status = 'completed'
AND currency = 'USD'Replace the table and column names before running this read-only SELECT. It includes the start of yesterday and excludes the start of today, so an order at midnight belongs to only one day. If you report in another timezone, replace all three UTC literals consistently. Don’t assume a calendar day is always the same as a fixed 24-hour window.
COALESCE returns numeric 0 when the sum is empty or all NULL. That’s useful when no orders should trigger the below-1000 rule, but there’s a trade-off: missing revenue values can also look like zero. If NULL means bad data in your system, add a separate validation check, or remove the fallback and review no-data results in History.
See Google’s date functions reference and SUM reference for the SQL behavior.
3. Configure the threshold and Slack delivery
- Activate a Kisu subscription and connect a BigQuery project with query-job and source-table permissions.
- Add a Slack destination for the team responsible for revenue checks, then use Send test.
- Create an alert named Previous-day revenue below review floor and paste the query.
- Use Load columns, select daily_revenue, and choose Sum less than 1000.
- Use Test query, select the tested Slack destination, choose a 12- or 24-hour frequency, and save.
The SQL has already added up the revenue. Kisu’s Sum keeps that single value. Count would give you 1 for the one result row, not its dollar amount. Google bills usage from query tests and scheduled checks separately from your Kisu subscription.
4. Verify the amount, date, and refresh timing
Try values on both sides of the threshold in a development dataset. Revenue of 850 should match, as should numeric 0. Exactly 1000 and 1200 shouldn’t. Check the date range against your dashboard too, not just the final number.
Yesterday may be over, but its data might still be arriving. Kisu doesn’t wait for your import job. For this UTC example, choose UTC in Settings from your email menu. Set Starting at and leave enough time for the reporting timezone and import delay. If late data is common, check an older, more complete period or a prepared reporting table, and monitor import freshness separately.
Kisu checks every 12 or 24 hours, not in real time. Enter your preferred time under Starting at, using the timezone shown beside the input. Change it in Settings from your email menu. With a 12-hour schedule, you’ll get a second check 12 hours later. New alerts use Just when the issue starts, so one ongoing problem won’t keep sending messages. Want reminders? Choose As long as the issue persists for a notification on every successful matching check. When the condition no longer matches, the incident resolves without a recovery message.
After a check, open History and look at three things: the number, whether the condition matched, and whether the notification was delivered. A failed check or no-data result does not send a threshold notification or resolve an open incident. You can review completed checks and delivery history for 30 days.
Troubleshooting an unexpected revenue alert
If the number looks wrong, check timezones, order statuses, missing amounts, late refunds, duplicates, and currency filters. Low revenue can be a business issue or a data issue. The notification won’t diagnose the cause or include a full order export, so keep your report or query handy for the follow-up.
Prefer to work without SQL? Try Google Sheets sales-target alerts. If you need help with the connection or editor, the BigQuery-to-Slack tutorial has screenshots and step-by-step instructions.


3. Queue a Slack notification