How to Label first bars of a set

When we create sets from dimensions, we sometimes want to label the first bar of each set alone. This can be done using the index function which is a table calculation. There are manual ways of doing this but the downside is that it renders it not being dynamic and that is where the strength of table calculations come to play.

Imagine I have a set of top 10 customers by sales placed on the colour mark after the creation of a bar chart.

Create Bar Chart
Create Customer set by sales
Drag Customer set on colour

Create an index and change to discrete to label the bars

We can now see our index labels broken down by the set.

Since we want to label only first bars which are labelled 1 by our index, we can now create a calculated field to do this. Before we create the calculate field, we must move index to detail mark.

Place calculated field on label and the task is complete.

I cant end this blog without acknowledging Tim Ryan who gave me this tip during one of our client projects.

I hope this tip came in handy and you will enjoy using it. Thanks for reading.

Author:
Michael Apau
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab