Prepare, Blend, and Analyze Salesforce Data in Alteryx Designer 
Published: 2021-07-28 12:57:16

The [ODBC Driver for Salesforce](https://www.cdata.com/drivers/salesforce/odbc/?utm_source=dev.to&utm_medium=kb-article-posting&utm_campaign=Prepare%2C-Blend%2C-and-Analyze-Salesforce-Data-in-Alteryx-Designer+) from CData provides ODBC-based access to live Salesforce data, allowing you to interact with Salesforce data in a range of BI, reporting, and ETL tools — as well as directly using SQL queries. In this article, we demonstrate how to connect to Salesforce data using an ODBC connection in Alteryx Designer to conduct self-service BI, data preparation, data blending, and advanced analytics. 

When you send complex SQL queries from Alteryx Designer to Salesforce, the driver sends supported SQL operations straight to Salesforce, such as filters and aggregations, and uses the embedded SQL engine to handle unsupported operations client-side (e.g., SQL functions and JOIN operations). With built-in dynamic metadata querying, you can use native Alteryx data field types to visualize and analyze Salesforce data. 

# Connect to Salesforce Data 

In order to connect to Salesforce as an ODBC data source in Alteryx Designer, follow the steps below. 

1. If you have not already done so, provide values for the required connection properties in the data source name (DSN). You can configure the DSN using the built-in Microsoft ODBC Data Source Administrator. This is also the last step of the driver installation. See the "Getting Started" chapter in the Help documentation for a guide to using the Microsoft ODBC Data Source Administrator to create and configure a DSN. 

For connecting to Salesforce, you can use one of three authentication methods: login, OAuth, or SSO. The Login method requires you to have the username, password, and security token of the user. 

If you do not have access to the username and password or do not wish 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. 

Use the "Getting Started" chapter in the help documentation to get more information. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40iwqmslcyopj185qy0j.png)

2. Open Alteryx Designer and create a new workflow. 

3. Drag and drop a new input data tool onto the workflow. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwm46hq7uylmft4u4g0v.png)

4. Click the new input data tool and under Connect a File or Database, select Database Connection -> New ODBC Connection. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5135mobw6ti5s0klqjq.png)

5. Select the DSN that you configured for use in Alteryx. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mt10zcg7es3de5iqbcoq.png)

6. In the wizard that opens, choose the fields you wish to include in your query. Where possible, the complex queries generated by the 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o10v3dxf4iia2obny900.png)

If you wish to further customize your dataset, you can open the SQL Editor and modify the query manually, adding clauses, aggregations, and other operations to ensure that you are retrieving exactly the Salesforce data you want. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rgzjir9rmz23iurnmws.png)

You're ready to work with Salesforce data in Alteryx Designer now that you've defined the query. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8htn0wjq2rw24gh5umvq.png)

# Perform Self-Service Analytics on Salesforce Data 

You're now ready to build a procedure for preparing, blending, and analyzing Salesforce data. The CData ODBC driver performs dynamic metadata discovery and exposes data using Alteryx data field types, allowing you to edit data as needed and create meaningful datasets using the Designer's tools. You will cleanse and view data in the example below. 

1. Add a data cleansing tool to the workflow and check the boxes in Replace Nulls to replace null text fields with blanks and replace null numeric fields with 0. You can also eliminate leading and trailing whitespace by checking the box in Remove Unwanted Characters. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0kdze1xap0yxnv3rq02.png)

2. Add a browse data tool to the workflow. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/120tm07qcf2wu3swtgq1.png)

3. Click to run the workflow (CTRL+R). 

4. Browse your cleansed Salesforce data in the results view. 

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6l7gwjot5j5bp1ki6a1l.png)

# More Information 

Alteryx allows you to swiftly cleanse, transform, and analyze Salesforce data thanks to built-in, high-performance data processing. In Alteryx Designer, you can use an ODBC connection to connect to Salesforce data for self-service BI, data preparation, data blending, and advanced analytics. 

The CData [ODBC Driver for Salesforce](https://www.cdata.com/drivers/salesforce/odbc/?utm_source=dev.to&utm_medium=kb-article-posting&utm_campaign=Prepare%2C-Blend%2C-and-Analyze-Salesforce-Data-in-Alteryx-Designer+) provides ODBC-based access to live Salesforce data, allowing you to use Salesforce data in a variety of BI, reporting, and ETL tools, as well as directly with SQL queries.