Set up states on a metric set

Contents[Hide]

1. Overview

You can set up states on a metric set to display some data differently when it falls within that state, based on comparisons with other values.

This can be used to call attention to certain data, or to otherwise customize visualization settings for certain data by setting up its State Styles.

Related video: States

2. Setting up states

2.1. Create a metric set

For this example, create a new metric set from the main menu. You can also set up states the same way when editing a metric set on a dashboard or another view.

Drag two measures for comparison purposes.

Drag a hierarchy column under Rows  in the data analysis panel.

Editing the metric set
Editing the metric set

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. You might have multiple state groups if a value could be in multiple states, such as a value that is both "good" and "lower than this time last year".

To create a state group, click Set Up States on the toolbar. When editing a dashboard or another view, you can find this option under Data Tools in the toolbar.

Set up states
Set up states

In the Set Up States dialog, click Add a state group.

Click the Measure drop-down and choose the measure that the states will be calculated for. You can leave this as (None) if you are only comparing with hierarchy values.

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

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

Enter a Name for the state and an optional Description.

Click Add condition.

Configure state
Configure state

A greater than expression is automatically added.

To change the operator used to compare against your measure, click the Greater Than sign button and choose another option such as Greater Than or Equal To from the drop-down menu.

Select the comparison operator
Select the comparison operator

Click Select a target and choose what to compare against. If you choose to compare a hierarchy's values, you will also choose what value to compare against - see the example below for details.

Select a target measure
Select a target measure

Click Submit.

The new state has been added to your state group.

For our example below, we will repeat these steps with a Less Than comparison operator to create a Bad state.

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

Close the Set Up States dialog (or click the Preview button) to see your visualization updated with default settings reflecting your states.

Table visualization is automatically updated with shades of red to indicate the state for each row
Table visualization is automatically updated with shades of red to indicate the state for each row

3. Visualizing states

To change the initial settings applied to values within each state, open the Properties window and find the State Styles property that corresponds with what is displaying those values. (The Set Up States dialog has a Visual button you can use as a shortcut.)

For example, a table visualization has state styles that can be applied in each column: click on a column in the Main tab.

Edit the properties of the SalesYTD column
Edit the properties of the SalesYTD column

In the Look tab, find State Styles. If your state group applies to this column's data, you will see state styles added automatically. You can also add your own and assign their State property to your state.

State styles for SalesYTD
State styles for SalesYTD

Click a state style to edit its properties. For example, change the Text for the Good state.

Change the Text for the Good state style
Change the Text for the Good state style

When re-visualizing, notice that the state style options are visualization-specific and have changed. For example, here is our table re-visualized to a Bar chart. In the State Styles found in the data point series, the fill color has been changed and markers added for the Good state.

Change the Fill and show markers for the Good state
Change the Fill and show markers for the Good state

4. Examples

4.1. Comparing against a constant

In the Configure State dialog, you can add a condition that compares your measure against a constant numeric value.

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 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 to the metric set
A constant measure is added to the metric set

The constant is created as a formula measure. If you need to change the constant value you can do so by clicking its fx button in the data analysis panel. You can also update its caption by editing the measure from the data analysis panel.

4.2. Comparing against a hierarchy

You can also add conditions in the Configure State dialog to compare hierarchy values, even if you associated your state group with a measure. 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 table that displays product information using various hierarchies (you can include measures, but they are not required for this example).

Create a new metric set
Create a new metric set

Add a state group. Since this example has no measures, leave the measure as (None).

Add a state. In the Configure State dialog, click Add condition, then click Select a target and choose a hierarchy.

Select the Country hierarchy
Select the Country hierarchy

Unless this is a date/time hierarchy, the comparison operator turns into Equal To because this is the only operator that is supported. Click the button next to it in order to select a specific hierarchy value.

Select a hierarchy member
Select a hierarchy member

You can add more conditions to compare against additional hierarchies. In this example, we've chosen Color and ensured the Logical Operator is set to And.

Add another And condition
Add another And condition

The resulting metric set highlights values matching both conditions.

Highlighted cells correspond to rows where both conditions are met
Highlighted cells correspond to rows where both conditions are met

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