Overview
Filters on Explores, Looks, and dashboards can be set to user attributes, to parameterize a query based on the user running it.
For example, you could create a user attribute called “Salesforce Username” and configure each Looker user, so their value for it is their Salesforce username (see the User Attributes documentation page for information about setting up user attributes). Then, you could set a filter on a dashboard to the "Salesforce Username" user attribute, and each user would see that dashboard filtered for their particular Salesforce username.
Configuration
Select the matches a user attribute option on the desired filter.
The select box to the right will automatically update with a list of user attributes which are applicable (based on the type of the filter's field and the type of the user attribute); your own value for each user attribute will be shown in parentheses. Then, select the desired user attribute:
To set the default value of a dashboard filter to a user attribute, choose Add/Edit Dashboard Filters from the dashboard's gear menu in the upper right. If you are on a version earlier than Looker 4.8, you will need to use the advanced filter syntax to set the default filter value to a user attribute—see below for details.
Advanced Filter Syntax
If you'd like to do something more complex than a equality check for the filter, you can select matches (advanced) instead of equals a user attribute and reference a user attribute via Liquid-style substitution:
{{ _user_attributes['name_of_attribute'] }}
For example, suppose you need to apply a sf_ prefix
to the value of the "Salesforce Username" user attribute, because that is how the values are stored in your database. You could do the following: