Set up states on a metric set

Contents[Hide]

1. Overview

You can set up states on a metric set to indicate whether your data is in a good or bad condition based on comparison with other measures, formula results, or hierarchy values.

Data visualization controls will then display data differently depending on the state the data is in. You can use a control's State Styles property (e.g. on a chart series) to configure the appearance for each state.

2. Setting up states

2.1. Create a metric set

First, create a new metric set from the main menu.

In the Metric Set Designer, drag and drop two measures for comparison purposes (e.g., Sales and TargetSales) to the MEASURES field of the Data Binding panel.

Drag a date column to the ROWS field of the Data Binding panel.

Metric Set Designer
Metric Set Designer

2.2. Add a state group

A state group is a set of related states for evaluating the same measure, such as Good Sales and Bad Sales.

To create a state group in the Metric Set Designer, go to the toolbar and click Set Up States.

The Set Up States dialog is displayed.

Set Up States dialog
Set Up States dialog

Click Add a state group.

This opens the Configure State Group dialog.

Click the Measure dropdown and choose the measure that the states will be calculated for (e.g. Sales).

Give your state group a name and enter an optional description.

Configure State Group dialog
Configure State Group dialog

Click Submit to return to the Set Up States dialog. You'll see that your state group has been added to the list of state groups.

State group is now added
State group is now added

2.3. Add states to your state group

Now you can add some states to your state group.

In the Set Up States dialog, click Add in order to add the first state to the group.

The Configure State dialog is displayed.

Configure state
Configure state

Enter a name for the state and an optional description.

Click Add Condition. A greater than expression involving your measure (e.g. Sales) is automatically added.

Click the Greater Than button and select Greater Than or Equal To from the dropdown menu.

Select the comparison operator
Select the comparison operator

Click Select a target and choose the other measure to compare against (e.g. TargetSales).

Select a target measure
Select a target measure

Tip
In the above figure, notice that you can select a hierarchy such as Date as a target. This doesn't mean the state group's measure (Sales) will be compared against Date values. Instead, selecting a hierarchy as a target for a condition allows you to compare the corresponding hierarchy value for each metric set row against a specific hierarchy value. See this example for more details.

Click Submit to return to the Set Up States dialog. You'll see that the new state (e.g. Good) has been added to your state group.

Repeat the steps in this section but with a Less Than comparison operator for the Bad state.

Your state group now has two states.

State group with two states: Good and Bad
State group with two states: Good and Bad

Tip
When selecting a target to compare against, you can specify a constant number value by using the Constant (Formula) option.

Close the Set Up States dialog to see the table visualization updated with green and red colors reflecting the two states (Good and Bad) for the Sales measure.

Table visualization is automatically updated with green or red cells to indicate the state for each row
Table visualization is automatically updated with green or red cells to indicate the state for each row

3. Visualizing states

3.1. Working with state styles

First, create a new dashboard and drag the metric set (with states added) to the canvas. The metric set appears as a table visualization identical to the one in the Metric Set Designer.

Drag the metric set with states to the dashboard canvas
Drag the metric set with states to the dashboard canvas

Right click on the table and use the menu option to re-visualize the table as a bar chart. You'll see that the bars for the Sales measure are colored green or red according to the state. This is achieved using state styles on a chart series.

Go to the Properties window. Under MAIN \ CHART \ Series, click Series 1.

Edit properties of Series 1
Edit properties of Series 1

Click Look and expand the State Styles property.

State styles for Series 1
State styles for Series 1

You'll see two state styles which were automatically created based on the metric set states (Good and Bad).

Click the Good state style to edit its properties. For example, choose a new Fill color.

Change the Fill color for the Good state style
Change the Fill color for the Good state style

4. Examples

4.1. Comparing against a constant

In the Configure State dialog, you can add a condition that compares your measure (e.g., Sales) against a constant numeric value as follows.

Click Select a target and choose the Constant (Formula) option.

Compare measure against a constant value
Compare measure against a constant value

Type the constant value (e.g., 5000000) in the numeric text box and then click Submit.

Enter your numeric value
Enter your numeric value

A new measure is added to the metric set with the caption Constant (value)

A constant measure is added which represents the comparison target for the state
A constant measure is added which represents the comparison target for the state

If you need to change the constant value you can do so by editing the state and using the Configure State dialog again. But note that the caption of the corresponding constant measure will not change in this case. It will remain as Constant (5000000), for example.

4.2. Comparing against a hierarchy

Instead of comparing the state group's measure, you can also add conditions in the Configure State dialog to compare hierarchy values. For example, add a condition that compares the Date hierarchy value for each metric set row against a specific Date value. This lets you set up a state group that highlights all Sales values between two dates. Or, you can set up a state group to highlight all Sales values of products that have a Color hierarchy value equal to Silver.

For the following example, create a metric set that displays a Sales measure and a Country row hierarchy.

Create a new metric set
Create a new metric set

Add a state group on the Sales measure and add the first state. In the Configure State dialog, click Select a target and choose the Country hierarchy.

Select the Country hierarchy
Select the Country hierarchy

The comparison operator turns into Equal To. Click the button next to it in order to select a specific Country hierarchy value.

Select a hierarchy member
Select a hierarchy member

Add a second condition to compare against a different hierarchy member. Then set the Logical Operator to Or.

Add another Or condition
Add another Or condition

The resulting metric set highlights Sales values where the corresponding Country value matches one of the conditions.

Highlighted Sales cells correspond to rows where Country matches one of the conditions
Highlighted Sales cells correspond to rows where Country matches one of the conditions

Note
For non-datetime hierarchies, only the Equal To comparison operator is supported. For datetime hierarchies, you can also use Less Than, Greater Than, etc. See Use a datetime hierarchy in state conditions for more details.

5. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri