[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-31。"],[],[],null,["# Setting alerts based on time series data\n\nYou can create an [alert](/looker/docs/alerts-overview) to send an email or a Slack notification whenever the results from a query-based or Look-linked dashboard tile meet or exceed a specified threshold. Setting an alert based on time series data differs from setting an alert based on other data types.\n\n\nFor time series data, the alert condition is based on comparing specific rows in the series rather than being based on the complete result set. Working this way with time series data lets users perform additional operations that [compare data](/looker/docs/creating-alerts#setting_alert_conditions) from two rows in the series using additional alert condition options that are not available to other data types, such as **changes by** , **increases by** , and **decreases by**.\n\n\nWhen using these comparison conditions with time series data, the alert query compares the latest row of data with its previous row. To keep track of where you are in the time series --- in order to base alert conditions only on data that wasn't there the previous time the alert query was run --- Looker must persist the value of the latest time series data every time it runs the alert query.\n\n\nThis page describes two important cases to consider when you choose alert conditions that use time series data:\n\n1. [The alert conditions tell Looker to check the data for updates less frequently than the data is updated.](#interval_is_shorter)\n - For example, the time series interval is hourly (the data is aggregated by the hour), but an alert is set for a daily frequency.\n2. [The alert conditions tell Looker to check the data for updates more frequently than the data is updated.](#interval_is_longer)\n - For example, the time series interval is daily (the data is aggregated by day), but an alert is set for an hourly frequency.\n\nBoth cases depend on the relationship between the shortest interval between the time series rows (time series interval) and [how often the alert query is run (frequency)](/looker/docs/creating-alerts#setting_alert_frequency). The frequency is the amount of time between scheduled alert queries, and is set by the alert creator.\n\n\u003cbr /\u003e\n\n\u003e Ideally, the time series interval and frequency are the same; however, that is not always the case. If an ETL job is configured to load hourly data every night, or a query fails for some reason, it's important to understand how alert queries work when these intervals are not synchronized.\n\nAlert checking\n--------------\n\n\nAlert queries will check the latest row of time series data to determine whether either of the following is true:\n\n- If the current time series value is more recent than the most recent time series value from the previous alert check\n- If the current time series value is the most recent time series value in the time series, even if it has the same time series value as from the previous alert check\n\n\nThe first time an alert query is run, Looker will no longer evaluate the entire result set. Instead, Looker will consider those results as historical data and only look for changes that occur after the alert is created and the initial alert query is run.\n\nCase 1: The time series interval is shorter than the frequency\n--------------------------------------------------------------\n\n\nIn this example, a user wants to check daily whether the hourly sales are greater than the goal:\n\n\n**Time series interval = hourly Frequency = daily**\n\n\nThis approach involves checking hourly data with a frequency that is greater than an hour. The alert will check every new time series row that wasn't checked in the previous alert interval. In the case where you have hourly data and a daily alert check, the alert will check 24 rows every day. Each row is checked against the specified alert condition, and if *any* row fulfills the condition, an email will be sent.\n\n### Run 5/25/19 9:00 AM\n\n### Run 5/25/19 11:00 AM\n\n### Run 5/25/19 12:00 PM (no new data)\n\nCase 2: The time series interval is longer than the frequency\n-------------------------------------------------------------\n\n\nIn this example, a user wants to check hourly whether today's cumulative sales totals are greater than\nthe goal:\n\n\n**Time series interval = daily Frequency = hourly**\n\n\nThis approach involves checking data that is aggregated by **date** many times throughout\nthe day. Let's say that you've set up an alert to notify you if the daily sales\ntotal equals or exceeds 200. The sales total is increasing during each alert\ncheck as it accumulates throughout the day, so Looker continually rechecks the\nlatest time series value against the value that triggered the previous alert.\n\n### Run 5/25/19 9:00 AM\n\n### Run 5/25/19 10:00 AM\n\n### Run 5/25/19 11:00 AM"]]