
Data Modeling with Tableau
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
All prices
More details
Person
Kirk Munroe is a Tableau Certified Desktop Professional, Tableau Certified Data Analyst, Tableau Certified Partner Architect, and Tableau Certified Partner Consultant, with over 20 years of work experience in business analytics. He is the co-founder of Paint with Data, a Tableau partner and visual analytics coaching consulting firm. Kirk works with clients to improve their analytics skills from data modeling to storytelling and presenting. Kirk has worked at analytics software companies, including Salesforce/Tableau, IBM/Cognos, and Kinaxis in senior roles in product management, marketing, sales enablement, and customer success.
Content
- Licensing Considerations and Types of Data Models
- Data Preparation with Tableau Prep Builder
- Data Modeling Functions with Tableau Prep Builder
- Advanced Modeling Functions in Tableau Prep Builder
- Data Output from Tableau Prep Builder
- Connecting to Data in Tableau Desktop
- Building Data Models Using Relationships
- Building Data Models at the Physical Level
- Sharing and Extending Tableau Data Models
- Securing Data
- Data Modeling Considerations for Ask Data and Explain Data
- Data Management with Tableau Prep Conductor
- Scheduling Extract Refreshes
- Data Modeling Strategies by Audience and Use Case
1
Introducing Data Modeling in Tableau
Welcome to data modeling in Tableau. You might know Tableau as a great self-service analytics tool that provides both powerful analytics and is also easy to use. You might also think that Tableau is light on the key enterprise analytics requirement of data security, data model robustness, and data maintainability. In this book, you will learn that Tableau has all these key data requirements covered. You will learn how data is best structured for Tableau analysis and performance, and understand the functionality of Tableau Prep Builder and Tableau Desktop and the role each plays in building data models. You'll then publish these data models to Tableau Server or Online and optimize them for performance, governance, and security.
By the end of this book, you will have all the strategies and techniques needed to enable individuals in your organization to answer their own questions with data, regardless of their level of expertise. You will also drastically reduce the calls you receive from these same individuals about confusing data and dashboards that are slow to load.
Tableau is very different from most other BI tools in that the model can be either implicit or explicit. For instance, many analysts open Tableau Desktop, connect to data, and immediately begin creating visuals. In this instance, Tableau implicitly created a data model (that is, made a connection, executed a query, and created metadata) without an analyst having to do anything to create the model.
This implicit data modeling works well when your data source has already been prepared for analysis and you are the person creating charts and dashboards. Often, our data is not structured this way. It comes from different sources and needs to be combined and defined in meaningful ways. In these instances, Tableau provides the tools for you to create data models that are scalable, secure, and targeted to the different skills of a broad class of developers and consumers.
Tableau uses a data model as the foundation for the creation of all analyses. A Tableau data model contains the following:
- Connection information to the underlying data source.
- The queries required to retrieve the data.
- Additional metadata, or data about the data, added to the underlying data. Metadata can include more readable field names, field types, the grouping of data into hierarchies, and calculations not in the underlying data.
Tableau works best when your data is in a traditional spreadsheet table format - that is, Tableau assumes that the first row of your data consists of column headers and each column header maps 1:1 to a field name, with additional rows of data each containing one record of data. If the underlying data is not formatted in this way, analysis within Tableau becomes very difficult and performance will suffer. To address this, you can model your data in a format that works best with Tableau. The best practices to model data properly are the primary content of this book.
This chapter demonstrates how Tableau automatically creates a data model when you connect to a data source, how it interprets rows and columns in your data, and how you can shape and combine additional data into your data model.
In this chapter, we're going to cover the following main topics:
- What happens when you connect to data in Tableau Desktop
- The ideal data structure for Tableau
- Shaping data for Tableau
- Connecting multiple tables
Technical requirements
Tableau Desktop (and Tableau Prep Builder version 2022.2 or higher in future chapters) version 2022.2 or higher is needed to complete the exercises in this chapter.
If you don't have a licensed version of Tableau Desktop, you can obtain a 14-day free trial from https://www.tableau.com/products/desktop.
Another alternative is Tableau Public. The free Tableau Public version of Desktop contains almost all the same features as the paid version, with the exception of a small number of data source connection options, and output can only be saved to the Tableau Public site. However, it often has enough features to perform visual analysis as long as the data isn't confidential. The Tableau Public Desktop version can be found at https://public.tableau.com/s/.
The files used in the exercises in this chapter can be found at https://github.com/PacktPublishing/Data-Modeling-with-Tableau/. We recommend downloading all the files before getting started. The quickest way to do this is to click on the green <>Code button and then select Download ZIP. Expand the ZIP file and make note of the directory. We will be referencing it throughout the book.
Note
The aforementioned requirements are applicable to all chapters in this book.
What happens when you connect to data in Tableau Desktop?
When you connect to data in Tableau Desktop, Tableau will begin to interpret your data. First, it will create a field for each column of your data. Second, it will assign a data type to each of the fields. Tableau does this because it is powered by a proprietary query technology, called VizQL. VizQL is the technology that underpins Tableau, enabling a visual analytics experience by automatically creating visualizations for a user. This is very different than most business intelligence tools that rely on the user to tell the tool how they would like the data visualized through the picking of a chart type.
For VizQL to work, Tableau needs to know the type of each field. The two main field types in Tableau are discrete and continuous:
- Discrete fields: Colored blue in Tableau. By the Oxford Dictionary's definition, discrete means independent of other things of the same type. When placed on a Tableau visualization, discrete fields usually create a header - similar to a column header in a spreadsheet.
- Continuous fields: Colored green in Tableau. Again, using the Oxford Dictionary, continuous is defined as happening or existing for a period of time without being interrupted. When placed on a Tableau visualization, continuous fields create an axis - that is, they create a visual display of data.
One way to think about the relationship between discrete and continuous fields is that continuous fields are recording measurements and discrete fields are describing those measurements. In a statement, this can usually be phrased as continuous by discrete - for example, sales (continuous) by region (discrete), as shown in Figure 1.1.
Figure 1.1 - Demonstrating discrete and continuous fields
Within these two main field types, there are additional field types that inform VizQL how to create a visual display when they are brought onto the Tableau canvas. These can be seen in Figure 1.2 and are as follows:
- Number (decimal): A number that allows fractions. Represented by a # symbol in the Tableau UI.
- Number (whole): An integer or a number with no decimals. Also represented by a # symbol.
- String: A field that contains alphanumeric characters. Represented by abc.
- Date: Tableau accepts several date formatting options. Represented by a calendar icon.
- Date & Time: A date field with granularity down to the second of a day. Represented by a calendar icon plus an analog clock.
- Geographical/Spatial: A field that can be plotted on a map. There are many subtypes of geographical fields, including country, state/province, city, postal/zip code, airport, congressional district, NUTS (Europe), and a latitude or longitude value. Represented by a globe icon.
- Binary/Boolean: A field that takes a true/false or yes/no condition. Represented by a T/F icon.
Figure 1.2 - Additional field types
Let's open Tableau Desktop and connect to the Superstore sales 2022.csv file. This file contains the sample data that comes along with the Tableau installation. It is a sample (and fictional) retail dataset that is useful for demonstration and learning purposes. We will use this data throughout the book when we can. This will help you as you increase your Tableau learning journey, as most of Tableau's training videos use the same data:
- Open Tableau Desktop.
- Click on the Connect to Data blue hyperlink near the top-left-hand side of the Tableau Desktop UI:
Figure 1.3 - Connect to...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: ePUB
Copy protection: without DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use a reader that can handle the file format ePUB, such as Adobe Digital Editions or FBReader – both free (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePUB works well for novels and non-fiction books – i.e., 'flowing' text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook does not use copy protection or Digital Rights Management
For more information, see our eBook Help page.