Chapter 53. How to Create and Compare Segments

Here’s the scenario: The dataset that you’re working with in Tableau has several dimensions that represent different customer segments such as married versus single, new versus returning, customer score, or whatever segments are important to your business. It’s good that these dimensions are available to slice and dice the data by, but it’d be great if you and your end users could change these on the fly, without having to drag and drop the segment of interest onto the view every time you wanted to slice the data by a different segment. It would be even more amazing if you could somehow create a segment hierarchy, allowing you to drill down to different combinations of segments (i.e., Married or Single in the first column drills down to Married or Single, plus a second column for New or Returning).

Solution: Parameters will be our solution to dynamically create and compare segments. In this case, we will create two string-based parameters that will be used to create our combinations of segments:

  1. Create a parameter for segment 1.

    For demonstration purposes, I am going to use the dimensions available out of the box with Tableau’s Sample - Superstore data. You will likely have segments that are more practical in your data, such as the examples mentioned in the opening sentence of this section (marital status, new versus returning, etc.).

    Create a string parameter with a list of the dimensions you want to be able to use in your segmentation: ...

Get Practical Tableau now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.