How do I connect MicroStrategy to Salesforce?

Use the Salesforce ODBC driver to connect MicroStrategy Analytics Desktop to Salesforce and provide real-time access to your Salesforce objects, enabling you to analyse Salesforce data from your MicroStrategy dashboard.

MicroStrategy Analytics Desktop is a free application that lets users create pie graphs, matrices, maps and other visualisations with data pulled from various sources including ODBC data sources.

The Salesforce ODBC driver is available to download from the Easysoft web site:

  1. Download the Windows Salesforce ODBC driver.
  2. Install and license the Salesforce ODBC driver on the machine where MicroStrategy Analytics Desktop is installed.

    For installation instructions, refer to the Salesforce ODBC driver documentation.

Before you can use the Salesforce ODBC driver to connect MicroStrategy to Salesforce, you need to configure an ODBC data source. An ODBC data source stores the connection details for the target database (in this case, Salesforce) and the ODBC driver that is required to connect to it (in this case, the Salesforce ODBC driver).

You can configure a user ODBC data source, which is only available to the user who creates it, or a system ODBC data source, which is available to all users on the machine. You configure ODBC data sources in ODBC Data Source Administrator, which is included with Windows.

To run ODBC Data Source Administrator on 64-bit Windows, in the Windows Run dialog box, type:

%windir%\syswow64\odbcad32.exe

If you are not sure whether your version of Windows is 32-bit or 64-bit, follow the instructions for running ODBC Data Source Administrator on 64-bit Windows. If you get an error, follow the instructions for 32-bit Windows instead.

Use ODBC Data Source Administrator to create your Salesforce ODBC driver data source:

  1. Do one of the following:
    • To create a user data source, in the User DSN tab, choose Add.

      –Or–

    • To create a system data source, choose the System DSN tab, and then choose Add.
  2. In the Create New Data Source dialog box, choose Easysoft ODBC-Salesforce Driver, and then choose Finish.
  3. Complete the DSN Setup dialog box:
    Setting Value
    DSN Salesforce
    User Name The name of your Salesforce user. For example, myuser@mydomain.com.
    Password The password for your Salesforce user.
    Token The security token for your Salesforce user, if required.

    To find out whether you need to supply a security token, choose the Test button. If the connection attempt fails with an error which contains LOGIN_MUST_USE_SECURITY_TOKEN, you need to supply one.

    Salesforce emails the security token to the email address associated with your Salesforce user account. If you have not received a security token, you can regenerate it. Salesforce will then email the new security token to you. To regenerate your security token, log in to Salesforce and then choose Setup from the user menu. Search for "security token" in the Quick Find box. Choose Reset Security Token in the Reset Security Token page. When you receive the token in your email client, copy it and then paste it into the Token field.

  4. Use the Test button to verify that you can successfully connect to Salesforce.

You can now connect MicroStrategy to Salesforce:

  1. In MicroStrategy Analytics Desktop, choose Import > Data.
  2. In the Select your data source pane, choose Database.
  3. In the Database connections pane, choose the New connection button (+).
  4. In the Database Connection dialog box, choose DSN Connections.
  5. In the DSN list, choose your Salesforce ODBC data source.
  6. Leave the DBMS list set to Generic DBMS.
  7. Type your Salesforce user name and password in the spaces provided.

    Although these details are already stored in the data source, presumably MicroStrategy appends the user name and password specified here to the connection string it passes to SQLDriverConnect. You therefore need to supply the user name and password again, otherwise the connection will fail.

  8. In the Name box, enter Easysoft Salesforce, and then choose OK.
  9. In the Database connections pane, choose Easysoft Salesforce.

    MicroStrategy retrieves the available Salesforce tables (objects), and displays them in the Available tables pane.

    You can use these tables to retrieve Salesforce data by using drag and drop, but we will be entering SQL instead.

  10. In the Editor panel, choose the Edit SQL button.
  11. Copy and then paste the following SQL into the Editor panel:
    SELECT U1.name AS "Account Owner", A1.name AS "Account Name",
           A2.name AS "Parent Account", A1.AccountNumber AS "Account Number",
           A1.Site AS "Account Site", A1.Type AS "Type", A1.Industry AS "Industry",
           A1.AnnualRevenue AS "Annual Revenue",
           A1.BillingStreet AS "Billing Address Line 1",
           A1.BillingCity AS "Billing Address Line 2",
           A1.BillingState AS "Billing Address Line 3",
           A1.BillingPostalCode AS "Billing Address  Line 4",
           A1.BillingCountry AS "Billing Address Line 5",
           A1.CustomerPriority__c AS "Customer Priority",
           A1.SLAExpirationDate__c AS "SLA Expiration Date",
           A1.NumberofLocations__c AS "Number of Locations",
           A1.Active__c AS "Active",
           U2.name AS "Created By",
           A1.CreatedDate AS "Created On",
           A1.Description AS "Description",
           A1.Rating AS "Rating",
           A1.Phone AS "Phone",
           A1.Fax AS "Fax",
           A1.Website AS "Website",
           A1.TickerSymbol AS "Ticker Symbol",
           A1.Ownership AS "Ownership",
           A1.NumberOfEmployees AS "Employees",
           A1.Sic AS "SIC Code",
           A1.ShippingStreet AS "Shipping Address Line 1",
           A1.ShippingCity AS "Shipping Address Line 2",
           A1.ShippingState AS "Shipping Address Line 3",
           A1.ShippingPostalCode AS "Shipping Address Line 4",
           A1.ShippingCountry AS "Shipping Address Line 5",
           A1.SLA__c AS "SLA",
           A1.SLASerialNumber__c AS "SLA Serial Number",
           A1.UpsellOpportunity__c AS "Upsell Opportunity",
           U3.name AS "Last Modified By",
           A1.LastModifiedDate AS "Last Modified On"
    FROM Account A1 LEFT OUTER JOIN Account A2 ON A2.Id = A1.ParentId,
          "User" U1, "User" U2, "User" U3
    WHERE A1.OwnerId=U1.Id AND A1.CreatedById=U2.Id AND A1.LastModifiedById=U3.Id;
    

    This SQL query retrieves the information shown in the Account detail page in Salesforce.

  12. Choose the Execute SQL button. Then choose the Continue button below the Editor panel.
  13. Save the data as Salesforce Account Detail when prompted.

    The data can now be used in a MicroStrategy dashboard.