5

Dynamic Zone Visibility Dashboard

 1 year ago
source link: https://datavis.blog/2022/11/30/tableau-dynamic-zone-visibility-dashboard/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

This post steps through my approach for creating the dashboard from this video that contains a number of dynamic zone visibility (DZV) calculations. For an introduction to this feature, please see my previous post.

Five Analysis Scenarios

This example uses five scenario calculations. The purpose of these calculations is to uniquely identify five different analysis scenarios, each representing a different way of exploring the same dataset:

  1. Focus on a single sub-category 
  2. Comparison of multiple sub-categories
  3. Compare a category or sub-categories across all regions
  4. Focus on a single region
  5. All sub-categories at the order ID level of detail

Below is an image of the same dashboard with each of the five scenarios showing based on a different selection of marks.

  • 005-dzv-five.png?w=736
  • 000-dzv-one.png?w=736
  • 002-dzv-two.png?w=736
  • 003-dzv-three.png?w=736
  • 004-dzv-four.png?w=736
  • 005-dzv-five.png?w=736
  • 000-dzv-one.png?w=736

These scenario calculations are shown later in this blog. They depend on a number of other calculations, however, which I’ll cover first.

Total Dimension Values

This first set of calculations returns the total number of each item in the dataset, for example, total regions:

01-total-regions-lod.png?w=376

Similar calculations are created for: 

  • Category
  • Sub-Category
  • Region + Sub-Category  (this is a concatenation of these two fields)

Number of Dimension Values Selected

This next set of calculations returns the number of each item selected, for example, total regions selected.

  • Create a set based on each item, for example, s.Region based on the field Region.
  • Create the below calculation which counts the distinct number of that item in the set.
  • Create a set action on the controlling chart to update each set.
04-regions-selected.png?w=575

Similar calculations are created for:

  • # of Categories Selected
  • # of Orders Selected
  • # of Sub-Categories Selected
  • # of Region + Sub-Categories Selected

Enable Allow selection by category

In the section above I mentioned creating a set action to update the relevant set for each dimension. These set actions can also be triggered by selecting the relevant dimension in the tooltip if Allow selection by category is enabled in the tooltip:

07-tooltip.png?w=548

Five Analysis Scenario Calculations

With the above calculations created, we can now move on to the five scenario calculations. 

The calculation for each scenario returns either True or False. If True, then the container that contains the charts for that scenario will show and all other containers will not show as their respective calculations will return False.

Notice that all calculations are wrapped in a fixed LOD. See my previous blog post for more on the requirements for dynamic zone visibility calculations but, essentially, each calculation can only ever return one single result across the dataset.

One caveat here. The purpose of building this dashboard was to experiment and demonstrate some use cases for DZV, so these calculations won’t account for every possible use case including filtering the data source or using them with other data sources. Please adjust as needed for your own use cases. 

Scenario 1 – Focus on a single sub-category

Condition: A single sub-category is selected.

05-scenario-1.png?w=397

Scenario 2 – Comparison of multiple sub-categories

Condition: Multiple sub-categories are selected, however, not a combination of sub-categories that satisfy the conditions for scenarios three, four or five.

05-scenario-2.png?w=465

Scenario 3 – Compare a category or sub-categories across all regions

Condition: The same sub-category is selected across all three regions OR all sub-categories within a category are selected across all three regions.

05-scenario-3.png?w=480



05-scenario-3a.png?w=503



05-scenario-3b.png?w=697

Note, there is a parameter action in place here to capture the Category that the user selects.

Scenario 4 – Focus on a single region

Condition: All sub-categories are selected within one region only.

05-scenario-4.png?w=552

Scenario 5 – All sub-categories at the order ID level of detail

All sub-categories across all regions are selected. 

05-scenario-5.png?w=712

A few extra calculations

Aside from the five main scenario calculations, there are a few other calculations:

  • 3a and 3b control which title is shown at the top of the scenario three container as it can be either for a single sub-category across regions or for all sub-categories within one Category across regions. These two calculations are applied directly to their respective text objects and not the container.
  • 5a and 5b control which chart is shown underneath the scatter plot in scenario five. If five items or fewer are selected, a table is shown. If more than five marks are selected, the strip plot is shown. These two DZV calculations are applied directly to the respective charts that they control the visibility for.
  • Again, all the above calculations return either True or False based on the marks selected.
05-scenario-5a.png?w=389



05-scenario-5b.png?w=377

Create one Container of Charts per Scenario

The collection of charts that you want to show for each scenario should be placed in their own container. When the dashboard is complete, each of these five containers will occupy the same space and position (for this example), however, when creating and populating them with charts, you may find it easier to place the containers side-by-side, as below, or to float the active one you are working on so it’s on top and then tile it in with the others as you go:

08-five-containers.png?w=1590

Apply Dynamic Zone Visibility to each Container

Select one of the containers and, in the Layout panel, check the box labelled Control visibility using value. Then, from the menu below, navigate to the corresponding boolean calculation. Here, I have the container for scenario five selected so am selecting calculation 5 from the list. Now this container will only show when that calculation returns True, i.e. when all sub-categories across all regions are selected in the view. 

09-dzv-scenario-5.png?w=482

Repeat the above process for each container, with one dynamic zone visibility calculation assigned to each container. As you do this, you’ll see that each container will disappear except for the one container that meets the current selection state. You can then format the view and sizing as needed.

Apply Dynamic Zone Visibility to Headers or Charts

In this example, for scenario three I use the same container of charts but the header/title changes based on if the user has selected one sub-category across all three regions or if they have selected all sub-categories within the same category across all three regions. Therefore two titles are created and the relevant visibility calculation applied to each text object: 

10-dzv-header-3.png?w=481

For scenario five, I also show one of two charts underneath the scatter plot based on the number of order IDs selected. 

  • Fiver or fewer orders shows a table of details
  • More than five orders selected shows a strip plot chart

Therefore DZV calculations are applied to each of these charts – 5a and 5b in the above screenshot.

Conclusion

Dynamic Zone Visibility is a powerful new feature with many possible use cases for customising and personalising the dashboard experience. I hope the above examples were useful. I’ll create a video tutorial soon that steps through some of the above creation process. If you have any questions, you’re welcome to contact me on Twitter or LinkedIn (links below).

Thanks,
Marc 

Latest YouTube video: 2 minute overview of this new 2022.3 feature and examples use cases


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK