Use Parameters


Default Parameter

By default a newly created dashboard will contain the Time Range parameter, which lets the user choose a default timerange for the data that appears in the dashboard.

By clicking on the Parameters button in the top menu, you are able to edit the Time range parameter by clicking the pen icon.

Click Parameters then click edit on the Time range parameter

This should open up the Edit Parameter dialog, en lets you view the details of the Time range parameter.

The Edit Parameter dialog
  • The label is the name of the parameter that is used in the dashboard

  • The Parameter type can be set to either Single selection, Mutliple select, Free text, Time range and Data source.

  • The starttime and endtime varable names, are the variable name(s) that can be used in dashboard tiles/queries to use the selected value of the parameter.

  • The Show on pages lets you set which pages of the dashboard should include the parameter.

  • The defult value is the value that the parameter should have when first initialized.

Create a custom Parameter

Parameters can be used in Dashboards to filter on data that is being visualized. Using parameters also significantly improve dashboard rendering performance, because values are filtered as early as possible in the query. Filtering is enabled when the parameter is included in the query associated with a tile.

For more detailed information about how to set up and use different kinds of parameters see Use parameters in dashboards.

  1. Click the Parameters button in the top of the dashboard.

  2. Click the Add button.

Add a new Parameter to a dashboard
  1. You must specify a Name for the Label (Will be shown in Dashboard selection)

  2. Give it an optional description and set a Variable Name that can be used in your queries as a filter

  3. Set it to be shown on the currently selected Page

  4. Select Query and click Edit Query to specify the Query

Then add the following Query into the dialog:

Measurements
| where StartTimestamp between (_startTime .. _endTime)
| distinct HierarchicalName
| order by HierarchicalName asc
Adding a Query to select Parameters.
  1. In the Add Query Dialog you can specify your Query.

  2. In the example above, we are using the Dashboard 's Time range filter to select the HierarchicalName of all available Measurements within the Period, then we order them in ascending alphabetically.

  3. Click the Add button

  4. Make sure to set the Value column in the Add Parameter Dialog is set to the HierarchicalName (The column name of the Query just specified)

The parameter should appear in the top of the dashboard

Use parameter to filter a Tile

You can use the Parameter that the user has selcted to filter the data that is shown in Tiles.

  1. Add a new Tile to the dashboard by clicking Add/Add tile

  2. Add the following Query into the query textbox:

Measurements
| where StartTimestamp between (_startTime .. _endTime)
| where HierarchicalName has _hierarchicalName
| order by StartTimestamp asc
| limit 5000

Notice the use of the parameters _startTime, _endTime and _hierarchicalName in the query, to narrow down the search.

Using parameters to filter what data to load

The Query will load all Measurements from the Measurements table that has a StartTimestamp in the selecteed Time range and has the selected Tag name (HierarchicalName), it then orders the Measurements by StartTimestamp and then limits the query to only load 5000 data points.

For more details on Parameters please see Microsoft Dooumentation and the Azure Data Explorer Parameters.

Visualize filtered data in a Tile

  1. You can add visualization by clicking the Add visual button. Give the Tile a name.

  2. Select the Line chart in the Visual type dropdown.

  3. Make sure you select the Value of the measurements for the Y column (y-axis), and the StartTimestamp as the X columns (x-axis).

Visualize the filtered values for the selected Tag

If you have configured it correctly you should see a visualization similar to the above screenshot.

The Visualization Type (Line chart) is only suitable for Measurements of Type Analog or Digital, since the Value type is a Real.

For String measurements you can use a Table to visualize the data.

Having configured the Visual you can click the Apply changes then click Save to save the changes of the dashboard.

Dashboard using parameters

On the dashboard page - try and select different Time range and different Tag names, and watch how the Tile automatically fetches the filtered data and visualizes it.

For more details on customizing visuals, please see Microsoft Dooumentation Azure Data Explorer Customize dashboard visuals.

Last updated

Was this helpful?