Filters and Parameters – the differences and how to use them


Differences Between Filters and Parameters

There are two principles that control the data to include and exclude, and show or hide in a Panopticon dashboard: Filters and Parameters. The reason we have both is that Panopticon Real Time is for in-memory visualization and analysis. Thanks to working in-memory, users of Panopticon Real Time dashboards can freely filter, slice-and-dice and roll-up the data instantly. Filters work on the data in-memory. Parameters come into effect in the data connection stage, controlling what data is loaded into memory in the first place.

Most other software products that provide dashboards and data visualization will use the term “Filter” when talking about the same kind of job done with Parameters when you use Panopticon Real Time.

Filters

Filters are applied to the data client-side, in your browser. Filters are used for temporarily excluding (hiding) some of the data. Filters are applied instantly and involves no data communication with your data source: Everything happens in the browser. Applying a filter will not reduce the data volume you have loaded from the data source. There are filters for numeric values, for text values and datetime values. Filters can be applied by pulling a slider, selecting values in a list or by manually typing a value. You can also right-click an item in a visualization and select include or exclude. All filters applied to a dashboard can easily be reset by a single click on the filter indication icon.

To add filter controls to a dashboard, you start by adding a Filter Box dashboard part. Filter controls are added by drag-dropping data columns to the filter box. A type of filter control will be automatically selected, for example numeric filter slider or multiselect list. You can change this, and make other settings.

Filters are applied to all data tables in use on the same dashboard. Each data table that has a column by the same column name as the column used for filtering, will get filtered. You can configure individual visualizations to be excluded from all filtering by setting Options > Sync > Row Filtering to OFF.

 Step 1: Select Filter Box on the Controls tab

Step 2: Drag columns into the settings panel area of the Filter Box. Make any settings changes as needed.

Step 3: Apply filters

 

Parameters

Parameters are applied to the data server-side, in the data connection. A parameter belongs to a data table. Parameters are used for providing conditions for how data will be selected from the data source. For example, a parameter can hold a value that should be matched when selecting data from a database. The reason for using parameters is that the users of the dashboard will be able to change the value of the parameter, and thereby control how data is loaded from the data source. Parameters have a data type: Numeric, Text, Time. Parameter values are set and changed with Action Control dashboard parts, or by right-clicking in a visualization and selecting any available parameter or action.

To add a parameter to a data table, you define (create) the parameter in the data table settings. You can give the parameter almost any name (except the names used by Special Server Parameters). A recommended best practice is to give your parameter names a prefix, like for example “p_”. This will serve as a reminder that this is a name of a Panopticon parameter. You set the parameter data type and a default value.

To insert the value of the parameter into the settings of a data connector, you reference the parameter within curly brackets, for example like this: {p_myparam}
In addition, numeric parameters and time parameters can be specified with a format string, by appending a colon sign and a format string immediately after the parameter name.

Example for a numeric parameter: {p_mynum:#0.000}

Example for a time parameter: {p_mytime:HH:mm:ss}

The easiest way to demonstrate how a parameter will get translated into the current value of the parameter, is to use the Text Connector and set Text File Source to “Text”, which means that you type or copy-paste data directly into the connector settings. Here, you can enter a column name, and a reference to your parameter on the next line. After pressing Generate Columns and then Refresh Preview, you will see a column called “MyColumn”, containing a single data row with the value of your parameter.

However, the true value of using parameters is in achieving dynamic, user-controlled data loading criteria. For example, in a database connection with a SQL query, you can let a WHERE clause include a parameter reference, like this:

SELECT Revenue, Volume, Product FROM SalesTable WHERE SalesRegion = ‘{p_salesregion}’

Instead of loading all data at once, we load and display data for one sales channel at a time. This can be a necessary solution when all of the data would be too much to fit in memory or too much to meaningfully display in the dashboard.

So how can the dashboard user then set the sales channel for which he/she wants to load data? The simplest way would be to create a small data table that contains all existing sales channel names in a single column and use that column to provide values for an Action Dropdown Control on the dashboard. However, a better dashboard design would be to apply the concept of Overview + Details:

As a separate data table, which does NOT use any parameter, you would load data for all of the sales channels, but in a rolled-up (aggregated) format, that reduces the data volume and reduces the level of detail in the data:

SELECT SUM(Revenue), SUM(Volume), SalesChannel FROM SalesTable GROUP BY SalesChannel

Using this rolled-up data table, you create an Overview visualization on the dashboard, from which the user can view total revenue and total volume per sales channel, and then pick any sales channel and set the value of the parameter p_saleschannel. As a reaction to the changed parameter value, the data table that uses the parameter will re-load new data from the database, bringing product-level detailed data for the selected sales channel.

With this approach of Overview + Detail with parameterized data connections, you offload the client side and push back some of the aggregation work to the database. This principle can be applied in several steps and use any number of parameters. It can allow the dashboard users to browse much, much larger data volumes than you could fit into a single, non-dynamic data connection.

Step 1: The dashboard loads with a default value of "West" set on the parameter that controls which Sales Region is loaded in the detailed data table

Step 2: A Navigation Action has been configured and is available on right-click in the ovewview visualization, whereby a new value is set on the parameter controlling Sales Region 

 

Step 3: The parameter value change triggered a data re-load and we are now seeing data for Sales Region Midlands.