Hello everyone,
I'm trying to build a highlighting logic in Tableau and would appreciate any suggestions.
I have an employee score, and I want to highlight the row corresponding to the decile in which that score falls.
For example:
- Employee Score (V2A) = 100.399
- Month = June
- This score falls between:
- ----INCENT_V2A_DECILE_5_MIN
- ---INCENT_V2A_DECILE_5_MAX
- Refer to column D i.e METRIC=MTD and for decile column f Decile
- Therefore, I want to highlight the this columns row.
In my data:
- Column E (V2A) contains the employee's score.
- Columns G–Z contain the Min and Max values for each decile.
For example:
Original Column Display
INCENT_V2A_DECILE_1_MIN 1
INCENT_V2A_DECILE_2_MIN 2
... | ...
INCENT_V2A_DECILE_10_MIN 10
I want Tableau to compare the employee's V2A score against each Min/Max range and highlight the row where the score falls.
For example:
IF [V2A] >= [incent_v2a_decile_5_min]
AND [V2A] <= [incent_v2a_decile_5_max]
THEN Highlight Decile 5
However, I have 10 deciles (20 Min/Max columns), and I'm looking for a scalable or elegant way to implement this in Tableau rather than writing a long IF statement.
Has anyone implemented something similar? Would you recommend pivoting the decile columns first, or is there a better Tableau approach?
I've attached a sample of my data for reference.
Thanks in advance!
Sample output
#Tableau Public
Hi, @Anjule Bhardwaj
Are you looking for something like the attachment? Please take a look.
<pivot>
*Because I was unable to access the data in the attached workbook, I’ve used dummy data on my side. Please note this.
<result>
<calc>
<other setting>
I used a small technique to apply highlighting to the range labels as well. By adding a “0” as a dimension in the column, you can assign separate fields to each part and display them individually. I used one field for the range label and another for the value.