Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Tableau 10 - Second Edition

You're reading from  Learning Tableau 10 - Second Edition

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786466358
Pages 432 pages
Edition 2nd Edition
Languages

Table of Contents (17) Chapters

Learning Tableau 10 Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Creating Your First Visualizations and Dashboard 2. Working with Data in Tableau 3. Moving from Foundational to More Advanced Visualizations 4. Using Row-Level, Aggregate, and Level of Detail Calculations 5. Table Calculations 6. Formatting a Visualization to Look Great and Work Well 7. Telling a Data Story with Dashboards 8. Deeper Analysis – Trends, Clustering, Distributions, and Forecasting 9. Making Data Work for You 10. Advanced Visualizations, Techniques, Tips, and Tricks 11. Sharing Your Data Story

Chapter 9.  Making Data Work for You

Up to this point, most of the examples we've looked at in this book assume that data is well structured and fairly clean. Data in the real world isn't so pretty at times. Maybe it's messy or it doesn't have a good structure. It may be missing values or have duplicate values. It might be at the wrong level of detail.

How can you deal with this messy data? Tableau offers quite a bit of flexibility for addressing data issues within the tool. We'll take a look at some of the features and techniques that will enable you to overcome data structure obstacles. Having a good understanding of what data structures work well with Tableau is the key to understanding how you will be able to resolve certain issues.

In this chapter, we'll focus on some principles for structuring data to work well with Tableau, as well as some specific examples of how to address common data issues. This chapter will cover the following topics:

  • Structuring data for Tableau

  • Techniques...

Structuring data for Tableau


We've already seen that Tableau can connect to nearly any data source. Whether it's a built-in direct connection, ODBC, or using the Tableau Data Extract API to generate an extract, no data is off limits. However, there are certain structures that make data easier to work with in Tableau.

There are two keys to ensuring a good data structure that works well with Tableau:

  • Every record of a source data connection should be at a meaningful level of detail

  • Every measure contained in the source should match the level of detail or possibly be at a higher level of detail, but should never be at a lower level of detail

For example, let's say you have a table of test scores with one record per classroom in a school. Within the record, you may have three measures: the average GPA for the classroom, the number of students in the class, and the number of students in the school:

Techniques for dealing with data structure issues


In some cases, restructuring data at the source is not an option. The source may be secured and read-only. Or you might not even have access to the original data and instead receive periodic dumps of data in a specific format. In such cases, there are techniques for dealing with structural issues once you have connected to the data in Tableau.

We'll consider some examples of data structure issues to demonstrate some techniques for handling those issues in Tableau. None of the solutions are the only right way to resolve the given issue. Often, there are several approaches that might work. Additionally, these are only examples of issues you might encounter. Take time to understand how the proposed solutions build on the foundational principles we've considered in previous chapters and how you can use similar techniques to solve your data issues.

Restructuring data in Tableau connections

The Excel workbook World Population Data.xlsx, included in...

Overview of advanced fixes for data problems


In addition to the techniques previously mentioned in this chapter, there are some additional possibilities for dealing with data structure issues. It is outside the scope of this book to develop these concepts fully. However, if you have some familiarity with these approaches, you broaden your ability to deal with challenges as they arise.

  1. Custom SQL: This can be used in the data connection to resolve some data problems. Beyond giving a field for a cross database join, as we saw previously, custom SQL can be used to radically reshape the data retrieved from the source. Custom SQL is not an option for all data sources, but is for many relational databases and for the legacy JET driver connections for Excel and text files. Consider a custom SQL script that takes the wide table of country populations mentioned earlier in this chapter and restructures it into a tall table:

            SELECT [Country Name],[1960] AS Population, 1960 AS Year 
            FROM...

Summary


Up until this chapter, we'd looked at data which was, for the most part, well-structured and easy to use. In this chapter, we considered what constitutes good structure and ways to deal with poor data structure. Good structure consists of data that has a meaningful level of detail and which has measures that match that level of detail. When measures are spread across multiple columns, we get data that is wide instead of tall.

You've got some experience now in applying various techniques to deal with data that has the wrong shape or has measures at the wrong level of detail. Tableau gives us the power and flexibility to deal with some of these structural issues, but it is often preferable to fix data structure at the source.

In the next chapter, we'll continue looking at some advanced and powerful techniques. These will be exciting and fun. Instead of looking at how to fix problems, we'll look at some tips and tricks to expand your creativity and take Tableau to the next level!

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning Tableau 10 - Second Edition
Published in: Sep 2016 Publisher: Packt ISBN-13: 9781786466358
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 €14.99/month. Cancel anytime}

School

Classroom

Average GPA

Number of Students

Number of Students (School)

Pickaway...