Add filters
This article applies to the following Customer Insights roles: Developer
To add a filter to an Explore, locate the dimension you want to filter on and then click Filter. When you do that, the filter is added to the Filters section:
If youโre adding this filter so users can filter your dataset then youโre done: you donโt have to do anything else. (Except maybe add additional filters.) However, you might want to use this filter yourself, you might want to return a subset of the available records. In that case, youโll need to do two more things:
- Specify the filter operator.
- Specify the target filter value.
The filter operator determines the relationship between the filter field and the target filter value. By default, a new filter uses the is equal to operator; that lets you create a filter like, say, โThe event type is equal to signin.traditional.โ Or, for the more visually-inclined:
But what if that isnโt correct? What if you wanted a filter that said, โThe event type is not equal to signin.traditional?โ Thatโs fine; just click the filter list and select a different operator:
For a complete list of filter operators and what they mean, see the article Customer Insights filter reference.
That means that you can easily create a filter that looks like this:
As for the filter value, you can either type in the value (e.g., signin.traditional) or, in some cases, click the filter value field and select from a dropdown list. For example, if youโre working with event types, you can click the filter value field and select from a list of event types:
These (obviously) are the event types available to you. You can type in a different event type, but thereโs not much point in that: it wonโt return any data because you donโt have any records that match that โcustomโ target field value. (If you did have records that matched that value, the value would have shown up in the dropdown list. )
And yes, you can add additional filters to your Explore. For example, here we not only have a filter for event type, but we also have a filter for Month Name and Year Number. That lets us do things like query for all the social sign-in events that occurred in March, 2017:
If you want to get rid of a filter, click the X next to the filter you want to remove. For example, if you click the X next to Event Type, your Filters section will look like this:
In addition to filtering on more than one dimension at a time, you can also filter on more than one filter value. For example, suppose we want information from January 2018 and from March, 2018. To do that, we start by entering our first filter:
When thatโs done, click the + next to this filter. When you do that, a new filter clause is created:
To filter for January and March, just enter March as the second target filter value:
In turn, the only data we get back are event types from either January or March:
Incidentally, we didnโt have to add an additional filter clause to get back this data. (Yes: now we tell you.) Instead, after entering January as the target filter value, we could have clicked in the exact same field and then added March:
That gives us two values in the same field:
When you have two values in the same target filter field, Customer Insights automatically does an OR search: it searches for events from January or from March. In fact, take a peek at the SQL query generated for this Explore:
The WHERE clause says it all:
(date_dim.month_name = 'January' OR ย date_dim.month_name = 'March')
Before you ask, no, thereโs no way to use a filter to limit the data returned by a Look but not make that filter available to users. For example, suppose you create a Look and you include a filter similar to the one shown above. When a user accesses this Look, he or she will also have access to the filter:
You might have preferred that the user not be able to access the filter, but thereโs no way to hide filters from users.
Or at least not if the user directly access the Look. If the Look is on a Dashboard, however, any filters attached to the Look will not be available to users. To prevent users from filtering data, create a Query Tile and add it to a Dashboard instead of a creating a Look and adding that to a Dashboard.
On the flip side, you can add โemptyโ filters that you, as the Look creator, didnโt use, but that you provide as a service to others. For example, suppose you include Country as one of the fields in your dataset. You might not filter on Country at all. However, you can still include an empty Country filter in your Look:
Using the is equal to operator and not specifying a filter value means, in this case, โShow me all the users, regardless of country.โ
When a user views this Look, he or she can use the filter to explore the data in different ways. For example, suppose the user in question is only interested in Canadian residents. In that case, he or she only has to set the filter to Canada:
Updated over 2 years ago