Book Image

Tableau Prep Cookbook

By : Hendrik Kleine
Book Image

Tableau Prep Cookbook

By: Hendrik Kleine

Overview of this book

Tableau Prep is a tool in the Tableau software suite, created specifically to develop data pipelines. This book will describe, in detail, a variety of scenarios that you can apply in your environment for developing, publishing, and maintaining complex Extract, Transform and Load (ETL) data pipelines. The book starts by showing you how to set up Tableau Prep Builder. You’ll learn how to obtain data from various data sources, including files, databases, and Tableau Extracts. Next, the book demonstrates how to perform data cleaning and data aggregation in Tableau Prep Builder. You’ll also gain an understanding of Tableau Prep Builder and how you can leverage it to create data pipelines that prepare your data for downstream analytics processes, including reporting and dashboard creation in Tableau. As part of a Tableau Prep flow, you’ll also explore how to use R and Python to implement data science components inside a data pipeline. In the final chapter, you’ll apply the knowledge you’ve gained to build two use cases from scratch, including a data flow for a retail store to prepare a robust dataset using multiple disparate sources and a data flow for a call center to perform ad hoc data analysis. By the end of this book, you’ll be able to create, run, and publish Tableau Prep flows and implement solutions to common problems in data pipelines.
Table of Contents (11 chapters)

Connecting to JDBC or ODBC data sources

Although Tableau Prep provides out-of-the-box connections to many popular data sources, there's always a chance you might be using another data source type. If this is the case, you can use JDBC and ODBC connections instead.

In order to use such connections, you must first install the requisite driver on the machine running Tableau Prep Builder and configure the connection outside of Tableau Prep. If you intend to publish your flow to Tableau Server, you must also create the same connection on the server itself, using the same DSN.

Important note

Tableau considers JDBC and ODBC unsupported connections and the success results may vary.

In this recipe, we'll walk through using an ODBC connection. The high-level steps for JDBC are largely the same.

Getting ready

In order to follow along with this recipe, you must have installed the appropriate driver for the connection type of your choice and configured the ODBC connection in your operating system.

How to do it…

To get started, ensure you have Tableau Prep Builder open, then follow these steps:

  1. From the home screen, click the Connect to Data button and scroll to the very bottom of the Connect pane to select Other Databases (ODBC):
    Figure 2.28 – Selecting the ODBC connection type

    Figure 2.28 – Selecting the ODBC connection type

  2. The connection dialog for ODBC connections is very simple as the connection details are already captured in the DSN you have pre-configured on your system. All you need to do is select the DSN of your choice, and enter your credentials prior to selecting Sign In.
  3. Once connected, the options on the flow screen will depend on your data source type. In this example, our ODBC connects to Microsoft SQL Server and shows the expected selection options, including Database, Schema, and Tables. Once you've added your desired table to the flow, you can treat this ODBC as any other connection type.

    Important note

    For ease of demonstration purposes, this recipe shows how to connect to Microsoft SQL Server using ODBC. However, when available, you should always aim to use a supported connection type in Tableau Prep rather than JDBC or ODBC. This ensures optimal performance and reduces the chance of unforeseen errors.

How it works…

Using JDBC and ODBC tells Tableau Prep to go to your system's respective data source connections, as referred to by the DSN name, and leverage the connection as configured. However, Tableau Prep cannot control these connections, its settings, or the drivers used. Therefore, they are not supported and should be used with caution.