1 Reply Latest reply: Jul 21, 2016 6:27 AM by Sunny Talwar

# Having different colours for different set expression

Hi all,

I am able to write an expression to colour code but I realised they only work for pie and bar graph.

For the same colour code expression that worked on pie and bar graph, it does not work on a line chart when I use it with set expression.

To give an example, lets say there are 3 columns that are of interest. 1st column is "Month", 2nd column is "speed", which gives a numerical value and the last column is "category" and the values are "Cat 1", "Cat 2", "Cat 3" and "Cat 4"

The colour code expression is "IF(category= 'Cat 1', rgb(229,50,50), IF(category= 'Cat 2', rgb(228,100,31),IF(category= 'Cat 3', rgb(75,208,31), IF(category= 'Cat 4', rgb(128,0,128),rgb(0,76,153)))))"

This colour code expression works fine and gives the colour that I want when a bar or pie chart is plotted with the dimension being "category" and measure being "speed"

However this does not work on line graph that makes use of set analysis. In the line graph the Dimension is "Month" and the Measures are all set expression. An example of the set expression is {<category={'Cat 1'}>}[Speed]. The rest of the expression are similar {<category={'Cat 2'}>}[Speed] etc.

Does anyone has any idea how can I colour code such a line chart?

Been cracking my brain so much over these. Appreciate any help. Thank you.

• ###### Re: Having different colours for different set expression

Would it be possible to share a sample or atleast some screenshot of what you are seeing? It might be much easier and faster to help you with more information