Relative Change Alerts

View as Markdown

Summary

  • Relative Change Alerts evaluate based on the nature of the data change in a Cell’s value
  • They can respond to any change, a relative change or an absolute change

Relative Change Alerts are similar to Data Change Alerts, but they evaluate on the relative nature of the change made to a given Cell's value.

In the Alert Wizard they are a first-class Alert Type (Type: 'RelativeChange'). The Rule step uses the Expression Editor (no Query Builder) with toolbar chips for ANY_CHANGE, PERCENT_CHANGE and ABSOLUTE_CHANGE. Column Scope is configured on the Trigger step, the same as Data Change Alerts.

There are 3 Relative Change Expression Functions:

FunctionWhen Alert is Triggered
ANY_CHANGEAny change at all to the Cell's value
PERCENT_CHANGEIf the value of Cell changes by a given percent amount
ABSOLUTE_CHANGEIf the value of Cell changes by a given absolute amount

Find Out More

Any Change

Any Any Change Alert fires if there is any change at all to the Cell's value.

It leverages the ANY_CHANGE Expression Function.

Alerts: Relative Any Change
Fork
  • This example displays an Info Alert which fires when there is any change to a Cell's value in any numeric column (using ANY_CHANGE expression)
Loading demo…

Percent Change

A Percent Change Alert fires if the value of a Cell changes by a given percent amount.

It leverages the PERCENT_CHANGE Expression Function.

Hint

PERCENT_CHANGE can be given a "direction" to limit the evaluation to percent increases or decreases

Alerts: Relative Percent Change
Fork
  • This example displays 2 Warning Alerts which check for relative percent changes (leveraging the PERCENT_CHANGE expression function)
    • on the Github Stars column if the cell's value changes by more than 50% (in any direction)
    • on the Github Watchers column if the cell's value increases by more than 50%
Loading demo…

Absolute Change

An Absolute Change Alert fires if the value of a Cell changes by a given absolute amount.

It leverages the ABSOLUTE_CHANGE Expression Function.

Hint

ABSOLUTE_CHANGE can be given a "direction" to limit the evaluation to absolute increases or decreases

Alerts: Relative Absolute Change
Fork
  • This example displays 2 Success Alerts which check for relative absolute changes (leveraging the ABSOLUTE_CHANGE expression function)
    • on the Github Stars column if the cell's value changes by more than 100 (in any direction)
    • on the Github Watchers column if the cell's value decreases by exactly 20
Loading demo…
Developer Guide

Providing Relative Change Alerts in Initial State

const initialState: InitialState = {
  Alert: {
    AlertDefinitions: [
      {
        Name: 'alert-any-numeric-change',
        Type: 'RelativeChange',
        MessageType: 'Info',
        Scope: {
          DataTypes: ['number'],
        },
        Rule: 'ANY_CHANGE([name])',
        AlertProperties: {
          DisplayNotification: true,
          HighlightCell: true,
        },
      },
      {
        Name: 'alert-stars-percent-jump',
        Type: 'RelativeChange',
        MessageType: 'Warning',
        Scope: {
          ColumnIds: ['github_stars'],
        },
        Rule: 'PERCENT_CHANGE([github_stars]) > 50',
        AlertProperties: {
          DisplayNotification: true,
          HighlightCell: true,
          DisplaySystemStatusMessage: true,
        },
      },
    ],
  },
};
1
Set Type to RelativeChange (recommended)

Set Type: 'RelativeChange' so the Alert Wizard and validation treat the rule as relative change. AdapTable can also infer this from ANY_CHANGE, PERCENT_CHANGE, or ABSOLUTE_CHANGE in the Rule.

2
Scope and Rule

Scope limits which column edits are considered (same as Data Change Alerts). The Rule uses relative-change functions on the changing cell.