Help & DocumentationGetting StartedUse Case WorkflowsTraining by ExampleTraining by Example: Use Case — Metrics and Alerting

Training by Example: Use Case — Metrics and Alerting

This is part one of the fifth use case in the Training by Example series. Review it after finishing the Training by Example: Use Case — Catalog Training by Example: Use Case — BurstingTraining by Example: Use Case — Exceptions Report and Training by Example: Use Case — Changes Report.

In this example, a business unit that oversees the company's Wine Sales requests a series of metrics for employees that demonstrate a high-level perspective of sales, costs, and profits by sales channel. Those metrics have to be included in weekly Bursts. Additionally, a Daily Alert should be distributed if:

  • Sales are higher/lower by 10% over the same day of week last week
  • Cost is higher/lower by 2 Std (standard deviations) of 30-day average
  • Profit is higher/lower by 15% for the same day of the week over the last 12 weeks 

Use the example workflow outlined below to:

  • Learn how to build a Metric from Dataset
  • Discover how to create an aggregated Metric
  • Understand how to create and customize a KPI Alert Rule and add it to the Daily Alert distribution

Make sure you have completed all the following steps before beginning this Use Case:

  • Created an SQL Data Source
  • Created a Category
  • Built an SQL Dataset
  • Added a User Map
  • Created a Dimension
  • Created a Folder
  • Built a Burst

Content Creation

A Metric is an Element that charts a key measure across time. A Metric may include up to 2 Dimensions and each defined Metric is limited to a single measure showing trends over time.

In this section, you will learn to create a Metric from the Dataset. Besides that, you will create an Aggregated Metric. Aggregate Metrics are not bound to any particular Data Collection Trigger.  The Metric's data is updated automatically each time its Source Metric's data is updated or changed.

  1. Access Content > Datasets
  2. Find the "<your name> Wine Sales Dataset" Dataset you created in Training by Example: Use Case — Exceptions Report and click its Active Name Link

[View] to open the Dataset Viewer

You are now going to build three KPI Metrics: one for sales, one for profits, and one for costs.

  1. This data is Measured: Select "Daily"
  2. Aggregate using: Choose "Sum"
  3. Value column: Select "total_sales_ammount"
  4. Date column: Choose "calendar_date"
  5. Name: Name the Metric "<your name> Daily Wine Sales". In this use case "Student ##" is used instead of a name
  6. Dimension using this column: Select "channel"
  7. Map to Dimension in Metric Insights: Choose "<your name> Channel"
  8. [Add Metric]

In the Viewer access Actions > Build Metrics

  1. This data is Measured: Select "Daily"
  2. Aggregate using: Choose "Sum"
  3. Value column: Select "total_gross_profit"
  4. Date column: Choose "calendar_date"
  5. Name: Name the Metric "<your name> Daily Wine Profits". In this use case "Student ##" is used instead of a name
  6. Dimension using this column: Select "channel"
  7. Map to Dimension in Metric Insights: Choose "<your name> Channel"
  8. [Add Metric]
  1. This data is Measured: Select "Daily"
  2. Aggregate using: Choose "Sum"
  3. Value column: Select "total_cost"
  4. Date column: Choose "calendar_date"
  5. Name: Name the Metric "<your name> Daily Wine Cost". In this use case "Student ##" is used instead of a name
  6. Dimension using this column: Select "channel"
  7. Map to Dimension in Metric Insights: Choose "<your name> Channel"
  8. [Add Metric]
  9. [Build All Metrics]
  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Sales" Metric and click its Active Name link

Click the Advanced Editor icon.

  1. Open the Data tab
  2. Calculate Metric Values for: Select "Only new data"
  1. Access Associations tab
  2. [+ Aggregate Metric]
  3. [Save]
  4. Aggregate using: Select "Sum"
  5. For these intervals: Choose "calendar" and activate a checkbox near the "Weekly"
  6. [Add Metrics]

[Update] when you are done.

  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Profits" Metric and click its Active Name link

Click the Advanced Editor icon.

  1. Open the Data tab
  2. Calculate Metric Values for: Select "Only new data"
  1. Access Associations tab
  2. [+ Aggregate Metric]
  3. [Save]
  4. Aggregate using: Select "Sum"
  5. For these intervals: Choose "calendar" and activate a checkbox near the "Weekly"
  6. [Add Metrics]

[Update] when you are done.

  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Cost" Metric and click its Active Name link

Click the Advanced Editor icon

  1. Open the Data tab
  2. Calculate Metric Values for: Select "Only new data"
  1. Access Associations tab
  2. [+ Aggregate Metric]
  3. [Save]
  4. Aggregate using: Select "Sum"
  5. For these intervals: Choose "calendar" and activate a checkbox near the "Weekly"
  6. [Add Metrics]

[Update] when you are done.

Find the "<your name>VP Wine Sales" Folder on the Homepage, hover over it and click Edit.

  1. Open the Content tab
  2. [Add Sub-Folder]
  3. Folder Name: Name the Folder "KPIs"
  4. [Add Sub-Folder]
  1. Click the "KPIs" Folder
  2. [Add Content]
  3. Activate the checkboxes in "<your name> Wine Sales", "<your name> Wine Profits", and "<your name> Wine Cost" rows
  4. [Add Content]

Distribution of Content

KPI Alert Rules are created to notify Users about changes occurring in Metrics. With the help of KPI Alert Rules, you can define in what circumstances Metric Insights will alert you about the changes.

In this section you will create several KPI Alert Rules via the Alert Rules Wizard and subscribe them to a specific User Group. For more information about the Wizard refer to [KPI Alert Rules] Wizard, types, criteria, user subscriptions.

  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Sales" Metric and click its Active Name link
  1. Open Alerting tab
  2. [+ New KPI Alert Rule]
KPI Alert Rule Type
  1. Select "Prior Value"
  2. [Next:Alert Criteria]
KPI Alert Rule Criteria
  1. Alert if: Select "more than a percentage"
  2. What percentage: Choose "10" and "above and below"
  3. The value from: Select "last week"
  4. Must happen to: Insert "1" and "1"
  5. Send the Alert: Select "immediately", "Email", and "every time"
  6. Optionally [Simulate]. It will show the number of alerts for every Dimensional Value
  7. Click workflow
  8. [Finish]

Click the Alert Rule Active Name link.

  1. Open Subscriptions & Alert Workflows tab
  2. [+Edit User Map Access]
  3. Subscription map: Select "<your name> Master Filter User map"
  4. <your name> Channel: Choose "channel"
  5. [Save]
  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Profits" Metric and click its Active Name link
  1. Open Alerting tab
  2. [+ New KPI Alert Rule]
KPI Alert Rule Type
  1. Select "Average of Prior Values"
  2. [Next:Alert Criteria]
KPI Alert Rule Criteria
  1. Alert if: Select "more than a percentage"
  2. What percentage: Choose "15" and "above and below"
  3. For avg of: Select "the same day", "week", "12", and "weeks"
  4. Must happen to: Insert "1" and "1"
  5. Send the Alert: Select "immediately", "Email", and "every time"
  6. Optionally [Simulate]. It will show the number of alerts for every Dimensional Value
  7. Click workflow
  8. [Finish]

Click the Alert Rule Active Name link.

  1. Open Subscriptions & Alert Workflows tab
  2. [+Edit User Map Access]
  3. Subscription map: Select "<your name> Master Filter User map"
  4. <your name> Channel: Choose "channel"
  5. [Save]
  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Cost" Metric and click its Active Name link
  1. Open Alerting tab
  2. [+ New KPI Alert Rule]
KPI Alert Rule Type
  1. Select "Recent Volatility Levels"
  2. [Next:Alert Criteria]
KPI Alert Rule Criteria
  1. Alert if: Select "above or below", "2", and "std"
  2. For avg of: Select "all days", "week", "30", and "days"
  3. Must happen to: Insert "1" and "1"
  4. Send the Alert: Select "immediately", "Email", and "every time"
  5. Optionally [Simulate]. It will show the number of alerts for every Dimensional Value
  6. Click workflow
  7. [Finish]

Click the Alert Rule Active Name link.

  1. Open Subscriptions & Alert Workflows tab
  2. [+Edit User Map Access]
  3. Subscription map: Select "<your name> Master Filter User map"
  4. <your name> Channel: Choose "channel"
  5. [Save]

Alerts are sent only when they occur. However, they will also be sent to the Users if the data is recollected. So, in this step you will delete all the Metric data and recollect it. You will do it only for the "<your name> Daily Wine Sales" Metric, just to check the Alert notification.

You will receive an Alert Notification only if you, as a User, are added to the User Map that you assigned to the KPI Alert.

  1. Access Content > Elements
  2. Find the "<your name> Daily Wine Sales" metric and click its Active Name link
  1. Open Data tab
  2. Click Delete existing Metric values
  3. [Delete]
  1. Click Collect data
  2. Recollect after: Select a date in the previous month
  3. [Select]
  4. [Update Aggregates]

After data recollection you will receive Alert Notification for the whole period you've chosen in the Recollect after field.

Congratulations! You finished the workflow!

You are done. Great job!