Tricks + Miscellaneous Techniques

Tricks + Miscellaneous Techniques

These are either single tips or chunks of techniques that don’t have their own page yet.

Be sure to check out the following sources of material on the Tableau Community:

Get last value in dataset

Fixing axis size

Use an invisible reference line, either based on a constant or a calculated field. Tableau will make sure the axis range is big enough.

Show the same day last year in a view

Get max value of [Date] no matter sort order:


Finding lowest values of a top N:

Hide the Abc column

  1. Create a calculated field with just a space
  2. Put that field on the Columns shelf and on the Text shelf
  3. Uncheck Show Header
  4. Drag the column left to shrink it

Showing most recent data

Doing a count of Distinct values via table calc (w/out using extract)


Set Compute Using to A

Time and Date:

One calc to generate hh:mm from a time:

str(int([Time])) + ":" + str(([Time]%1)*60)

Also, from Dan Cory in this thread

 (FLOAT([Time DateTime])+2)*24*60*60

This will be much faster than using DATEPART but will only work for some databases. The FLOAT converts the Date & Time field to a number, using the rules of the database. The +2 is because times are stored as dates on Excel’s zero day, but Jet’s zero day is two days later. The *24*60*60 is because you get a result in days and it has to be converted to seconds.

Rolling calculations:

Moving average of running average:

Queue length/census: – original thread w/Richard Leeke

Use different breaks on time, e.g. ½ hour, 6am to 6pm etc. – do a manual sort on the times, idea by Alex Kerin:

Another Alex post on padding for hours
Richard’s approach was to create a day/hour/minutes table at the level of granularity needed for reporting, then join to that with Custom SQL like this (for the hours table). I think of this as “generate a row for every event/time bucket” combination. So if you want to report down to the minute, there’s a row for every event+minute that the event occurs in.


Getting the total for a count(distinct) where we want to find the # of unique kinds of X across Y dimension

create a new calculated field Y+X (it’s a string) and then do a COUNTD() on that.

Making grand totals do anything you want (via table calcs)

This section is basically deprecated by some posts I wrote, here’s the first one: Customizing Grand Totals – Part 1.
Workbook is: Top as Percent of Total jtd edit

Variation on this since grand totals run at a higher level of aggregation, when using table calcs it is a visual total

Joe Mako’s workbook is control of Grand Total.twbx

Another Joe Mako workbook on doing this from June 2012:

And Dimitri’s edit:

A workbook where I did both the hack and “put the Grand Total in a separate worksheet on a dashboard” technique:

And here’s an Idea to have the totals show what is visually displayed in the view:

Putting Grand Totals as left-hand column or on top (as a separate header via custom SQL)

Duplicating a dimension to preserve level of detail in table calcs

workbook is blanding (2) jm edit.twbx

Bar chart and KPI on same row (without dashboard)

Use dual axis
files: utilization_bar_chart_and_kpi_dc.twbx, and utilization_example_dashboard_packaged_rl.twbx

Dynamic Top X and Bottom X labels

Make axis name dynamic, i.e. based on what’s chosen in a parameter

Custom title for second axis in dual axis chart

Anonymizing data

Counting Overlapping Marks


Fake fill down

Fill Down calc:

if isnull(attr([Amt])) then previous_value(attr([Amt])) else attr([Amt]) end

then can use LOOKUP([Fill Down],-1)


from TCC11 – JediTricks video

Custom Colors – site for picking colors

Tableau blue:

31/119/180 in decimal

Lots on statistics

use parameter to Partition day into even chunks – Richard Leeke post

Use URL actions to create emails

Adding an All parameter option in Tableau


Page Shelf

From Think Data Thursday #4, 9/13/12

To use the Page Shelf to create lines, one suggestion is to use circle marks, the Path Shelf, and then history to make the lines.

Size shelf
From Shawn Wallwork – Can get more choice about sizes by creating dummy discrete elements/rows in the view

putting commas back in numbers for STR([number]):
nice function here:

lots of good stuff on custom number formats

using the path shelf

Linking to files:


Unit PI plans are on X:\QM Data\MS3\Unit PI Plan\MS 3 Quality PI Plan Q4 CY11 .docx
Can link to file (opens in Word) using file:///X:/QM%20Data/etc. where the string is URL encoded

Trend lines – post by Catherine Rivier

Stripping the date to get just the time – from Alex Kerin



Using a parameter for a dynamic in-line caption – users can enter their own annotation

Using a reference line or annotation to create arbitrary borders and lines (posts by Joe and I)

Showing/hiding annotations by using a duplicated calculation, one has the annotation the other has the point.

Making CASE statements

WhenMaker from DecisionViz!whenmaker/ct1k

using two measures to color the same mark (set a color, then overlay marks w/transparency)

Pinning a bar to the top/middle/bottom of the pane to leave room for a reference line

[loop category=”wikicontent” tag=”tricks,techniques,misc,reference-lines,ref-lines,captions,general”]
[field title] – Added [field date]

Related posts:

    [loop tag=”tricks,techniques,misc,reference-lines,ref-lines,captions,general” exclude=”this” relation=”and” compare=”not” taxonomy=”category” value=”wikicontent”]

  • [field title-link][field thumbnail-link]


One thought on “Tricks + Miscellaneous Techniques

Please add your thoughts and perspectives