Home > Tableau > Using Tableau SIZE to display nothing

Using Tableau SIZE to display nothing

This post is about the Tableau Size function being used to control whether data is displayed based on user filter selections.

This was inspired by a post on the Tableau Forum asking how to display nothing on a dashboard until the lowest level of detail is selected from a number of cascading quick filters.

In this case the questioner wanted a blank dashboard to be shown until a single City was selected, with the user using the filters to navigate from Region > State > City.

This is possible using the SIZE() function. Using ‘Compute Using’ enables the SIZE function returns how many of a given dimension are selected.

To set up your worksheet to only show the report contents when one item is selected do the following:

1. Set up the worksheet with data and filters required

2. Create a calculated field called Size. The formula should be one word, SIZE().

Tableau Size Function

3. Drag the City on to the level of detail shelf as we need this to calculate how many cities have been selected.

4. In this example, as we’re including Category in the view, this needs to be ‘Addressed’ in the Compute Using area and, as City is the level defining whether the data should be displayed, set City ‘At the level’.

Tableau Size Advanced Settings

5. Drag the Size calculated field to the Filters shelf, ensuring the Compute Using is set as above.

6. Set the ‘At most’ of the filter to be 1 – in other words if 1 city is selected data is shown, otherwise no data is shown

Tableau At Most Filter

Simple as that!

The City filter could also be set to be a single select filter as well. It is left here as multi select just to show the Size function in operation.

Categories: Tableau Tags:
  1. January 4th, 2016 at 16:15 | #1

    Hi Andrew, nice solution!

    An alternative that I’ve begun to use for situations like this is LOD expressions. In this example {EXCLUDE [Region], [State], [City] : COUNTD([City])} does the same as the SIZE calc without requiring knowing about addressing or having to put City on the level of Detail of the view. The tradeoffs are that the table calc requires knowing about addressing can introduce unwanted densification while the LOD can introduce an additional subquery that can be performance-prohibitive.

    I published the alternative at https://public.tableau.com/views/displayonlyonewithLODexpression/EXCLUDEforSingleCitySelect?:embed=y&:display_count=yes&:showTabs=y.


    • awatson
      January 4th, 2016 at 17:20 | #2

      That’s a nice solution as well Jonathan, thanks for sharing.

  1. No trackbacks yet.