Salesforce Connector for Tableau How to Get Report

Introduction

In this article we will delve deeper into Salesforce and Tableau integration, and will learn how to get report. We are continuing from where we left off. By this time, you must have installed ODBC PowerPack, created ODBC Data Source, and configured authentication settings in your Salesforce account .

So, let's not waste time and begin.

Use Query Builder to generate SQL query

  1. The first thing you have to do is open Query Builder:

    ZappySys API Driver - Salesforce
    Amazon Ads Connector can be used to get Amazon advertisements using Amazon Advertisements API, download various advertisement-related reports.
    SalesforceDSN
    Open Query Builder in API ODBC Driver to read and write data to REST API
  2. Then simply select the Get Report endpoint (action).

  3. Continue by configuring the Required parameters. You can also set optional parameters too.

  4. Move on by hitting Preview Data button to preview the results.

  5. If you see the results you need, simply copy the generated query:

    Get Report
    Required Parameters
    Metrics Select the value from the dropdown
    Optional Parameters
    Record Type keywords
    State Filter
    Campaign Type
    Segment
    Report Date (yyyyMMdd)
    SELECT * FROM get_report
    WITH
    (
        "RecordType" = 'keywords',
        "ReportDate" = 'today',
        "Metrics" = 'abcd-1234-metrics'
    )
    Query Builder
  6. That's it! You can use this query in Tableau.

Let's not stop here and explore SQL query examples, including how to use them in Stored Procedures and Views (virtual tables) in the next steps.

SQL query examples

Use these SQL queries in your Tableau data source:

How to Get report

SELECT * FROM get_report
WITH
(
    "RecordType" = 'keywords',
    "ReportDate" = 'today',
    "Metrics" = 'abcd-1234-metrics'
)

Get Report in Tableau

  1. Open Tableau Desktop and click File > New.

  2. To create new Connection click More > Microsoft SQL Server > Enter your credentials to connect to SQL Server (in our example before we used john):

    Tableau connect to SQL Server
  3. Once connection is created for SQL Server we can read Salesforce data 3 different ways:

    1. Query View which contains OPENQUERY to Linked Server for Salesforce data
    2. Use direct SQL Query using OPENQUERY
    3. Use Stored Procedure (Mostly useful to parameterize calls
  4. See below example to pull data from Salesforce in Tableau using SQL View approach:

    Create data source in Tableau
  5. Once your data sources are created you can click on Sheet1 and drag fields to create visualizations for Tableau Dashboard:

    Create data source in Tableau

More actions supported by Salesforce Connector

Learn how to perform other actions directly in Tableau with these how-to guides:

More integrations

All
Data Integration
Database
BI & Reporting
Productivity
Programming Languages
Automation & Scripting
ODBC applications