Page tree

This document explains how to filter dashboard data using parameter variables. We will create 2 combo boxes to set up a parameter start and end date. By changing the value of these parameters, we will be able to apply a filtered query to our database.

Prerequisite

We need to have two parameters in the worksheet allowing us to define a start and end date. In our case they are called StartDate and EndDate.

Steps

  • Create two combo boxes allowing the user to select a start and end date. We will call them ComboBoxStart and ComboBoxEndSelect Embedded as list values type and check the calendar option.

  • Go to the dashboard Options and go to the Script tab.

  • Let’s create a script that initializes these two combo boxes. For instance:
    • End date = today
    • Start date = today - 3 days

For this we can use the following javascrit code:

ComboBoxStart.selectedObject = dateAdd('d', -3, new Date());

ComboBoxEnd.selectedObject = new Date();

refreshData();

  • Let’s now add a script in the onRefresh case, in order to adjust the query depending on the user selection.

parameter.StartDate = ComboBoxStart.selectedObject;

parameter.EndDate = ComboBoxEnd.selectedObject;

refreshData();

  • Create a simple table or line chart and test if the filter applies correctly

The best way to get IT support is to use the new Service One Platform.