• Tableau Quick Tip: Create a Gap in Tabular Reports

    Ever design a table in Tableau and wish you could insert a gap between columns or rows? Maybe you want to show several values, but set one apart from the others. Something like this:

    Gap in Columns

    Or maybe you want to create some space between categories, like this:

    02 Gap in Rows

    Whatever the reason, in some cases, it’s actually quite easy. Assuming that you are using Measure Names / Measure Values to define the rows or columns, all you need is a Measure that gives you the “gap”.
    You might think to use a blank string (e.g. “”), but even as a measure (e.g. MIN(“”)), that can’t be added to the Measure Values shelf which only takes numeric values.
    You might use NULL, but by itself you can’t add that to Measure Values either. The trick, is to cast NULL as a numeric value. So create a calculated field with the code:

    INT(NULL)
    That tells Tableau to have a null value, but the type is integer. Now you can add it to Measure Values and get the gap you want:

    In this view, the field is named Null Gap, but has been given the alias of a single space so the header is blank (right click the header and select “Edit Alias” or use the drop down field on Measure Names to edit all aliases). Alternately, you could simply have named the field with a single space.

    And finally…

    • Want to see the workbook in action or download it? It’s here!
    • Not so fond of text tables and want to transition your boss / client / yourself to something more visual?  Check this out!

    Hope this helps!
    -Joshua

2 Responsesso far.

  1. Matthew says:

    This is brilliant, and thanks for sharing. INT(NULL)… I’d have never thought of that. I’m a bit torn as to whether this is one of those “Wow, look how flexible and data-driven Tableau is!” features, or another “Why did I need a hack to do this? Why are simple things sometimes so hard?” workaround.

    • benmelek_admin says:

      Yeah, I know what you mean. This is a case where I think it’s a data driven design and you can leverage that to get the flexibility you need.

Leave a Reply

Your email address will not be published. Required fields are marked *