Sets

Sets are custom fields that are used to define a subset of data. The defined subset can be dynamic or static and can be used to create different visuals. We can also combine multiple sets. Sets have the advantage of being reusable across all worksheets, and they get added to the dataset's metadata too.

Dynamic sets: These are sets based on certain conditions that can lead to different results as the data changes. Top n or Bottom n sets are common use cases of this. For example, what percentage of the total sales came from the top 10 countries?

To solve this, we will create a set for the top 10 countries by sales first. Right-click Country, select Create and then Set. Then, under Create | Set, rename the set Top 10, and go to the Top tab. In the Top tab, we will define the condition for the set. Select By field, and change the field to Sales. The aggregation automatically changes to Sum. Click OK. Refer to the following screenshot for the steps:

You will notice that, under the Sets category, a new set has been created:

Once you bring this to the shelf, it will show two values: In/OutIn includes values for all members within the set, and Out is for all numbers not in the set. To view the percentage of sales by the top 10 countries, we will now add SUM(Sales) to the graph and create a quick table calculation by right-clicking SUM(Sales)| Create Table Calculation | Percentage of Total. You should get the results shown here:

This gives us the result showing 66.89% of the total sales come from just the top 10 countries. Instead of seeing the values in terms of In/Out, to see the actual set members, right-click on the set and select Show Members in Set.

Static Sets: These sets have fixed members. For example, in the preceding example, if instead of having the top 10 countries set using a condition, we would have selected the United States and the United Kingdom in the General tab, and it would have become a static set:

 

Another way to create such a set is from the visual directly. Select the values you want to group and select Create | Set. Once you select this, it gives you additional options to exclude such values or to add them to the Filter shelf and more. An example of where this is useful is to identify outliers in data and then, using the set, exclude them from other visuals as well:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.151.126