10 Replies Latest reply on Dec 10, 2015 10:02 AM by Paul Rau

# Label Marks - Every 4th Point??

Hi Everyone,

A random question on Label Marks - the default options to display a label on a chart (a line chart for example) are:

1) All

2) Min/Max

3) Line Ends

4) Selected

5) Highlighted

6) Most Recent

Is there a way to work-around, and display a label a certain number of points (say show the label for every 4th point)??

Thanks for your help/any thoughts on this!

Paul

• ###### 1. Re: Label Marks - Every 4th Point??

You can do it with an INDEX() table calc, although there might be other ways to do it. This is one of them:

Since it is a table calc, you can set the compute using to however the pills are placed on the view. In this case pane(down) because I want the 4th point to be labelled for each year.

• ###### 2. Re: Label Marks - Every 4th Point??

Additionally, instead of hardcoding the 4th point you can also use a float parameter to keep the label points variable.

• ###### 3. Re: Label Marks - Every 4th Point??

Hi Pooja,

This is great! Any suggestions on how to set the Calculation to repeat the label again (label shows up at the 4th point, the 8th point, the 12th point, etc.)??

Paul

• ###### 4. Re: Label Marks - Every 4th Point??

Paul,

You can use a calculated field with Index() and a modulo operator (%), as shown below. Here's a KB article for more on how that works: Modulo Function in Tableau Software | Tableau Software

Robert Rouse

InterWorks, Inc.

1 of 1 people found this helpful
• ###### 5. Re: Label Marks - Every 4th Point??

Hello Paul,

My method is very similar to Pooja's, but my interpretation of your question is different.

Paul Rau wrote:

(say show the label for every 4th point)??

If you want it every 4th point, then you can use a calc like this

IF INDEX() % 4 = 0 THEN SUM([Sales]) END

This way, you only generate a value when the mark is Divisible by 4 (Aka every 4th point).

Regards,

Rody

• ###### 6. Re: Label Marks - Every 4th Point??

Beat me to it Robert!

• ###### 7. Re: Label Marks - Every 4th Point??

Paul,

Robert's and Rody's suggestions are great and should work for you as desired: Just to add to it though, you can still implement a parameterized solution to keep the label position variable (if you need it) and not fixed at every 4th position. Just switch the 4 in their calculation to a float parameter and you can repeat the label position every value mentioned in the parameter.

Thanks,

Pooja

1 of 1 people found this helpful
• ###### 8. Re: Label Marks - Every 4th Point??

Hi Pooja, Thank you for your help w/ this!

Paul

• ###### 9. Re: Label Marks - Every 4th Point??

Hi Rody, thank you for your help w/ this!

Paul

• ###### 10. Re: Label Marks - Every 4th Point??

Hi Robert, excellent, thank you for your help w/ this!

Paul