After you have created your insightboard parameters (here you can learn how), the next step is to include them in an insight. Navigate to Insights -> Insightboard and open the insightboard which contains the insight/s you would like to add a filter to (if you do not know how to create an insight, have a look at this article). From the three dotted selector on top choose Re-arrange (or simply press E on your keyboard) and edit the insight from the middle button (</>)

Once you are in the insight editor, add an insightboard parameter by introducing WHERE clause. Assume the name of our parameter is param_name. The syntax for getting the filter’s value is %%param_name%%’. In the examples below for entity field it will be used field_name, but you can input an entity field that suits you filter. Below you can see the syntax for the most common filter types:

  • Free text field – creates an input field in the filter and you need to manually type in your filter value

Syntax:

CASE WHEN '%%param_name%%' <> ''
  THEN field_name like '%%param_name%%'
  ELSE false END


In this case if nothing is selected, no values will be displayed. You can change the behavior by changing the condition after ELSE - set it to true (then all values will be displayed), specific value or another condition. This is the case for all the following syntaxes, so keep it in mind when applying the rest of the snippets. 

  • Date picker – allows you to filter your information for a specific date 

Syntax:

AND CASE WHEN '%%param_name%%' <> ''
  THEN field_name = '%%param_name%%' ELSE false END
  • Date-range picker – allows you to select a custom time period

Syntax:

AND CASE WHEN '%%param_name%%' <> ''
  THEN field_name @@ '%%param_name%%' ELSE false END
  • List – allows you to select only one value from this filter

Syntax:

CASE WHEN '%%param_name%%' <> '' 
  THEN field_name = '%%param_name%%'
  ELSE true END
  • Multi-select dropdown – allows you to select multiple values from a list

Syntax:

CASE WHEN '%%param_name%%' <> ''
    THEN (field_name in (SELECT(UNNEST(string_to_array('%%param_name%%', ',')))))
    ELSE true
    END


Once you have added the filter in your SQL, you can Execute to check if your syntax is correct. If you do not see any errors, then you can press Save and leave. You are ready to filter!

If your filter does not have predefined display value, you will see “None selected” under your parameter title. When you open the filter and select a value, it will show you the desired results, but it will not save your preferences automatically. Therefore, if you would like to see the information with those selected filters the next time you open this insightboard, press Save filters before leaving the board or refreshing it. 

Only filters added in any of the Insights within the Insightboard are shown on the top. Respectively, when filtering a certain criterion, only the insights containing that filter will be updated. Users without Update permissions for the Insightboard cannot change the filters value.

Did this answer your question?