Close this search box.
Leverage CRM Analytics Parameters to Filter Tableau Views

Leverage CRM Analytics Parameters to Filter Tableau Views

Several months ago, Salesforce released the “Publish to Salesforce” capability on Tableau. This allowed users to publish their Tableau dashboards or views to Salesforce CRM Analytics (CRMA) for use in a component object.

Publishing to Salesforce made it very helpful for consumers of CRMA and Tableau to be able to access analytics in one place. Users who needed live data or preferred certain charts in CRMA — but already had their necessary dashboards in Tableau — could now have access to both in the same spot. However, the drawback was that CRMA views and Tableau components would not interact with each other.

In a recent update, Salesforce addressed this issue with parameters in CRMA. Using these parameters, users can now facet CRMA views to Tableau components. This article will walk through the process of creating CRMA parameters and call out some important considerations along the way.

Creating parameters

The process of creating the parameters is straightforward but requires some preparation. Let’s walk through the steps:

1. Ensure that the Tableau Admin and Salesforce Admin have coordinated to set up integration between the platforms. Once they have agreed to enable this, the Tableau Admin should go to Site Settings > Integrations > Publish to Salesforce and check the “Let users publish views to Salesforce” checkbox.

2. Set up a connection to the Salesforce Org by navigating to My Account Settings on Tableau > Saved Credentials for Data Sources > Salesforce > Add. Sign in to the org you will publish to.

3. Create your data source. To use the parameters, you will need fields with matching values between the CRMA Output and Tableau. Because we are analyzing opportunity data, we used the same output as the CRMA recipe to be able to maintain data consistency. If you had a different set of data outside Salesforce that could still be mapped by Owner Name (perhaps quotas), you could use that data source. We have an Opportunity data source showing the current status of opportunities and the relevant information associated with each opportunity.

4. Create a Tableau view or dashboard. When you publish to Salesforce in step 5, you can publish either individual sheets or entire dashboards. In our example, we will have a map and table on a Tableau dashboard.

5. Once you have published your workbook to Tableau, you will have the option to Publish to Salesforce on each of your workbook pages. Select the three dots next to the sheet(s) or dashboard(s) you want to publish to CRMA and the app you want them to publish to.

6. Now, navigate to your CRMA org. You should see the Tableau items as components in the app you published to.

7. Next, we will create a new dashboard on CRMA. Our data source will be the same data source we connected to for Tableau, using our CRMA Recipe Output. One of our favorite charts that CRMA natively contains (and Tableau does not) is the origami chart to show progress through stages. You will see our origami chart below as part of our CRMA dashboard.

8. Next, we will add our Tableau component. To do so, add a component widget to our CRMA dashboard. When you click to select the component, you will notice a “Tableau Dashboards” tab. Select this and locate the dashboard published in step 5.

9. We can now add our parameters in CRMA. Click on the Tableau component. At the top left of the edit screen, you will see a “Parameters” section. Click the Parameters tab and the “Add Parameter” button. The following screen will appear:

10. Right now, the only parameter type you can choose is “filter.” The Filter Field is the field you want filtered in Tableau. The stage field on Tableau is called “Stage.”

11. Give the parameter a relevant name, such as “Stage Filter.”

12. Select the value type as either “Static” or “Dynamic.” (Dynamic means the filtered value can change based on the field selected in the New Value section. Static would entail typing in a specific value such as “2 – Needs Analysis” for Stage or “Northwest” for Region.)

13. In the Data Source section, select the lens you are interested in using as your filtering view. In this case, it would be our origami chart.

14. Select a value from the New Value dropdown, which will populate with the fields used in the lens you selected above. In this case, we want the new value to be the stage.

15. Select an Interaction Type: Result or Selection. Interaction Type represents how you want the parameter to be passed. To understand “Result”, think about your chart as a table. Result will pass the parameter the whole column you select and will not react to selections on that table. This type of parameter will, however, update if a selection on another chart, filter, or input affects the results of that table. “Selection” will bring in all of the Tableau values and filter down based on the selection(s) you make. “Include all values” will allow multiple selections on the CRMA chart to be passed as filters. (Example: You could select Needs Analysis and Value Proposition on the Origami chart to show both stages in Tableau.)

16. Click Save and your parameter will be ready to use when viewing your dashboard!

Beware of these “gotchas”

Setting up a parameter on a chart was not too difficult. There are, however, a few “gotchas” and considerations to be aware of when setting up parameters for more complex dashboards listed below.

Tableau selections don’t impact CRMA. The parameter actions only work on CRMA selections impacting Tableau. You cannot currently filter or facet CRMA based on selections made in Tableau.

Consistent field values between CRMA and Tableau. CRMA and Tableau field values need to be consistent between the two sources. For example, if you were going to filter based on Owner Names and CRMA contained Owner Names “R. Dunn” and “B. Pryor” while Tableau contained “Randy Dunn” and “Beth Pryor,” the filter would not work because those values are not the same. You may have noticed our stages above appear to not match. Tableau contains numbers on the stages, while CRMA does not. The stages actually do match in the initial data source but were aliased in CRMA to not have stage numbers. This means the parameters pass the actual data source values rather than just the aliased values.

Updates to the Tableau Dashboard. The Tableau component refreshes almost instantly once you publish changes. In creating the resources used in this whitepaper, we noticed that published changes would appear in CRMA as soon as we reloaded the CRMA tab.

Parameters on Calculated Fields. One of the limitations with parameters as they currently exist is that you can’t use Calculated Fields created in Tableau. Any calculated fields made in Tableau or in Tableau’s data source will not appear in the “Filter Field” dropdown box. If you want to filter on a field that is not part of the data source, you have to add the field to the source of the data source instead of just adding it to Tableau.

Setting up the Tableau component. Setting up the Tableau component required some adjustments and tweaking. CRMA auto-scales its dashboards to the user’s screen up to an optional maximum width set by the developer. If this optional maximum is left untouched, the dashboard expands to fit any window size. Tableau, however, gives developers the ability to choose between fixed-size dashboards and automatically-sized dashboards. The typical setting is for Tableau dashboards to be fixed size for several reasons (performance, exporting to PowerPoint, etc.). However, these fixed size dashboards don’t visualize well when used as a CRMA component because as CRMA changes size, Tableau will stick to its fixed limits. Additionally, the only size adjustments that can be made on Tableau components in CRMA is height. This setting lives in the Component Attributes section and can be set via auto, pixel size, or percentage.

Ultimately, we found that setting the Tableau dashboard to Auto and the height of the component to the appropriate pixels needed (using trial and error) was the best way to set up the Tableau dashboard.

Tableau filter settings impact the CRMA parameter actions. If there is an existing filter in Tableau that matches the field selected as the Filter Field in CRMA, the parameter will use that filter instead of a new filter. For example, if your Tableau dashboard had a stage filter excluding Closed Lost opportunities, the stage parameter would update that exclude filter instead of filtering on a new stage filter. When you select the Needs Analysis stage, it would be excluded and Closed Lost would then be included. The way to get around this is to duplicate the stage field in Tableau and use that as the exclude filter instead of the original stage field.

Parameters can be set to Fields that don’t apply to Tableau Sheets. Interestingly, the stage parameter filtered the map sheet even though stage was not included in the sheet in any way. Stage was not added to the detail, tooltip, or even the filter pane, and the filter still applied between CRMA and Tableau.

Faceting and filtering with multiple charts limitations & solution. Our example above only used one CRMA lens. The reason is that using any combination of multiple filters — static or dynamic — requires a slightly different approach for two reasons:

  1. Parameter filters will not work if the CRMA charts facet together. Faceting between two CRMA charts will break the parameters set to affect the Tableau component.
  2. Only one parameter action will be applied at a time. Only the final selection you make will be applied as a filter to the Tableau component. For example, selecting a rep filters the Tableau Component to just their data. Then selecting a stage will reset the rep filter but apply the stage filter. This also applies to Static parameters. As soon as we make a selection on either CRMA chart, the static parameter will be reset to show all.

There are two downsides to this:

  • If you want to use a single Tableau dashboard across multiple areas and want to use a static filter along with other charts, you must either create that filter functionality in Tableau or create multiple Tableau dashboards with the filters already applied.
  • CRMA dashboards with lots of lenses will not be able to have multiple filters applied to the Tableau component.

Our solution to these limitations

  1. On the Tableau side, you must add a field to the data supporting the dashboard. The field should contain all of the different metrics you want to use for filtering concatenated together; you can use delimiters or just append the fields directly. In our case, we appended the Owner Name and Stage separated by a dash. As mentioned above, since the parameter options in CRMA pull directly from the data source, the field needs to be added to the data directly and not as a calculated field on the Tableau dashboard.
  2. In CRMA, we need to create a hidden step that creates our concatenated field for us. This step will be used as a results parameter for the Tableau component, and its output will be a full list of all combinations of the two fields that exist within our selections.

There are a couple of reasons for using a hidden step:

    • We can set the top charts to facet one another. Removing the ability for these charts to facet one another creates a chance for a user to select a combination that doesn’t exist and for the Tableau component chart to show as null for that selection. Since the parameter is no longer directly connected to these charts, the faceting does not break the parameter.
    • The original charts can now remain Aggflex queries rather than SAQL. This can allow users to explore the queries without needing to know SAQL.
    • All charts that we would want to connect to our Tableau component can be brought together in one place (otherwise, we would need to write the concatenation of fields on each chart and it could get complex very quickly).
    • We could include any static type filtering we want to use on this query (but it would require another field in our data). Since this is a total list of values we want to include in the Tableau dashboard, it is easy to filter out combinations we don’t want to include.
    • Our hidden step consists of creating a stream for each chart we would like to use as a filter. Each stream gets a unique equality filter binding to the chart it is referencing. As a reminder, equality bindings allow us to filter by “all” when nothing is selected in the chart. So for our example, q1 is filtered by the selected owner names, and q2 is filtered by the selected stages. Then we create an inner cogroup of our streams by all fields we are using for filtering. This ensures that only the selected owners and stage names are included in the total results. Finally, we project the fields concatenated in the same way we concatenated them on the Tableau side.

3. The final piece for the CRMA components is to create a field that will start the hidden step when the page loads. Normally, hidden steps get connected to queries on the dashboard and are thus automatically started when those queries run. For some reason, parameters do not have this same functionality, so we need to connect the step to the dashboard in another way. Our solution was to create a blank field on our hidden step called hold. We then tied the query with the hold field to the title of the dashboard so no additional space was taken up.

4. Finally, we have to attach the query to our dashboard via a parameter the same way we did before! Make sure that when you connect your hidden step as a parameter you choose the “Results” type. Our hidden step is sending the Tableau component a list of Owner Name – Stage values that should be included but we cannot make selections on it. Remember, the results selection can still be affected by selections on other charts just, not on itself.

Our example uses multiple select for both of our CRMA charts but any selection type option is viable for this method. The only difference is when selecting the parameter settings, if either Multiple Select or Multiple Select (Required) are used, “Include all values” must be checked!

The benefits of bringing your dashboards together

Parameters in CRMA that create interactions between CRMA and Tableau provide a helpful way to bring your existing analyses together. Because your CRMA and Tableau dashboards can interact together, it is now easier than ever to bring your dashboards together to utilize the unique features of each. This will allow your analytics to be more user-focused by bringing together the data your users need in one place, leveraging the best of Tableau and CRMA.

If you are interested in creating analysis using both CRMA and Tableau, please visit our accelerator library where you can find this accelerator and many others we have for CRMA and Tableau!