Alteryx

Support question of the month conditional label sizing

At Inviso all our customers have access to our support imail and we get a lot of really good questions and (if we have to say it our selfs) we give some really good, simple and fast answers to these questions So why not share these very specific solutions to some very specific and everyday-like challenges? Well now we do. We are starting a new blog series called support question of the month, where we select a particular challenging, interesting or fun support question and share our solution.

To kick this new series off I want to share a support question from one of our very first customers. The support questions from this customer are no longer that frequent, but when they come they are always interesting and challenging.

The question was: How can i make the labels on my bubble chart vary in size just as the bubbles do ? i.e. bigger bubbles should have bigger labels so they stand out even more.

Solution

The solution here is made from Superstore sales data, where the size of the bubbles (and the labels) depend on Sales

Labels should vary with the size of the bubbles.Create a calculated field with sales as percent of total (either from scratch or by a quick table calc). This field will be used to size the bubbles and to condition the label calculations on.

pct of total sales

SUM([Sales])/TOTAL(SUM([Sales]))

1 Conditional label fields.It's possible to have multiple fields on label at the same time so the solution is to create three (or more) calculated fields that can all be placed on label at the same time. The fields are conditioned so that only one field will show text for each bubble at the time, the others will be NULL.

segment<20%IF [pct of total sales] < 0.2 THEN min([Segment]) END

segment20-39%IF [pct of total sales] >= 0.2 and [pct of total sales] < 0.4 THEN min([Segment]) END

segment40-100%IF [pct of total sales] >= 0.40 THEN min([Segment]) END

2 Multiple fields on label.Build the bubble chart with [pct of total sales] on size and all the three conditional label calculations on label.

3 Edit the label.By clicking the label box on the marks card you can edit the label. This means that you can set each of the label fields to have different size, color and font.

Even though we have three different fields with different font size placed on label, only one of these will be shown due to the conditions in the calculated fields. This means that our label size will vary as the segments percent of total varies i.e., as the bubbles change size.


Back to blog


Subscribe for updates