Skip to main content

Metric selectors

Introduction

Selectors can be used to switch between metrics. In that case they are called metric selectors.

Creating a Metric selector

note

You must first create the metrics that you want to use in the selector.

Follow these steps to create a metric selector.

StepAction
1In the table item list, right-click on the table for which you want to create a metric selector and select New control - Selector.... A selector New selector is added in the table item list.
2Double click on New selector to open the Edit Control dialog.
3Right click in the Selector items pane an click on Add....
4Select the metrics you want to add to the selector and click on OK.
5If desired, you can set a Default value for the selector by adding the expression uid([default metric]).
6Disable the checkbox Allow empty selection to enforce that either one of the available metrics from the selector is selected, and click on OK.

docs image

Using the Metric selector on a chart

Follow these steps to add the metric selector on a chart

StepAction
1Go to the Dashboards tab and create a new dashboard based on the table in which the metric selector control is present.
2Go to the Chart tab.
3Select the attribute you want to display in the chart from the Rows drop down list.
4Select the metric selector control from the Metric drop down list.
5Drag the metric selector control to the Header controls of the chart.

See illustration below for an example.

docs image

In the example the metric selector contains three metrics. By selecting a different metric in the selector, the size of the bars of the chart also change.

note

The default value to be displayed for a chart is the number of records. If you use a metric selector you must also create a metric for the default value if you want this as one of the available display options.

Using the Metric selector on a legacy chart

To use the metric selector on a legacy chart you must create an expression that contains the following functions.

Function

Description

Selecteduids

Returns the list of UIDs (unique identifiers) of the current selection of the metric selector.

Any

Selects one item from that list.

Note: the metric selector used can only select one value at a time.

Metric

Evaluate the selected metric.

The metric function accepts either a metric or the UID of a metric.

For example: metric(any(selecteduids(FilterMetric_selector))).

Follow these steps to add the metric selector on a legacy chart.

StepAction
1Go to the Dashboards tab and create a new dashboard based on the table in which the metric control is present.
2Go to the Chart tab.
3Drag the attribute you want to display in the chart to the Rows level.
4Drag the Metric selector control to the Header controls panel.
5Change the Size to Expression.
6Click on expression and enter the expression containing the elements described above.
7Click on OK.