Menyetel kondisi pemberitahuan berdasarkan perubahan persentase nilai data
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Anda dapat membuat pemberitahuan untuk mengirim email atau notifikasi Slack setiap kali hasil dari kartu dasbor berbasis kueri atau yang ditautkan dengan Look memenuhi atau melampaui nilai minimum yang ditentukan. Looker membuat pemberitahuan berdasarkan perbandingan nilai data bilangan bulat dan desimal. Dengan menggunakan solusi sementara yang dijelaskan di halaman ini, Anda juga dapat menyetel pemberitahuan berdasarkan perubahan persentase nilai data.
Untuk menyetel kondisi pemberitahuan berdasarkan perubahan persentase nilai data, kueri Anda harus berisi kolom tanggal.
Untuk menerima notifikasi peringatan saat perubahan persentase nilai data telah memenuhi atau melampaui nilai minimum yang ditentukan::
Misalnya, pengguna ingin membandingkan perubahan persentase suhu rata-rata di San Francisco setiap jam. Tujuannya adalah mengirimkan pemberitahuan setiap kali suhu meningkat lebih dari dua persen.
Jika suhu rata-rata periode saat ini adalah 100, maka pemberitahuan tersebut akan dipicu jika suhu menjadi lebih besar dari 102, perubahan lebih dari dua persen. Jika 102+ kemudian naik lebih dari dua persen lagi, maka pemberitahuan lain akan dipicu.
Untuk membandingkan nilai persentase, buat kalkulasi tabel dan gunakan untuk menyetel pemberitahuan:
Buat kalkulasi tabel yang menghitung persentase perubahan baris demi baris.
(${measure_name} - offset(${measure_name},1))/offset(${measure_name},1)
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-31 UTC."],[],[],null,["# Setting alert conditions based on percentage changes of data values\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. Looker creates alerts based on comparisons of whole number and decimal data values. Using the workaround described on this page, you can also set alerts based on percentage changes of data values.\n\u003e To set an alert condition based on a percentage change in data values, your query must contain a date field.\n\n\nTo receive an alert notification when a percentage change in data values has met or exceeded a specified threshold::\n\n- Create a [table calculation](/looker/docs/table-calculations) to compare percent values.\n- [Create a new alert](/looker/docs/creating-alerts) to trigger based on the difference in values.\n\n\u003cbr /\u003e\n\nExample\n-------\n\n\nFor example, a user wants to compare the percent change in average temperature in San Francisco each hour. The goal is to send an alert each time the temperature increases by more than two percent.\n\n\nIf the current period's average temperature is 100, then that alert would be triggered if the temperature becomes greater than 102, a change of more than two percent. If the 102+ then increases by more than two percent again, then another alert will be triggered.\n\n\nTo compare percent values, create a table calculation and use it to set the alert:\n\n1. Create a [table calculation](/looker/docs/table-calculations) that computes the percent change row over row.\n\n \u003cbr /\u003e\n\n `\n (${measure_name} - offset(${measure_name},1))/offset(${measure_name},1)\n ` You can also use the [**% change from previous row**](/looker/docs/table-calculations#%-change-from-previous-row) shortcut calculation.\n2. Set the table calculation **Format** to **Percent** and specify the number of **Decimals** to show.\n3. **Save** the table calculation.\n\n \u003cbr /\u003e\n\n4. [Save the Explore as a dashboard tile](/looker/docs/creating-user-defined-dashboards#adding_query_tiles_from_an_explore), if it is not already saved to a dashboard.\n5. [Create a new alert](/looker/docs/creating-alerts) based on the new table calculation. In the alert [creation dialog](/looker/docs/creating-alerts#setting_alert_conditions), select **greater than** and enter \"0.02\"."]]