Using combo boxes as filters

A common practice in dashboards is to use combo boxes in one report to control the values displayed in one or more other reports. The values selected in the combo boxes are passed to variables, which are used as report parameters. The report is placed in a widget on a dashboard. Other reports which have the same parameters, or refer to the same look-ups are automatically linked. Selecting a date, for example, from a combo box will update all widgets which contain a date parameter.

If you use combo boxes in this way, it is important to ensure that the combo boxes and values are synchronized. Users should not, for example, be able to select a date from a combo box but see values for a different date in the linked reports.

To ensure that combo boxes and values are synchronized, use the variables passed by the combo boxes as both input and output variables.

Using combo boxes as filters is not appropriate if you are creating dynamic reports - reports which do not depend on a specific data source. Instead consider using XML variables.

Example

This example illustrates how combo boxes and values can become unsynchronized:

A report displays a combo box containing a list of dates. By default the date is All Years.

The combo box outputs to a variable, but does not have an input variable. The variable is used as a report parameter.

You place the report on a dashboard, with other reports which are linked.

You select 2004 from the combo. This passes 2004 to the variable.

Linked widgets on the dashboard automatically update to display values in respect of 2004.

You save the dashboard.

By default, the values of parameters are saved with the dashboard. So, the current value of the parameter (2004) is saved.

You log off and then reload the dashboard.

You expect to see 2004 selected - but the combo box has reverted to All Years.

This is because, although the value of the variable/parameter was saved, the dashboard could not pass it to the combo box - because there is no input variable.

But the values in the other widgets are also stored with the dashboard and are displayed when the dashboard is loaded. So, when you re-open the dashboard, the combo box reverts to All Years, but the other widgets still display values for 2004.

There are two solutions to the problem. One can be implemented in Application Studio, the other in the dashboard. In Application Studio the solution to is to use the same variable as both the Output and Input variable.

In a dashboard, the only option is to turn off parameter storage and make the combo box the 'leading widget'. When the dashboard is reloaded, the combo box drives the other widgets. This does not prevent the combo box reverting to All Years, but it does ensure that the values in the linked reports are also in respect of All Years.