Menu

Alison Pitt

×
Anyone for fruit salad?

Anyone for fruit salad?

How to create a default set of display data in a lengthy data set

Alison Pitt - Admin September 1, 2020

Sometimes, you just have more data than you want to display all at once. Maybe you want to be able to filter it, but when you un-filter, you still want to restrict the total number of records you display. In that case, you might want to be able to specify a default set of data, so that your users get a sensible subset of your data in a readable format.

I used this technique recently in my interactive resume, where I wanted to allow users to search and display data from any of my past ventures, but when they weren’t explicitly interacting with the timeline, I just wanted to show my university education and my most relevant four jobs. In that case, the format of the dashboard/resume really didn’t allow for more than 5 records to be displayed comfortably, so I wanted to make sure that my users saw only the most relevant information.

Using Tableau, you can specify a default set of records to display, and set up your dashboard filter to use it.

via GIPHY

Limitations of this method

The method I’ll show you, below, is only good for cases where a filtered result set is smaller than the total number of records you want to display. For a demonstration, I’m using a list of fruit of different colors, which you can filter on a dashboard. In this case, the number of fruits of each color should be less than the size of the default set, otherwise the filters won’t work as intended. In pseudocode:

size ( any filtered set ) <= size ( default set )

The data set

In this example, I’ve used a list of 10 fruits, their descriptions and their colors. I’ll use the colors to filter the fruits on a dashboard, but I only want to display a default set of 5 of them when the color filter is off.

Here’s my data:

A simply fruity data set

A simply fruity data set

(Feel free to download it for yourself!)

I want to specify a default set of fruit:

  • Apple

  • Banana

  • Grape

  • Orange

  • Strawberry

To make this default set work with our color filter, we need to take the following steps:

  1. Create a set that includes just the default values

  2. Create a boolean calculated field to judge whether we should display the normal values or default values

  3. Set up our filter as a context filter

Get set and set up the default set

In Tableau, create a new set called “Default Fruit” from the Fruit dimension that looks something like this:

Set up the Default Fruit set in Tableau

Set up the Default Fruit set in Tableau

Create the boolean calculated field and use it as a filter

Next, create a boolean calculated field that checks how many records you have. If it’s higher than your threshold, then it’s true when something’s in your default set and false otherwise. If the number of records you have is less than or equal to the threshold, then it’s always true.

IF { COUNT([Fruit]) } > 5
  THEN [Default Fruit]
  ELSE TRUE
END

Note the use of the fixed level of detail (LOD) calculation on COUNT([Fruit]). That’s to ensure that it’s counting the number of records at the highest level of detail after the context filter (which comes next).

Set up the color filter as a context filter

For this part, set up a dashboard with two sheets.

The first sheet is simply a listing of colors, with nice big marks to look like buttons:

Nice, big buttons!

Nice, big buttons!

Then on a dashboard, set the big buttons sheet up as a filter:

Use the big colored buttons as a filter

Use the big colored buttons as a filter

Then (and this is the most important part!), make sure to go into the Fruit worksheet and make the Color filter action into a context filter by right-clicking on the filter pill and clicking “Add to context”:

Context filters are your friends!

Context filters are your friends!

If you’re not very up on your context filters vs. LOD calculations, start with the Tableau help page!

Et Voilà!

Your default set should work. Remember, if your filtered sets are bigger than your default sets, this method won’t work as intended. Otherwise, this is a really handy way to control the formatting of a dashboard with a lot of information on it!

In Data Viz Tags Tableau
← 7 things you can do to up your data game while job searchingA different kind of data viz →

Search

No results found
Post Archive
  • May 2024 1
  • September 2023 1
  • June 2023 1
  • May 2022 1
  • January 2022 1
  • October 2020 2
  • September 2020 2
  • August 2020 2
  • July 2020 7
  • June 2020 4
  • November 2017 5
  • October 2017 4
  • September 2017 4
  • August 2017 1

Featured Posts

Featured
How to Set up a 2-Record Seed to do Math in Tableau
Data Viz
How to Set up a 2-Record Seed to do Math in Tableau
Data Viz

When you’re exploring math concepts in Tableau, you don’t necessarily need a full data set to do it. Here’s how to use a 2-record seed to create an expanding data set for all your math exploration needs (in my case, learning about triangular numbers).

Read more →
Data Viz
An Exploration of Incomplete Open Cubes
Data Viz
An Exploration of Incomplete Open Cubes
Data Viz

For a recent JLL viz challenge and Iron Quest, I explored an Alteryx + Tableau recreation of Sol LeWitt’s “Incomplete Open Cubes” (1974). I created all the cubes, then I visualized them in Tableau; this is how I did it.

Read more →
Data Viz
What size dashboard should you use for a nice Tableau Public thumbnail?
Data Viz
What size dashboard should you use for a nice Tableau Public thumbnail?
Data Viz

It’s not obvious what dashboard aspect ratio to aim for if you want a nice-looking thumbnail on Tableau Public, but I did some digging and found the best one. For now, at least.

Read more →
Data Viz
Let's talk about recovering from setbacks
Audio Production, Data Viz
Let's talk about recovering from setbacks
Audio Production, Data Viz

I scrapped a whole video because it wasn’t up to scratch. Afterward, I made a video about not making a video. Let me explain!

Read more →
Audio Production, Data Viz
7 things you can do to up your data game while job searching
Data Viz
7 things you can do to up your data game while job searching
Data Viz

So, you’re a data nerd, you’re looking for a new job, and you just reached the end of the list of jobs to apply for. What do you do next? This is exactly the situation that I have found myself in several times in the last few months, so I thought I’d compile a list of the things that I’ve done to keep myself engaged while in a lull.

Read more →
Data Viz
Visualizing Star Trek
Data Viz
Visualizing Star Trek
Data Viz

It’s no surprise that I’m into Star Trek. So what happens when my love of data collides with my fandom? I make a viz that turns the scripts of my favorite movies into an explorable piece of art.

Read more →
Data Viz
A few pitfalls of the small data set
Data Viz
A few pitfalls of the small data set
Data Viz

Think a small data set is easier to visualize? Think again. You have to pay as much attention to what’s NOT in the set as what is…or you risk misinforming your audience! This article explores some of the recent pitfalls I tried to avoid in the latest Makeover Monday challenge.

Read more →
Data Viz
Vintage Viz: Beautiful rings on your Linux desktop with Conky
Data Viz
Vintage Viz: Beautiful rings on your Linux desktop with Conky
Data Viz

System stats can be beautiful, too. Once upon a time, I used Conky on Ubuntu to visualize things like memory usage, disk space and battery percentage, rendered as dynamic rings right there on my desktop.

Read more →
Data Viz

Affiliate disclosure - Privacy policy - Terms of use