How do I pre-populate a dashboard filter with user_attribute['email'], but using ‘contains’ logic?

We have a dimension in a model that reflects an employee’s management chain, all the way to the CEO. 

  • ceo@company.com/vp@company.com/director@company.com/sr.mgr@company.com/manager@company.com/employee@company.com

We also have a user attribute (user_attribute[‘email’]) value, which would mach to an email in the chain above.

The screenshot below is the exact way in which we want to filter the dashboard. But, we’d like it to default to the user_attribute[‘email’] value while still retaining the contains() syntax.

4fd0079b-cd1d-483e-ade1-b18edbfc8e55.png

I’ve tried using the matches (advanced) filter - it doesn’t appear to accept % as a wildcard to mimic the contains() logic.  The filter just shows the Liquid Variable logic as a string.

436c0501-91c8-425e-92a3-1d5525dd00db.png
db82cf39-ea6c-4d12-ab73-5ee9d46a4e61.png
560132cf-8917-4556-8fb3-a11b9de40ba7.png

Has anyone solved for this? 

Solved Solved
0 3 1,015
1 ACCEPTED SOLUTION

I have not seen a direct solution to this (although advanced string user_attributes support wildcards, I don’t think that’s an applicable solution). I have seen the use of additional dimensions used as Yes/No filters to accomplish this though. My colleague @ashley_4mile wrote up a use-case example of a similar scenario here, under the “Default dashboard filter settings based on user attributes” section.

Essentially your dimension would do the work of establishing whether the filtered field contains the user attribute value, and your dashboard filter would be exposed to the user as a simple checkbox.

View solution in original post

3 REPLIES 3

I have not seen a direct solution to this (although advanced string user_attributes support wildcards, I don’t think that’s an applicable solution). I have seen the use of additional dimensions used as Yes/No filters to accomplish this though. My colleague @ashley_4mile wrote up a use-case example of a similar scenario here, under the “Default dashboard filter settings based on user attributes” section.

Essentially your dimension would do the work of establishing whether the filtered field contains the user attribute value, and your dashboard filter would be exposed to the user as a simple checkbox.

Your colleagues solution is so close to what I am trying to achieve, and I have implemented their solution as a temporary work-around.

I may just move the dashboard into Tableau, where I can achieve the expected result using two quick Calculated fields.

Thank you @dbrinegar for the quick response! 

I keep finding the same answer. Can't do it in Looker but a tool like Tableau can

Top Labels in this Space