5 ways to filter data in Tableau CRM

Image
5 ways to filter data in Tableau CRM

Tableau CRM (formerly known as Einstein Analytics) features a powerful AI engine that can turn your data into the predictive insights you need to drive ROI. But sifting through mountains of information to isolate the data you need — and get rid of the data you don’t need — can be a cumbersome task. Fortunately, there are several ways to quickly cut through the noise and filter your data before you feed it into the Tableau CRM engine.In this blog post, I’ll review the five most popular ways to transform data in Tableau CRM: filter transformation, sfdcDigest transformation, global filters, selection-based filter widgets, and filter interactions in bindings. I’ll also sketch out some scenarios to help you understand when and where to add each one.

1. Filter transformation

A filter transformation — available in Tableau CRM Dataflow and New Data Prep recipes — is a great way to filter records from your existing dataset. With this solution, you can define a filter condition that specifies which records to hold onto.Depending on your need, you can filter Salesforce Object records at different levels. To improve Dataflow performance, I recommend applying this filter closest to the point at which records are extracted. In addition, you can use this transformation to filter the records at any point in the Dataflow. (You can use sfdcDigest transformation filters to reduce the number of rows processing in the Dataflow elsewhere.)

Transformation level

Quite often, it’s tricky to know where and how to use this filter — especially when multiple people are using the same Dataflow or Dataset. To provide clarity, let’s go over some specific examples.If you’re looking to filter a stream of data loaded into a dataset, I recommend adding a filter transformation to the Dataflow. (In this situation, complex filters in a sfdcDigest transformation impact global filters.) To reduce the amount of data processing downstream, add a filter transformation as early as possible in the dataflow.

Connection level

To restrict Salesforce records from being loaded into any dataset, add a filter transformation to the connected object. In your sync setting, you can add a filter to the connected Salesforce Object. (Exclude unnecessary or sensitive data from syncing to Tableau CRM with data sync filters.) Filters run on the source object and speed up your data sync by pulling only the data you need into Analytics. Plus, adding a filter to the source object will impact all Dataflows involved.Please note: Salesforce Local Objects filters utilize Condition Expression Syntax (WHERE Clause). In the example below, we applied this filter to the Account Name field to pull the data you need.

Data Sync Filter

2. sfdcDigest transformation

A sfdcDigest transformation can be used to generate a dataset based on Salesforce Objects. This transformation runs a Salesforce Object Query Language (SOQL) query to extract data from a Salesforce Object.To extract only the required data from Salesforce Objects, a filter can be added to sfdcDigest Transformation. Since sfdcDigest transformations extract all records for which the filter is true, filtering at this level will also enhance your dataflow performance. If you configured SfdcDigest Transformation for incremental extraction, the filter only applies to data extracted during the incremental run — Tableau CRM doesn't apply the filter to records that were previously loaded into the dataset. If you add an invalid filter, the dataflow will fail during run time.Please note:  When you add SfdcDigest node advanced filter with Data Sync enabled, that filter is added automatically to the SFDC_LOCAL connection for that object. If you delete a filter from a SfdcDigest transformation, the SFDC_LOCAL connection filter for that connected object won’t change. In this case, you need to manually update the SFDC_LOCAL connection filter. I suggest using the filter transformation node when the data sync is enabled instead of filters on sfdcDigest Node.While sfdcDigest transformations can extract data from Salesforce Big Objects, incremental extract isn’t supported. This means filtering is only possible for primary key fields. For each instance of sfdcDigest, you can use two types of filters — structured and advanced.Structured filter: Can be defined using the JSON syntax. For example, to reduce the number of rows processed in the dataflow, you can use the filter condition in a sfdcDigest transformation. See the syntax below:{“field”:     “<field name>”,“operator”:     “<operator>”,“value”:     “<value>” | “ [ “<value 1>”,  “<value 2>”]”,“isQuoted”:  true | false }You can use the following operators: = , != , > , < ,>= <= , LIKE, IN, NOT IN, INCLUDES & EXCLUDESPlease note: Tableau CRM automatically quotes strings unless you set isQuoted to True, which indicates that the string is already quoted. If Data Sync is enabled, not all data will be brought into Tableau CRM.

Get Opportunities sfdcDigest

Advanced filter: This can be used in the dataflow under SfdcDigest node for more complex filters. Advanced filters are a great way to exclude records that are either irrelevant or not required via SOQL WHERE Clause Expression. If you add an advanced filter to a sfdcDigest transformation, it is automatically added to the SFDC_LOCAL connection for that object. If you delete filters from sfdcDigest transformations, the SFDC_LOCAL connection filter won’t change.Please note: Always enclose OR conditions in parentheses — even if there aren’t any other conditions. For example, to extract closed won or lost opportunities, use this advanced filter:

  • (StageName = 'Closed Won' OR StageName = 'Closed Lost')
  • (StageName = ‘Closed Won’ OR Amount > 500000)

Data Sync Filter

Adding a complex filter condition in SfdcDiget node:

Complex Filter Conditions

Output:

sfdcDigest Filter Output

3. Global filters

Dashboard Global Filters

A global filter can be leveraged to tackle multiple queries on the same dashboard. To improve your dashboard performance, I recommend using a global filter instead of a selection-based filter.If multiple datasets are linked using a data source connection, only one of the common fields used in the connection can be included in a global filter. Multiple common fields can generate conflicting filters, which eventually leads to filters that don’t work properly.To apply global filters to a widget, select Apply global filters in the widget’s query properties. As a default, Tableau CRM applies global filters to all widgets that have queries based on the same dataset or connected data sources.Global filters also have “Locked” and “Dependent” features, which can prevent users from changing the global filter. They can also limit the selection of global filter picklist value based on selections in other global filters.Please note: Deleting the global filter panel won’t delete the filters themselves. (You can manually delete global filters from the global filter property panel.)

Pick Initial Values

Set initial global filters” gives users a refined view of the dashboard with initial values selected from multiple global filters. When the dashboard first opens, the initial filter is immediately applied. This allows you to omit the step of making multiple selections to drill down to the required dashboard view. (Especially if there are many global filters to choose from.)The initial global filters are applicable to the unlocked global filters and apply to all the queries in the dashboard unless they’re configured to ignore the filters.

4. Selection-based filter widgets

Initial Selections

A selection-based filter can be used for different types of widgets based on measures, dates, and dimension fields. Making selections in one widget filters the results of other faceted widgets and can be based on charts, dates, list, range, or toggle. Overall, it’s an easy-to-use filter that lets you slice and dice your data. (Although it can be a bit problematic if the underlying query for the section widget has a SAQL query type and not all results are returned.)You can dynamically set “Initial Section” to show the information that’s relevant to logged-in users through the Dashboard viewer. Filter the “Set Initial Selections” feature based on user ID, role ID, or role name.Selection-based filter widgets can be designed using pill or combo box styling — making it easy for you to mix and match selection-based filters and global filters on the same dashboard. Examples include:

  • Date Widget to Filter Dashboard Results Based on a Date.
  • List Widget to Filter Dashboard Results Based on a Dimension.
  • Range Widget to Filter Dashboard Results Based on a Measure.
  • Toggle Widget to Filter Dashboard Results Based on a Dimension.

5. Filter interactions in bindings

Last but not least, filtering interactions in bindings is a solid option when faceting doesn’t work because the queries on the widgets are based on different datasets. Different types of filters can be created with a SAQL query. There are three type of filters that can be used for different types of interactions: “Filters,” “Range Filters,” and “Date Range Filters.”When should I use each filter?Leveraging the right filter for the right scenario is mission-critical. Otherwise, you could accidentally pull the wrong records for your analysis or filter out something important from the source. (This often happens when the source data is used in different dataflows that have the same connected object.)Now that I’ve reviewed these five filters and gone over common scenarios that illustrate when to use each one, you’re all set to harness the predictive power of Tableau CRM to unlock more ROI from your data. Good luck!Reference links:https://help.salesforce.com/articleView?id=bi_dashboard_widgets_scope_add_flex.htm&type=5 https://help.salesforce.com/articleView?id=bi_integrate_salesforce_extract_transformation_filter_complex.htm&type=5 https://help.salesforce.com/articleView?id=bi_integrate_salesforce_extract_transformation.htm&type=5 https://help.salesforce.com/articleView?id=bi_dashboard_widgets_filter_add_flex.htm&type=5https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dbjson_bindings.htm