A new way of using Reference Bands in Tableau

Inspired by Challenge 48 in WorkoutWednesday, I wanted to blog about how this challenge opened up a new way of using reference bands in Tableau.

After learning how to create a waterfall chart in Tableau (see previous post here), the next challenge I had was finding a way to build this “profitability bridge”.

At first, I thought that the lines were made of a “line mark” in Tableau and then formatted to look like a dashed line. However, this was not possible. Next, I thought of using drop lines, however, I could not format it and cut it to only draw a line for the current sub-category as well as the next sub-category.

I finally realised that the way to format a line the way the target view had it, was through using a reference line!

When I first created a reference line, it looked something like this:

This was close, but it only covered one sub-category at a time. I needed a way to include the bottom half of the second sub-category.

To do this, we need a way for Tableau to recognise the bottom bit of the “next” sub-category. I knew that I could figure this out by using this logic:

The running sum of the sales – sum of sales

I then created this calculated field:

So now, we have a calculated field that we can use to refer to in the reference line to extend it to the “next” sub-category.

I then clicked “edit” on my current reference line. There was a problem – if I use a reference line, I can only refer to one calculation at a time – this means that I would not be able to extend my reference line to the next sub-category. I needed another function that would allow me to refer to 2 calculated field.

Enter –> Reference Bands

I set my reference band to first refer to the first calculation which the normal SUM(Sales) and the second one to refer to my newly calculated field: “Sales for Ref Line”. This was the result:

The line had successfully extended to include the “next” sub-category.

Set your labels to “none” and set your fill option to “none”.

And there you go – a new creative way to build a bridge using reference bands.

This was the final product. Check out the viz here.

var divElement = document.getElementById(‘viz1552000615065’); var vizElement = divElement.getElementsByTagName(‘object’)[0]; vizElement.style.width=’500px’;vizElement.style.height=’827px’; var scriptElement = document.createElement(‘script’); scriptElement.src = ‘https://public.tableau.com/javascripts/api/viz_v1.js’; vizElement.parentNode.insertBefore(scriptElement, vizElement);

2 thoughts on “A new way of using Reference Bands in Tableau

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s