console.log("script ran")

dashboard / Design / FOR EVERYONE / LEARN / Other / Tableau

Tableau Barcode


What are those black lines slapped onto every product that we purchase these days? Barcodes

barcode is a method of displays data in a visual and machine-readable form. Initially, barcodes represented data by varying the widths, heights, and spacings of parallel lines.


During the 1930s and 1940s, the grocery industries was growing at a rapid pace. This required an accurate inventory tracking system in order to operate efficiently in an industry with already razor thin margin. Upon learning about the challenge that the industry is currently facing, Joe Woodland and Bernard Silver began working on an invention that would revolutionize not only the grocery industry but a retail industry as a whole. While sitting at a Miami Beach and brainstorming on the invention, Morse code came into Joe Woodlands mind and how a similar concept can be applied to address this challenge. Morse code is a character encoding scheme used in telecommunication that encodes text characters as standarized sequences of two diferent signal durations called dots and dashes. Basically, you can communicate using dots and dashes in a specifically orderd sequence.  Joe Woodland thought that if we can communicate complex texts via dashes and dots maybe we can develop an alternative version of this to do this same but in a shorter form (since Morse code texts usually ended up being page long even for a simple sentence). More on how he came up with the idea below:

The early barcode—the bull’s-eye version—would be round.


’I remember I was thinking about dots and dashes when I poked my four fingers into the sand and, for whatever reason—I didn’t know—I pulled my hand toward me and I had four lines. I said ‘Golly! Now I have four lines and they could be wide lines and narrow lines, instead of dots and dashes. Now I have a better chance of finding the doggone thing.’ Then, only seconds later, I took my four fingers—they were still in the sand—and I swept them round into a circle.’


The first real-life test of RCA’s bull’s-eye bar code was at the Kroger Kenwood Plaza store in Cincinnati.


It was not feasible for the mass market due to the technical challenges at the time. Whilst the circular form could be read from any angle, the printers would smudge the ink, rendering the code unreadable regardless of orientation. Industry giant IBM wanted to develop a user-friendly digitally-readable code that could be more easily scanned.

It all changed when IBM Engineer George Laurer developed a rectangular code. It addressed the core challenge of the Bull’s Eye Bar while delivering the value that Bull’s Eye bar wanted to deliver. It could hold the necessary data, while being smaller than a bull’s-eye and eliminating challenge of ink smearing.


How was the Bar Code born in Tableau?

Barcode view allows you to see proportions and differences across multiple hierarchy levels at a glance.



I used our well-known Superstore dataset. The viz displays the Product Category hierarchy. The longest bars mean the highest hierarchy level while the shorter bars represent the subcategories within the specific category and the width means the Sales value.

These are not simple bars that are eventually becoming polygons. How can we make them?

  1. We need to define the 4 points of a bar/rectangle form. I used union solution.

2. Before we put the data points to a coordinate system – to Rows and Columns – we need to merge the two different Product levels into one field. We use the first 2 tables for the Categories and the other 2 for the subcategories and then for a little formal distinction, the main category gets a bullet point. This will help differentiate between levels even in the headers.

3.We are ready to plot the 4 corners of the bars.

A simple index function helps us to define the path for the corner points of the bars/rectangle forms.

  • Y: assigns the different height to the different product levels. Main Category height is 1.3 units while the Sub-Category is 1 unit.
  • X= width means the Sales value.

4.Put the X and Y to the Rows and Columns.

5.Drag the Path to the Detail shelf.

6.Then change the mark type from dot to polygon and we are done.

▮▮▮▮ We have our own BAR CODE in Tableau. ▮▮▮▮

Only the polygon solution is looking good for the automatically generated phone layout.

Let me show you an other great example for using polygons for different layouts from Klaus Schulte’s  Public Gallery:Polygon Waterfall Chart

Thanks for reading the whole story!

If you want to collaborate or talk about dataviz tips , you can say a Hi!✌️




Ivett Kovács

I love taking datasets into beautiful and informative visualizations. Besides data, I am also very passionate about traveling, surfing, cooking and exploring the outdoors with my dog.

Comments (11)

    Pingback: #data19 - Surprise Me: Creating Advanced and Unique Charts -

    Pingback: 2020 Week 22: Profitability spotlight – is your budget recovered? – Workout Wednesday

  • May 27, 2020 by Kapila


    how to calculate Sum sales (densified)?

    • May 27, 2020 by Ivett Kovács

      Ivett Kovács

      Hi Kapila,

      that is the PREVIOUS_VALUE(SUM([Sales])) and compute along the Path field.

  • May 27, 2020 by Daniel


    Hi, it seems like there is a “path” and “path index” field. May I know how do we calculate the “path” field?

    • May 27, 2020 by Ivett Kovács

      Ivett Kovács

      Hi Daniel,

      That information is in the post.
      -PATH is a bin (from your 4 Tables)

      I hope this can help you.

      • May 27, 2020 by Kapila


        Not clear, could you explain how to calculate “Path”

  • May 27, 2020 by Daniel


    Are you able to enable the “download” function in your tableau public so that we can download the workbook to explore ourselves? some of the calculations are missing from your blog.. a bit confusing to us..

    • May 28, 2020 by Ivett Kovács

      Ivett Kovács

      Hi Daniel,

      Let’s start with this report to understand the method:

  • May 30, 2020 by Daniel


    RE: -PATH is a bin (from your 4 Tables)

    How do you create a bin from the 4 tables? bin can only be created from a measure right?

  • Pingback: Making waves with Fourier Series, Part 2 – Rods, cones and a couple of neurons

Your email address will not be published.