Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two

Data

Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two

Tableau Deep Dives are a loose collection of mini-series designed to give you an in-depth look into various features of Tableau Software.

In part one of this two-parter, I went into a lot of depth on how to use custom sorts within table calculations. I highly recommend reading that article first before continuing with the second part. In this post, we’re going to apply those ideas to illustrate how useful they can be with a little imagination.

Ascending Running Sum

Let’s begin with some basic concepts and then apply some extras as we go along to make it into something fun. I’ll start with an ascending running sum. Rather than Pane (down), we are effectively creating a table calculation that is running Pane (up). Why would we need to do this? In our use case, we’re going to show sales as a month-to-date total with the most current day at the top of the table. Here’s the basic table showing Month and Day along with SUM of Sales below:

Tableau table calculations custom sorts

Now, let’s add a second SUM of Sales with a Running Total (SUM) table calculation onto this view, restarting on each month:

Tableau Table calculations custom sorts

You should get this view:

Tableau Table calculations custom sorts

I’m going to re-sort my Month and Day date parts on Rows in ascending order to get the most current date at the top of each month pane. My table calculation does not change, still effectively going Pane (down):

Tableau Table calculations custom sorts

Let’s do a custom sort on our table calculation to change the order that the Running Sum computes across our data. I want it to sort in reverse order:

Tableau Table calculations custom sorts

Remember, the minimum is to satisfy the aggregation requirement for the sorting dimension. Minimum or maximum would have worked fine in this instance. This will give our table the current daily sales next to the MTD total, like so:

Tableau Table calculations custom sorts

I’m not interested in seeing the daily detail on every month. It makes the most sense to see the daily detail on the current month, but I want that month aggregated into a single monthly value. It’s best to start with our parameter to determine our level of detail by month:

Tableau Table calculations custom sorts

Let’s use our parameter in a calculated field to control the level of detail for that month:

Tableau Table calculations custom sorts

As well as a calculated field for Daily Sales:

Tableau Table calculations custom sorts

The Day Detail field will replace the day date part on Rows. And to put a little polish on our view, let’s drag the Sales table calculation onto our Data pane and give it a friendly name for our users. This is our final view:

 

 

What’s Next?

Be sure to check back on the InterWorks blog for more content on Tableau and table calculations. Leave any questions or thoughts in the comments section below. Cheers! 

Want More Tableau Deep Dives

  1. Tableau Deep Dive: LOD – Introduction to Detail
  2. Tableau Deep Dive: LOD – The Include Calculation
  3. Tableau Deep Dive: LOD – The Exclude Calculation
  4. Tableau Deep Dive: LOD – The Fixed Calculation
  5. Tableau Deep Dive: LOD – LOD Calculations vs. Table Calculations
  6. Tableau Deep Dive: Parameters – Parameter Overview
  7. Tableau Deep Dive: Parameters – Parameter Properties
  8. Tableau Deep Dive: Parameters – Filtering – Top N
  9. Tableau Deep Dive: Parameters – Calculated Fields
  10. Tableau Deep Dive: Parameters – Filtering Across Data Sources
  11. Tableau Deep Dive: Parameters – Bins
  12. Tableau Deep Dive: Parameters – Reference Lines
  13. Tableau Deep Dive: Parameters – Table Calculations
  14. Tableau Deep Dive: Sets – Introduction to Sets
  15. Tableau Deep Dive: Sets – Constant Sets
  16. Tableau Deep Dive: Sets – Computed Sets
  17. Tableau Deep Dive: Sets – IN/OUT
  18. Tableau Deep Dive: Sets – Combined Sets
  19. Tableau Deep Dive: Sets – Calculated Fields
  20. Tableau Deep Dive: Sets – Hierarchies
  21. Tableau Deep Dive: Dates – Introduction to Dates
  22. Tableau Deep Dive: Dates – Preparing Dates
  23. Tableau Deep Dive: Dates – More Date Functions
  24. Tableau Deep Dive: Dates – Exact Dates
  25. Tableau Deep Dive: Dates – Custom Dates
  26. Tableau Deep Dive: Dates – Rolling Dates
  27. Tableau Deep Dive: Dates – Calendar Filters
  28. Tableau Deep Dive: Dates – Week-by-Week Comparison
  29. Tableau Deep Dive: Dashboard Design – Planning
  30. Tableau Deep Dive: Dashboard Design – Layout & Structure
  31. Tableau Deep Dive: Dashboard Design – Proof of Concept
  32. Tableau Deep Dive: Dashboard Design – Adding Interactivity
  33. Tableau Deep Dive: Dashboard Design – Visual Best Practices
  34. Tableau Deep Dive: Dashboard Design – Optimization & Governance
  35. Tableau Deep Dive: Dashboard Design – Publishing
  36. Tableau Deep Dive: Table Calculations – Custom Sorts, Part One
  37. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two
  38. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Three

More About the Author

Robert Curtis

Managing Director, APAC
Building Solutions with InterWorks at Corinium’s Data Architecture Conference in Melbourne InterWorks was a proud sponsor of the Data Architecture Conference hosted by Corinium in Melbourne on 21 and 22 June 2023. Hundreds of ...
Virtual Event Recap: Deep Dive of Tableau Parameters For our June Lunch and Learn, we did a deep dive on parameters for our friends across Australia and Singapore. Tableau is the premier ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!