Allow the user to select which chart to see

I’ve often been asked to produce dashboards whose views change fundamentally based on the choices of the viewer.

For example, a user may want to select whether to show a line chart or a bar chart; or they may want to choose which secondary data source to use as the basis for reporting.

Often, such user requirements can be accommodated by being creative with your worksheet designs. And some of the posts here may help with some of that artistry. But sometimes, you may need to resort to presenting different worksheets depending on the user’s selection

This can be done with a few steps.

First, create two worksheets, one for each of the visualisations that the audience may wish to see: Chart 1 and Chart 2, if you will. Once you’re happy with these views, create a string parameter that allows the user to select which chart to show. And give it a list of values that it can take:

Parameter

And now, create two new calculated fields in the primary data source being used in the two worksheets: Chart 1 selected and Chart 2 selected. The fields will be boolean, giving a TRUE/FALSE value based on whether the appropriate parameter value has been selected.

Chart equation

Now you can use this field as a filter in Chart 1, with a value of TRUE. This will only show the chart if the value of the boolean variable is TRUE, or else if the parameter has been set to Chart 1. (You cannot use a parameter directly as a filter, hence this interim step.)

If you play with the value of the parameter, you’ll see the content of the worksheet appear and disappear. Repeat the above steps for the second chart, and the two worksheets will work in tandem with one another.

Next up, we need to get those charts into a dashboard.

First, they need to sit together in their own container, so you can select either a vertical or horizontal one, either is fine.

Panes

And now you can drag each of the worksheets into that container. Click on the dropdown at the top right corner of either chart to show the parameter control. By playing with the parameter value, you’ll see the respective charts appearing and disappearing.

Now unfortunately, the title of a worksheet appears regardless of whether the content of that worksheet is present, so you’ll need to hide the title on both sheets to ensure that the hidden worksheet fully disappears. If you want a title that’s consistent for the two views, then you can put this in as a Text component (see the above selector) above the container you’ve just created. If you want one that varies depending on the chart chosen, you can use a similar technique as this one to create automatically changing titles that sit in their own container.

And there you have it. The user can select a parameter value and the chart that they’re presented with will change in front of their eyes.

Solving the high-resolution usability issue in Tableau Desktop

This one has been driving me nuts for way too long. And today, I found a resource that solves this problem once and for all.

First, what’s the problem? Well, I have a Lenovo Yoga 3. And it comes with a lush 3200×1800 resolution screen. For the most part, it’s fabulous. But when I open Tableau, the user interface is horrible and unusable. Text in pills overlaps with the edges of the pills; the items in the panes on the left-hand side overlap with one another. The Show Me menu on the right-hand side almost invisible. And the pop-up messages, including the equation editor, are so small that they’re unusable.

But there’s a relatively simple one-time solution. And thanks to Dan Antonielli for helping out here. (He was having similar problems with the Adobe suite of products.)

Out of the box, Tableau informs Windows upon loading that it’s a DPI-aware product (DPI here meaning dots per inch). The solution makes Tableau think it’s not DPI-aware, which is basically the truth.

To solve the problem, we need to do two things. First, we need to create a new file in the system registry. And then we need to add a new file to the folder in which your Tableau executable sits. It sounds a bit scary, but it’s really not.

Here are the steps you need to follow:

First, creating a new entry in the registry:

  • Open the registry. You can do this by hitting Windows Button + R and typing regedit
  • Navigate to the following location: HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > SideBySide
  • Right-click the SideBySide folder and hit NEW > DWORD (32-bit) Value
  • In the new entry that appears, type the name PreferExternalManifest and hit Enter
  • Right-click the new entry and hit Modify
  • In the Value Data field, replace the 0 with a 1 and change the Base value to Decimal using the radio buttons
  • Hit OK and you can now close the registry.

Now we need to create a dummy executable in the Tableau folder:

  • First, download this file: tableaumanifest
  • Now move the file you just downloaded to the folder in which your Tableau Desktop executable sits. For Tableau 9, this is C:\Program Files\Tableau\Tableau 9.0\bin
  • Now change the name of the file to tableau.exe.manifest
  • If it gives a security warning, accept this.

Now, when you open Tableau, you’ll be presented with a delightful interface with fonts that look normal, pop-ups that you can read, and an interface that will let you create some magic.

Update: I did this originally on Windows 10. My computer just did an unprompted upgrade within version 10. And the fix stopped working. I was close to tears.

But apparently, the registry is overwritten with large upgrades, so you’ll need to redo that step if it stops working.

Happy days are here again.