Adding a dynamic element filter

Contents[Hide]

1. Overview

A dynamic element filter allows viewers to choose the measure or hierarchy they want to see in a visualization via a drop down list, without any scripting.

2. Setup

For this example, a data cube will be used which exposes two measures (LineTotal, OrderQty) and three hierarchies (FirstName, OrderDate, Product). You can build a similar data cube yourself by following the steps in this article.

Data cube in Explore
Data cube in Explore

3. Dynamic Measure

3.1. Add the dynamic element

First, create a new dashboard from the main menu using the Blank template.

Drag the OrderDate hierarchy from Explore to the dashboard canvas. It will appear as a table visualization.

Drag OrderDate hierarchy to canvas
Drag OrderDate hierarchy to canvas

In the Data Analysis Panel, click the click to add link in the MEASURES section.

Click to add a measure
Click to add a measure

In the list of available measures to add, go to the CALCULATED ELEMENTS section and click <Dynamic Measure>.

Select Dynamic Measure
Select Dynamic Measure

The dynamic measure is added to the Data Analysis Panel and you can see that it is set to a default measure (OrderQty) in the table visualization.

Dynamic measure is added and set by default to OrderQty
Dynamic measure is added and set by default to OrderQty

To change the default dynamic measure, click the Edit button for the Dynamic Measure in the Data Analysis Panel.

In the Configure Metric Set Element dialog, scroll all the way down and set the Dynamic Measure drop down list to the default that you want. For example, change it to LineTotal.

Change the default dynamic measure
Change the default dynamic measure

The table visualization now shows the LineTotal measure by default.

Default dynamic measure is now LineTotal
Default dynamic measure is now LineTotal

Alternatively, you can open the token menu for the Dynamic Measure dropdown and set the default to No Selection. This will cause the table visualization to not display any dynamic measure initially.

No Selection as the default
No Selection as the default

Note
The measure's default aggregator specified in the data cube will be used as the aggregator when that measure is selected dynamically. This allows for the possibility of setting different aggregators for different measures. If a data cube is not used as the source of data, the measures selected using the dynamic element will use the same aggregator.

3.2. Add the dynamic filter

The next step is to add a Dynamic Element filter to the dashboard to allow users to switch measures via a drop down list.

Select the table visualization on the canvas, go to the toolbar, click Filter, and then click Dynamic Element.

Add a dynamic element filter
Add a dynamic element filter

A dynamic element filter control is added to the canvas and the Filter Visualizations panel is opened automatically. The filter is already connected to the dynamic measure by default, so you can just close the panel.

Filter Visualizations panel
Filter Visualizations panel

Switch to View mode and use the filter drop down list to choose the measure you want to see in the table visualization. The filter's token menu can be used to switch the dynamic measure back to its default, or to No Selection.

Use the dynamic element filter to select your measure
Use the dynamic element filter to select your measure

If you hover over a table cell, the tooltip will show the caption and value of the current measure. This is possible because of special keywords [Dynamic Measure Caption] and [Dynamic Measure] which you can see in the Properties for the table column.

Tooltip uses dynamic measure keywords
Tooltip uses dynamic measure keywords

4. Dynamic Hierarchy

4.1. Add the dynamic element

Adding a dynamic hierarchy is similar to adding a dynamic measure.

For this example, first create a new dashboard from the main menu using the Blank template.

Drag the OrderQty measure from Explore to the dashboard canvas. It will appear as a table visualization.

Drag OrderQty measure to canvas
Drag OrderQty measure to canvas

In the Data Analysis Panel, click the click to add link in the ROWS section.

Click to add a row hierarchy
Click to add a row hierarchy

In the list of available hierarchies to add, go to the CALCULATED ELEMENTS section and click <Dynamic Hierarchy>.

Select Dynamic Hierarchy
Select Dynamic Hierarchy

The dynamic hierarchy is added to the Data Analysis Panel and you can see that it is set to a default hierarchy (FirstName) in the table visualization.

Dynamic hierarchy is added and set by default to FirstName
Dynamic hierarchy is added and set by default to FirstName

To change the default dynamic hierarchy, click the Edit button for the Dynamic Hierarchy in the Data Analysis Panel.

In the Configure Metric Set Element dialog, scroll all the way down and set the Element drop down list to the default that you want. For example, change it to Product instead.

Change the default dynamic hierarchy
Change the default dynamic hierarchy

The table visualization now shows the Product hierarchy on ROWS by default.

Default dynamic hierarchy is now Product
Default dynamic hierarchy is now Product

Alternatively, you can open the token menu for the Element dropdown and set the default to No Selection. This will cause the table visualization to not display any dynamic hierarchy initially.

No Selection as the default
No Selection as the default

4.2. Add the dynamic filter

The next step is to add a Dynamic Element filter to the dashboard to allow users to switch hierarchies via a drop down list.

Select the table visualization on the canvas, go to the toolbar, click Filter, and then click Dynamic Element.

Add a dynamic element filter
Add a dynamic element filter

A dynamic element filter control is added to the canvas and the Filter Visualizations panel is opened automatically. The filter is already connected to the dynamic hierarchy by default so you can just close the panel.

Filter Visualizations panel
Filter Visualizations panel

Switch to View mode and use the filter drop down list to choose the hierarchy you want to see in the table visualization. The filter's token menu can be used to switch the dynamic hierarchy back to its default, or to No Selection.

Use the dynamic element filter to select your hierarchy
Use the dynamic element filter to select your hierarchy

If you hover over a table cell, the tooltip will show the current hierarchy level and corresponding member. This is possible because of special keywords [Dynamic Hierarchy Level] and [Dynamic Hierarchy] which you can see in the Properties for the table column.

Tooltip uses dynamic hierarchy keywords
Tooltip uses dynamic hierarchy keywords

5. Properties

This section describes some of the key properties of a Dynamic Element Filter.

5.1. Shown Elements

The list of available measures (or hierarchies) displayed by default in a dynamic filter may include measures or hierarchies that you don't want. Instead of modifying the underlying data cube you can control exactly which elements (measures or hierarchies) will appear in the filter from its Properties.

Under the Main properties for the filter, click the Shown Elements plus sign. You'll see a checkbox list of available measures or hierarchies. Simply select the ones you want to appear in the dynamic filter.

Select the elements to appear in the filter
Select the elements to appear in the filter

5.2. Shown Tokens

In a similar way, you can control which tokens you want to display in the filter's token menu via Shown Tokens. If you want to hide the token menu altogether, you can do so under Look \ APPEARANCE properties.

5.3. Label Text

Under Text properties, use the Label Text property to change the text that appears above the filter's dropdown.

Set the label text for the filter
Set the label text for the filter

6. 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