Reader small image

You're reading from  Learning Tableau

Product typeBook
Published inApr 2015
PublisherPackt
ISBN-139781784391164
Edition1st Edition
Tools
Right arrow
Author (1)
Joshua N. Milligan
Joshua N. Milligan
author image
Joshua N. Milligan

Joshua N. Milligan is a Hall of Fame Tableau Zen Master and 2017 Iron Viz Global finalist. His passion is training, mentoring, and helping people gain insights and make decisions based on their data through data visualization using Tableau and data cleaning and structuring using Tableau Prep. He is a principal consultant at Teknion Data Solutions, where he has served clients in numerous industries since 2004.
Read more about Joshua N. Milligan

Right arrow

Ad hoc calculations


Tableau 9.0 introduced a new way of creating and using calculations. Ad hoc calculations add calculated fields to shelves in a single view without adding fields to the Data window.

Let's say you have a simple view that shows the price per renter, like this:

What if you wanted to quickly highlight any renters who had a contract of more than $3,000? One option would be to create an ad hoc calculation. To do so, simply double-click on an empty area of the Columns, Rows, or Measure Values cards or on the empty space of the Marks shelf and then start typing the code for a calculation. In this example, we've double-clicked on the empty space on the Marks shelf:

Here, we've entered code that will return True if the sum of Price is greater than $3,000 and False otherwise. Pressing Enter or clicking outside the textbox will reveal a new ad hoc field that can be dragged and dropped anywhere within the view. Here, we've added it to the Color shelf:

The ad hoc field is only available...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Tableau
Published in: Apr 2015Publisher: PacktISBN-13: 9781784391164

Author (1)

author image
Joshua N. Milligan

Joshua N. Milligan is a Hall of Fame Tableau Zen Master and 2017 Iron Viz Global finalist. His passion is training, mentoring, and helping people gain insights and make decisions based on their data through data visualization using Tableau and data cleaning and structuring using Tableau Prep. He is a principal consultant at Teknion Data Solutions, where he has served clients in numerous industries since 2004.
Read more about Joshua N. Milligan