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.

States are defined as part of a state group, which 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 single value could represent multiple states, such as a value that is both above the sales target ("Good") and lower than this time last year ("Trending Down").

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 on any other view.

Drag two numeric columns (measures) for comparison purposes.

Drag a column of text or date values (a hierarchy) to Rows in the Data Analysis Panel.

Editing the metric set
Editing the metric set

2.2. Add a state

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

Set up states
Set up states

If this is the first state in this metric set, the Configure State dialog appears immediately.

In the Measure drop-down, choose which numbers determine your conditions. You can leave this as (None) if you are only comparing hierarchy values.

You can enter a preferred Name to identify this state.

Click Add condition.

Configure State dialog
Configure State dialog

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 in your data. If you select a constant or a hierarchy (orange icon), you will also enter a specific value to compare against - see the examples below for details.

Select a target measure
Select a target measure

Click Submit to create a new state group with your new state.

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

In the Set Up States dialog, click Add a state near the bottom of the dialog to add another state to this state group.

Add state to state group
Add state to state group

Repeat the steps to configure the 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

2.3. Add another state group

You can set up another state group to check for a separate set of conditions at the same time.

In the Set Up States dialog, click the plus button next to your existing state group name to add a new one.

Add another state group
Add another state group

After creating the new state group, you can click Add a state.

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 check against text or date/time data, even if you associated your state group with a measure. For example, add two conditions that compare the Date value in each row of data to highlight all values between two dates. Or, you can set up a state to highlight Sales values of products that have a Color hierarchy value equal to Silver.

For the following example, create a table that displays various data made up of text values and dates (measures are not required for this example).

Create a new metric set
Create a new metric set

Add a state. Since we are not checking measure values, leave the measure as (None).

In the Configure State dialog, click Add condition, then click Select a target and choose the values you want to compare.

Select the Country hierarchy
Select the Country hierarchy

Next, the first button displays an operator such as an equals sign, which you can click to change. Date/time data can be compared using additional operators such as Greater Than.

Click the button next to it to choose which specific value to compare against.

Select a hierarchy member
Select a hierarchy member

You can add more conditions. In the example shown below, we're checking for rows with a particular Class value And a particular Color value according to the Logical Operator setting.

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:
Phone: 9am-6pm, ET, Mon-Fri
Email: 7am-6pm, ET, Mon-Fri