11 Replies Latest reply on Jun 29, 2017 6:16 AM by Diogo Braga

# Diagonal Banding (not row or column) using different colors

I am trying to create diagonal banding to represent different cohorts. I am getting close as you can see the on the screenshot, but now I need each cohort (each diagonal line) to be represented by a different color (probably different tones of the same color).

How can we do that in Tableau?

• ###### 1. Re: Diagonal Banding (not row or column) using different colors

Hi Diogo

I hope I understand you request correctly..

Thanks,

Shin

• ###### 2. Re: Diagonal Banding (not row or column) using different colors

Thanks Shinichiro Murakami! This is helpful.

If possible, the ideal scenario would have a slightly sharper contrast between each diagonal. The example below is showing 2 rows with the same color, but each row should have a different color tone, like your example. But now I am trying to use different tones of the same color per diagonal with higher contrast. Can we do that?

• ###### 3. Re: Diagonal Banding (not row or column) using different colors

Something like this would work too. Repeating same color tones after every 3 rows.

• ###### 4. Re: Diagonal Banding (not row or column) using different colors

Hi Diogo.

I'm not sure whether you are saying you want to have the diagonals with 2 rows of each colour or not.  If not, then you need to change your options - you have values from -8 to +8 but with only 8 colour bands.  If you change it to 17 colour bands, or go from 0-8 with 9 colour bands, then you should get different ones.

And to increase the contrast - try increasing the opacity.  You currently have it set to 20%

1 of 1 people found this helpful
• ###### 5. Re: Diagonal Banding (not row or column) using different colors

Thanks for the reply. I didn't realize my opacity was at 20%, that takes care of the contrast.

Do you know any approach to make the table repeat the same 3 colors every 3 rows. Like this...

• ###### 6. Re: Diagonal Banding (not row or column) using different colors

Hi Diogo

There's a way to do it taking remainders of absolute values but it's complicated slightly because of the negative numbers and I'm just figuring out the exact formula you need to use!

• ###### 7. Re: Diagonal Banding (not row or column) using different colors

I've got it.  This is the formula you need for a new field that you place on colour instead of "Color".  Alternatively, you can edit the formula of "Color" as required.

IF ([Color]/3-div([Color],3)) < 0

THEN 1+([Color]/3-div([Color],3))

ELSE ([Color]/3-div([Color],3))

END

1 of 1 people found this helpful
• ###### 8. Re: Diagonal Banding (not row or column) using different colors

Wow! It really works! Look what I got, it's really close. What am I doing wrong? Let me know!

• ###### 9. Re: Diagonal Banding (not row or column) using different colors

Using my example.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 10. Re: Diagonal Banding (not row or column) using different colors

Hi Shin

That doesn't quite work - if you look at the bands either side of the diagonal leading down from top left, you can see they have the same shade.  That's why my calculation ended up so complicated - it's because the pattern mirrors around the zero value of "Color".

Diogo, I'm not sure what's happening there, can you share your workbook again?  It worked perfectly for me.

• ###### 11. Re: Diagonal Banding (not row or column) using different colors

Shin's solution worked for me! Thanks for all your hard work on this.