Set up states on a metric set
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 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 two measures for comparison purposes to the MEASURES field of the Data Analysis panel.
Drag a hierarchy column to the ROWS field of the Data Analysis panel.
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.
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.
Give your state group a name and enter an optional description.
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.
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.
Enter a name for the state and an optional description.
Click Add Condition. A greater than expression involving your measure is automatically added.
Click the Greater Than button and select Greater Than or Equal To from the dropdown menu.
Click Select a target and choose the other measure to compare against.
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.
Close the Set Up States dialog to see the table visualization updated with colors reflecting the two states (Good and Bad) for the selected measure measure.
3. Visualizing states
First, create a new dashboard with this metric set by clicking Add To New Dashboard from the toolbar.
Right click the table and use the context menu to re-visualize as a bar chart. You'll see that the bars for the measure are colored according to the state. This is achieved using state styles on the series.
Go to the Properties panel. On the Main tab, click the series.
In the Look tab, under State Styles, you will see two state styles that were automatically created based on the metric set states (Good and Bad).
Click a state style to edit its properties. For example, choose a new Fill color.
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.
Type the constant value in the numeric text box and then click Submit.
A new measure is added to the metric set with the caption Constant (value).
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 (2000000), for example.
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 table that displays product information using various hierarchies (you can include measures, but they are not required for this example).
Add a state group. Since this example has no measures, leave the measure as (None). However, you can add hierarchy states to any state group, regardless of which measure it is based on.
Add a state. In the Configure State dialog, click Add condition, then click Select a target and choose a hierarchy
The comparison operator turns into Equal To. Click the button next to it in order to select a specific hierarchy value.
Add a second condition to compare against a different hierarchy (in this example, color). Make sure that the Logical Operator is set to And.
The resulting metric set highlights values matching both conditions.