DEV Community


Connect to and Query Salesforce Data in QlikView

Jerod Johnson
Former educator, current technology evangelist, family man, and board gamer.
・3 min read

QlikView is a business discovery platform that helps business users perform self-service business intelligence. This article explains how to use the CData ODBC Driver to connect to Salesforce data and create data visualizations in QlikView.

When you send advanced SQL queries from QlikView to Salesforce, the driver sends supported SQL operations straight to Salesforce, such as filters and aggregations, and uses the embedded SQL engine to perform unsupported actions (typically SQL functions and JOIN operations) client-side. You can visualize and analyze Salesforce data using native QlikView data types thanks to built-in dynamic metadata querying.

Connect to Salesforce as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You may create and configure ODBC DSNs with the Microsoft ODBC Data Source Administrator.

To connect to Salesforce, you can use one of three authentication methods: login, OAuth, or SSO. You'll need the user's username, password, and security token to use the Login method.

In case you do not have access to the username and password or do not want to require them, you can use OAuth authentication.

SSO (single sign-on) can be used by setting the SSOProperties, SSOLoginUrl, and TokenUrl connection properties, which allow you to authenticate to an identity provider.

See the "Getting Started" chapter in the help documentation for more information.

Populate a Chart with Salesforce Data

The instructions below show how to import the results of a SQL query into a QlikView visualization. In this article, you will create a bar chart with the query below:

SELECT Contact.Name, SUM(Account.AnnualRevenue) FROM Contact, Account GROUP BY Contact.Name;

  1. Click File -> Edit Script (or click the Edit Script button in the Toolbar).

  2. On the Data tab, select ODBC in the Database menu and click Connect.

Alt Text

  1. Select the DSN (CData Salesforce Sys) in the resulting dialog.

Alt Text

  1. A command like the following is generated:

view source

ODBC CONNECT TO [CData Salesforce Sys];

  1. Enter the SQL query directly into the script with the SQL command (or click Select to build the query in the SELECT statement wizard).

view source

SQL SELECT Contact.Name, SUM(Account.AnnualRevenue) FROM Contact, Account GROUP BY Contact.Name;

Where possible, the SQL operations in the query, like filters and aggregations, will be pushed down to Salesforce, while any unsupported operations (which can include SQL functions and JOIN operations) will be managed client-side by the CData SQL engine embedded in the driver.

Alt Text

  1. Close the script editor and reload the document to execute the script.

  2. Click Tools -> Quick Chart Wizard. In the wizard, select the chart type. This example uses a bar chart. When building the chart, you have access to the fields from Salesforce, typed appropriately for QlikView, thanks to built-in dynamic metadata querying.

  3. When defining Dimensions, select Contact.Name in the First Dimension menu.

  4. When defining Expressions, click the summary function you want and select AnnualRevenue in the menu.

  5. Finish the wizard to generate the chart. The CData ODBC Driver for Salesforce connects to live Salesforce data, so the chart can be refreshed to see real-time changes. Live connections are possible and effective, thanks to the high-performance data processing native to CData ODBC drivers.

Alt Text

More Information

The Salesforce ODBC Driver allows you to connect with live Salesforce account data, directly from any applications that support ODBC connectivity.

By providing industry-standard connectivity, CData democratizes Salesforce access, allowing everyone in the organization, from IT professionals & app developers to citizen analysts & data scientists, to work with and find value from the entire Salesforce platform.

Discussion (0)