Dynamic Filtering

You are here:
Estimated reading time: 4 min

Let’s consider the situation, where you store all the data in one data source for different users. And you want to split it up in a such way that every user could see in the dashboard only customized for them data and nothing more. For example, users could belong to different departments or regions and you want to display for each user or a group of users only data of their department or region. For this purpose, the Slemma team created a Dynamic Filtering option.

What is the use of this option?

You don’t need to create multiple datasets and dashboards and manually filter data for every user or a group of users. All this can be done automatically in a single dashboard, just by setting up the Dynamic Filtering option.

Dynamic Filtering could also be helpful when using the Embedding feature.

What type of data sources is this option available for?

  • Local files
  • Files by URL
  • Cloud storage
  • Databases
  • Cloud services (except NewRelic)

What do I need in order to activate the Dynamic Filtering option?

  1. Add a custom attribute
  2. Specify custom attributes for each user/group
  3. Pair a field in a dataset with the custom attribute
  4. Create dashboards based on the paired dataset
  5. Share dashboards with users
  6. Share paired data sources
Let’s imagine the following: we have a dataset containing sales data by regions, and we want that our sales managers could view only data of their region.

Adding custom attributes

If you are a Team administrator, you are able to create custom attributes through the Admin page or using Slemma’s API.

Adding custom attributes through the Admin page

Head over to the Admin page > Custom attributes. To add a new custom attribute, click the plus button at the bottom right, type in a name of a new attribute and click OK.

For our example, we’ll add the attribute with name Region.

Adding Custom Attributes via API

The API currently supports creation, updating and deleting Team Attributes. Please head over to this article for more details.

Specifying custom attributes for users

When a custom attribute is created, you should specify the corresponding values for that attribute for users or groups. You can do that through the Admin page or using Slemma’s API.

Specifying custom attributes through the Admin tab

Head over to the Admin page > Team members/Clients. To specify a custom attribute for an existing user, click the three-dots button in the row with the user’s name and select the Custom attributes option.

NOTE: If there are no custom attributes created, this option won’t be available.

Type in the desired value for each attribute and click OK.

NOTE: Custom attributes specified for groups have a higher priority than custom attributes specified for individual users.

Let’s say Mary is responsible for sales in East region and we want her to view data only for that region. Thus, we choose her from the list of Team members and type in the “East” value for the “Region” attribute.

Specifying custom attributes via API

Head over to this article for more info on specifying custom attribute values for new users via API.

Head over to this article for more info on specifying custom attribute values for existing users via API.

Pairing a field in a dataset with the custom attribute

When you create and specify custom attributes for your clients, you should pair the corresponding fields in a dataset with these custom attributes. This step will enable you to activate dynamic filtering of data after the dashboard is shared.

First, open the Dataset editor. Find the field you want to pair with the custom attribute and click it to display the Field settings dialog box. From the Custom attribute dropdown, select the appropriate attribute. The Email and Group name attributes are always available for pairing, regardless of whether you have added custom attributes previously or not.

NOTE: You are able to pair with attributes only String type fields.

We open our sales dataset, find the field with region names and pair it with the “Region” custom attribute (for convenience, we used the same name for the attribute and for the dataset field). Once the custom attribute is specified for the field, the  icon appears on the Fields tab in the row with the appropriate field name.

For online services which don’t create datasets in Slemma (Google Analytics, Google AdWords, MixPanel), you can specify custom attributes by right clicking the integration and choosing the Custom attributes option.

Creating dashboards based on the paired datasets

Use your paired dataset to create charts as usual. Head over to this article to learn more about chart creation. When creating a chart, you may not set filter by this paired field as it will be applied automatically depending on the user viewing this report.

NOTE: Team Owners and Team Administrators will see all the data if the attribute value is empty. This means that if you pair by email, these users will only see what is associated with their email because email is never empty. You can enter an attribute value for a custom attribute for these roles to test the view of any user.

This is an example of chart without specified attribute values:

Sharing dashboards with users

After a dashboard based on the paired dataset is created, you can share it with your users by setting the appropriate permissions. When a user with the specified custom attribute opens the dashboard, Slemma automatically filters data in charts according to that custom attribute value.

In other words, Slemma displays data if the following statement is true: Paired Field Value = Custom Attribute Value.

This is an example of how Mary would see the same chart with the specified custom attribute value (Region = East):

If a user has no matching attributes, then charts will display “No Data”.

Sharing Paired Datasets

You are able to share paired datasets in order to allow your users to create their own charts based on the available for them data only.

When creating a chart, users won’t be able to see this paired dimension. But for the Team administrators the paired dimension will be available as usual.

NOTE: Share datasets with Read Only Access!

Users with the Edit permissions to a paired dataset may remove the pairing and therefore remove the dynamic filtering. If it will happen, dynamic filtering for charts created on this paired dataset will break, and users will be able to see all data in charts as well as the previously-paired field in the dataset.

API

Please follow the links below to learn more about:

Was this article helpful?
Dislike 0
Views: 2856