Filter 'equal to' for some dashboard tiles and 'not equal to' for others

  • 14 June 2019
  • 2 replies

I’ve had an interesting question from a user. They (ideally) want to use a single dashboard filter for e.g. a client name, and have some tiles filter to include that client and others to exclude it.

I can’t think of a way to do this without doing some funky LookML filters/parameters specifically for this use case - does anyone know a way to achieve this without any LookML changes?

2 replies

Userlevel 5

Hey Simon, would a templated filter work for you?

  1. Create a string-type filter field (client_filter). Use suggestion parameters to provide your users with a list of values to select from (in this case, use your client dimension to give them those options).

  2. Create a yesno-type dimension (client_filter_yesno). This is what will you’ll add as filters for the Looks/Tiles you want to include/exclude the specified clients. To do this in SQL, you’ll need to add a Liquid condition:

    {% condition client_filter %} {% endcondition %}

  3. Any time the yesno gets filtered on with value = yes, it’ll only be the requested clients. Any time it gets filtered on with value = no, it’ll be every other client. Without the filter applied, nothing will change.

For your users, all they need to do is include the filter-only field (where they’ll select what clients to filter on), and add the yesno. They can then select client_filter_yesno = Yes for just the specified client(s), and No for every other client. This shouldn’t be more than a few lines of LookML in total and should bring clarity to your users.

Thanks @bens, that would work nicely I think. I was hoping there might be some trick to do it without LookML as I expect once this was available for one field people would soon want it for others and hadn’t actually thought about an actual LookML implementation but your solution looks quite nice.