Knowledge Drop

Can I use whitespace in filters?

Userlevel 3

Last tested: Mar 3, 2020

Starting in 7.4, YES!

Say you have this table with a combination of leading and trailing spaces:

Screen Shot 2020-03-03 at 9.19.58 AM.png

In the past, Looker would trim all trailing and leading spaces from filter values, even if those spaces carried meaning for the customer's dataset. Now, you can include whitespaces in filter values without Looker trimming them!

Here are some examples:

Screen Shot 2020-03-03 at 9.10.31 AM.png
Screen Shot 2020-03-03 at 9.09.41 AM.png
Screen Shot 2020-03-03 at 9.33.41 AM.png

Matches advanced works too! The important thing to remember is the ^ character is needed to escape the whitespace character(s), like:

Screen Shot 2020-03-03 at 9.35.10 AM.png
Screen Shot 2020-03-03 at 9.35.46 AM.png

Please NOTE: With great power comes great responsibility. Since Looker no longer trims trailing and leading whitespaces, it's possible to get unexpected results if you accidentally include a whitespace in your filter value.


This content is subject to limited support.                



0 replies

Be the first to reply!