Book Image

Mastering Tableau 2021 - Third Edition

By : Marleen Meier, David Baldwin
Book Image

Mastering Tableau 2021 - Third Edition

By: Marleen Meier, David Baldwin

Overview of this book

Tableau is one of the leading business intelligence (BI) tools that can help you solve data analysis challenges. With this book, you will master Tableau's features and offerings in various paradigms of the BI domain. Updated with fresh topics including Quick Level of Detail expressions, the newest Tableau Server features, Einstein Discovery, and more, this book covers essential Tableau concepts and advanced functionalities. Leveraging Tableau Hyper files and using Prep Builder, you’ll be able to perform data preparation and handling easily. You’ll gear up to perform complex joins, spatial joins, unions, and data blending tasks using practical examples. Next, you’ll learn how to execute data densification and further explore expert-level examples to help you with calculations, mapping, and visual design using Tableau extensions. You’ll also learn about improving dashboard performance, connecting to Tableau Server and understanding data visualization with examples. Finally, you'll cover advanced use cases such as self-service analysis, time series analysis, and geo-spatial analysis, and connect Tableau to Python and R to implement programming functionalities within it. By the end of this Tableau book, you’ll have mastered the advanced offerings of Tableau 2021 and be able to tackle common and advanced challenges in the BI domain.
Table of Contents (18 chapters)
16
Another Book You May Enjoy
17
Index

Implementing Python functionality

Just like R, TabPy makes use of the script functions in Tableau. In the next sections, we will practice working with TabPy and will look at multiple use cases. Tableau calculations using TabPy look very similar to R's. For TabPy, it is important to add a return statement in the calculated field and notice that arguments are noted with an underscore instead of a dot:

Figure 15.30: Python TabPy syntax

This will be manifested in the next exercises; we will first look into random number generators.

Random and random normal

Many calculations are easily accessible via the calculated fields, others via the table calculations—and then there are some hidden functions. If you tried to find the function Random for example, you wouldn't. But you can still use the Random() function as can be seen here:

Figure 15.31: Random

Another option is, using TabPy to get the Random function. We will look at random as well...