Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Data Modeling with Tableau

You're reading from   Data Modeling with Tableau A practical guide to building data models using Tableau Prep and Tableau Desktop

Arrow left icon
Product type Paperback
Published in Dec 2022
Publisher Packt
ISBN-13 9781803248028
Length 356 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kirk Munroe Kirk Munroe
Author Profile Icon Kirk Munroe
Kirk Munroe
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Part 1: Data Modeling on the Tableau Platform
2. Chapter 1: Introducing Data Modeling in Tableau FREE CHAPTER 3. Chapter 2: Licensing Considerations and Types of Data Models 4. Part 2: Tableau Prep Builder for Data Modeling
5. Chapter 3: Data Preparation with Tableau Prep Builder 6. Chapter 4: Data Modeling Functions with Tableau Prep Builder 7. Chapter 5: Advanced Modeling Functions in Tableau Prep Builder 8. Chapter 6: Data Output from Tableau Prep Builder 9. Part 3: Tableau Desktop for Data Modeling
10. Chapter 7: Connecting to Data in Tableau Desktop 11. Chapter 8: Building Data Models Using Relationships 12. Chapter 9: Building Data Models at the Physical Level 13. Chapter 10: Sharing and Extending Tableau Data Models 14. Part 4: Data Modeling with Tableau Server and Online
15. Chapter 11: Securing Data 16. Chapter 12: Data Modeling Considerations for Ask Data and Explain Data 17. Chapter 13: Data Management with Tableau Prep Conductor 18. Chapter 14: Scheduling Extract Refreshes 19. Chapter 15: Data Modeling Strategies by Audience and Use Case 20. Index 21. Other Books You May Enjoy

Pivoting rows to columns

In this section, we will explore pivoting rows to columns. There are instances when our data sources have multiple, conditional fields contained in the same column. This structure of data will cause problems because Tableau likes every column to be a unique field. If we look at the structure of our Bad Measures.xlsx file, as shown in Figure 5.7, you can see that there is a column called Measure and another column called Value. The ideal data structure would have four columns, one for the date and one each for sales, profit, and volume:

Figure 5.7 – The Bad Measures file

Figure 5.7 – The Bad Measures file

If we don’t pivot these rows to columns, analysts using Tableau Desktop don’t have an easy way to create views and dashboards in Tableau. The best they could hope for is to create three calculated fields, one for each of the measures, as shown in Figure 5.8:

Figure 5.8 – Result of calculated fields

Figure 5.8 – Result of calculated fields

This approach...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image