Filtering is a way to control the end results of your query. All the fields available in a data source can be used as a filter. A filter is built by choosing the field to filter by, choosing the logical operator, and then entering a value to filter by.
- Open a report in Data Studio, and click any report element created with Supermetrics.
- In the side panel, scroll down to Filters.
- Click +ADD A FILTER to create a new filter.
You can add, edit, or remove filters at any time by navigating to Resources in Data Studio’s top menu, and then clicking Manage filters.
Building a filter
Once you’ve created an empty filter, you’re ready to define its elements.
First, give a descriptive and unique name to the filter, so you can easily use it in other elements in the same report.
Next, choose the filter functionality — either “Exclude” or “Include”. Inclusive filters look for results matching your values and include them in the results, while exclusive filters do the opposite, looking for results that match your values and dropping them out of the results.
Finally, choose the field to filter by). Select your Condition and finalize the filter by adding the value (or several values, for some filters). Once you are happy with your filter, click SAVE.
Adding multiple filters to a single query
You can add multiple filters to a single query. To do this, simply choose either “AND” or “OR” join. This will open the new filter entry fields, and also decide how your two filters will work.
If you choose “AND”, then your results must match both filters in order to be shown/discarded. If you choose “OR”, then results that match either one of your filters will be shown/discarded.
If your filter values contain commas, they will not be read correctly. Each comma in the value field will be read as a stop for previous value and start for next. For example, a campaign name “My First Campaign, Winter and Fall” will be read as two values for the filter - My “First Campaign” and “Winter and Fall”.
Use this reference list to learn more about each condition available in Data Studio’s filters.
If your filter runs into a "No data" error, or is producing wrong results, the first step is to double-check the filter’s setup.
A good way to troubleshoot your filter is to make sure the field used in your filter is selected also in the query as a metric or a dimension. Remove the filter, run the query and see if the results for that field would be caught by your filter or not.
A missing or extra whitespace at the beginning or end of a line can cause errors. Check your string for extra or missing whitespace.
When using regular expression filtering, letter case can cause issues. Check that the letter case in your filter matches the letter case in the results you’re filtering (for example, if you’re trying to match "Awareness", and filtering "awareness" isn’t working, try "Awareness" instead).
Double check your selected fields to make sure they’re the right ones for your query.
Sometimes, old reports can have filters for fields that are no longer supported. Check our documentation for an up-to-date list of supported fields.