How to display a filter value

Knowledge Drop

Last tested: Jun 17, 2020
 

The Request

We want to display what value(s) a user chose in a filter field, either a field of type filter, or an explore field that is being filtered.

A Solution

Use liquid in the html with _filters !

The liquid for the _filters['view_name.field_name'] can't be used in sql but it can be used in html
 

Here is a working example!


dimension: show_my_dimension_filter {

html: {% if _filters['category'] IS NOT "NULL" %} {{_filters['category']}}

{% else %} no filter value {% endif %};;

sql: 'this does nothing' ;;

}

To link the dashboard filter, link it to the field category

This content is subject to limited support.                

Comments
faiz
Explorer

Hi,

Can the solution above (using html and liquid _filter) work if you want to export the output to csv or excel ?

I tried the solution it shows the filter values on Looks or Explore in Looker. However, when I export the column shows ‘ this does nothing'
Thanks,

Version history
Last update:
‎06-14-2021 06:16 PM
Updated by: