11

Filter a Tableau Dashboard using Salesforce 

 8 months ago
source link: https://datavis.blog/2023/12/31/filter-a-tableau-dashboard-using-salesforce/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

In my previous post I walked through how to embed a Tableau dashboard in Salesforce. In this post we’ll explore the options to filter the embedded dashboard using the Salesforce interface, for example, by selecting a different Account to view.

If you don’t already have a Tableau dashboard embedded in your Salesforce page, follow this blog post and get to the Edit Page section. Below the URL for the Tableau view field are the filter options that we explore below.

Filter on Record Id

This is the simplest filtering option and is enabled by simply checking a box:

02-filter-on-record-id.webp?w=357

The only requirement is that the corresponding Record Id (for example Account Id or Opportunity Id) for the object you are selecting in Salesforce is present in the data source used for your dashboard.

Below is the Edit Page view before the Filter on Record Id option is checked. Note that the visualisation contains a separate row for each Salesforce Account, i.e. no filtering is in place.

01-no-sf-filter.webp?w=1507

Below is the view with the Filter on Record Id option checked. Now, only the Account that has been selected in Salesforce is showing in the Tableau view:

03-tableau-dashboard-filtered-by-salesforce-selection.webp?w=1507

After saving and activating the page you will be able to search for and select different Salesforce Accounts using the Salesforce interface and the Tableau view will update to match your selection. Scroll through the below images as an example.

  • 05-united-oil-selected.webp?w=736
  • 04-edge-selected.webp?w=736
  • 04b-select-new-account.webp?w=736
  • 05-united-oil-selected.webp?w=736
  • 04-edge-selected.webp?w=736

Tableau Advanced Filter

The second option allows us to specify a field or parameter from the data source that is used in the Tableau view and then select a field from the Salesforce data that the Tableau field should match.

First, as a simple example, I’ll create a tableau parameter from the Account Name field and call this Account_Parameter:

07-account-parameter-setup.webp?w=569

Then I’ll create a calculation that will return True or False and add this to the view, filtered to True only. This filter will ensure only the selected Account shows in the view.

08-filter-calc.webp?w=577

With the parameter added to the view, I’ll publish the updated view and uncheck the Filter on Record Id option. The selected Account in the Tableau view now doesn’t match the selected Account in Salesforce because the parameter is set to Edge Communications and United Oil & Gad Corp. is selected in Salesforce:

09-accounts-dont-match.webp?w=1321

To resolve this we update the Advanced Filter options as follows:

  • Add the parameter name (Account_Parameter) into the Tableau Advanced Filter text box
  • Select the Account Name field from the Salesforce Advanced Filter drop down (all available Salesforce fields will be shown, as below)
11-salesforce-advanced-filter-drop-down.webp?w=317

Now, when a different Account is selected in the Salesforce interface, that value is passed to the Account_Parameter in Tableau and the view filters to match the same Account:

10-parameter-filter-account.webp?w=1314

The below recording shows the parameter, and Tableau view that is filtered by it, updating based on an Account selection in Salesforce:

filer-with-parameter.gif?w=903

Summary

These filtering options make it quick and easy to embed your Tableau views into Salesforce and ensure they sync with the Salesforce user interface, removing the need to filter twice. In the simple example above there were only a few Accounts to choose from but with an org containing many thousands of Accounts, being able to use the Salesforce interface to search is a major advantage and a much better user experience.

Be notified of new content…

If you find these Tableau tips and tutorials useful, you can follow me on LinkedIn for all the latest content.

Thanks,
Marc

Pass filter values (such as an Account or Opportunity) from Salesforce to your embedded Tableau dashboards.

Click here to learn more…

salesforce-to-tableau-filtering-1.jpg?w=1078

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK