Use set, if you don't like filtering a lot!

by Tram Nguyen

When I was creating my viz, I always wonder myself, how to see and highlight the data pattern with tightly specific conditions which the normal filter could never meet. Thanks to set you can compare and ask questions about a subset of data. Sets are custom fields that define a subset of data based on some conditions. Today I’m walking you through a simple example of how set makes life of an analyst easier.

Let’s begin with the superstore dataset. The question would be how to highlight the product IDs that have discount of more than 10% and belong to segment Small Enterprise without creating 2 filters.

To create a dynamic set:

1. In the Data pane, right-click Segment and select Create > Set. Name it Small Enterprise.

In the Create Set dialog box, configure your set. You can configure your set using the following tabs:

General: Use the General tab to select Small Enterprise that will be considered when computing the set.

You can alternatively select the Use all option to always consider all members even when new members are added or removed.

2.       Create another set, Discount >10%, which uses Condition to define rules that determine which members to include in the set. In this case, you may want to define a condition based on the field total discount > 10%.

3.  Combine two sets. It is important to note in this step that both sets must use the same dimension (Segment).

Right-click on the set and choose combine sets. Name it to Small Enterprise & Discount > 10% and choose the inner join between the two set, then click ok.

4.   Finally, drag the combined set into color field of the mark card. After that, right-click on the combined set in the data pane to choose option show filter.

Now the gray circles indicate the out of set share, which does not meet the condition. That means, the blue circles highlight the product ID having discount greater than 10% and categorized as small enterprise.