1 Reply Latest reply on Nov 13, 2016 5:15 PM by Chris Chalmers

# Gauge chart for table calc

Hey Tableau community. First post here, looking forward to getting more involved.

tl;dr question:

How do I create the origin mark for a guage chart that conveys the result of a table calc? I downloaded Adam McCann's amusing example (Dueling Data: Gauge Hate) and modified it for use with my data, but found that the table calc made my use case difficult. I have a gauge with a dot on the rim where I want the end of my pointer to be, but I can't figure out how to convince Tableau that there's another table-calculated (x, y) coordinate at the origin so that I can draw a line between them.

Why gauge?

I'm working with kart racing data. I have a series of calculations that estimate a racer's performance normalized by kart performance and track conditions. I then apply the RANK_PERCENTILE table calc to figure out where that racer stands among his or her peers.

I have a dashboard that displays a total of five of these percentile data points for a single specified racer (aggregate time, aggregate track conditions, aggregate adjusted time bias, best time, best adjusted time bias), and it has two problems:

1. It is not delightful. It's just triangles pointing at a 0-100% axes, completely bland. I have visualizations for my own use that are bland, but I'd like this one to be more engaging and intuitive. I want to show it off.
2. It is unclear whether 100% means "fastest" or "slowest". This has been a problem throughout my exploration of this data, because lap times and performance and inversely related (lower lap times = better performance). The percentile calculation only exacerbates the confusion by adding another level of abstraction.

My guage chart is a 0-100 speedometer, which is the best way I can think of to solve the above problems.

1. A speedometer is delightfully themed to the data.
2. When examining racing data, "high speeds" on a speedometer intuitively represent good performance.

I am concerned, however, that plotting a data point that is not a speed on a speedometer may be misleading. If you have ideas for alternate ways to solve these problems without using a dreaded gauge chart, I'm all ears! I'm looking forward to trying some different approaches.

• ###### 1. Re: Gauge chart for table calc

I came up with a solution after some fiddling. Union the datasource to itself to duplicate each row, then create a calculated field based on the "table name" column that identifies the rows you would like to represent the origin. I called mine is-origin. Throw is-origin on to level of detail. Now you should have two marks at the same place on your gauge. Modify your x/y calculations such that they produce 0 if is-origin is true. You will have to wrap the is-origin check in a table calc. i.e. LOOKUP(MIN([is-origin]), 0). That should move one of the points to the origin - done!

Duplicating the entire dataset is heavy-handed but makes the resulting data easier to work with. When I tried to union a single row into the dataset to represent the origin, I found that my filters always excluded it, because every entry in that row was null except for the table name and a dummy column.

There are probably cleverer ways to achieve this with joins or custom SQL, but this way worked for me!

See screenshot and attached workbook. Now that I've done it, I'm skeptical of value of the speedometer visualization. Getting it to work was a lot of fun though.