Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on Background color for Calculated Dimenssion

HI All,

I have a calculated dimension and a Month field in the pivot table:

Calulated field is defined as

= If(Range <= 5, '0 < X < 5',

  If( Range<= 15, '5 < X < 15',

  If(Range <= 30, '15 < X < 30',

  If( Range <= 45, '30 < X < 45'))))

The expression used in pivot table is  Count of Products.

So the table looks like  :

          0 < X < 5       5 < X < 15      15 < X < 30       30 < X < 45

Jan      121               555                  231                   100

Feb       100               200                  600                    500

Now the background colour should be based on my Calulated field.

For 0 < X < 5 it should be green

For 5 < X < 15 it should be light green

For '15 < X < 30 it should be Orange

For '30 < X < 45 it should be Red.

How to implement this Can any one help me on this?

1 Solution

Accepted Solutions
vinay_hg
Creator III
Creator III

in the expression --> background color write same expression

i.e.

= If(Range <= 5, rgb(0,255,0),

  If( Range<= 15 and Range =>5, RGB(0,150,0), //150 is for lighter green u can reduce or increse this no as per ur req

  If(Range <= 30 and Range =>15, RGB(),//fing color code from color pallette

  If( Range <= 45 and and Range =>30, rgb()))))

but if true give RGB(255,0,0) for red, like wise give for other colors.

write the expression inside -->expression -->background color see attachmentCapture.JPG.jpg

View solution in original post

5 Replies
kristoferahlin
Partner - Contributor III
Partner - Contributor III

Click the plus sign to the right of the calculated dimension and add the following expression under Background color:

= If(Range <= 5, Green(),,

  If( Range<= 15, LightGreen(),

  If(Range <= 30, RGB(255,165,0),

  If( Range <= 45, Red()))))

sujeetsingh
Master III
Master III

On Dimension tab >>Click on + sign of dimension

>>Then there comes a option of Expression for background>>

>> Then write this

If(Range <= 5, Green(),,

  If( Range<= 15, LightGreen(),

  If(Range <= 30, RGB(255,165,0),

  If( Range <= 45, Red()))))

vinay_hg
Creator III
Creator III

in the expression --> background color write same expression

i.e.

= If(Range <= 5, rgb(0,255,0),

  If( Range<= 15 and Range =>5, RGB(0,150,0), //150 is for lighter green u can reduce or increse this no as per ur req

  If(Range <= 30 and Range =>15, RGB(),//fing color code from color pallette

  If( Range <= 45 and and Range =>30, rgb()))))

but if true give RGB(255,0,0) for red, like wise give for other colors.

write the expression inside -->expression -->background color see attachmentCapture.JPG.jpg

Not applicable
Author

HI ALl,

Thank you for the response. Actually I tried to do for Expression Bacground.

= If(Range <= 5,Green(),

  If( Range<= 15, LightGreen(),

  If( Range<= 30, Yellow(),

  If( Range<= 45, LightBlue(),

  If( Range<= 60, LightCyan(),

  If( Range<= 75, LightRed(), Red()))))))

But for all values it is showing RED only..WHat is the problem?

But in actuall data we have values for all ranges.

Not applicable
Author

It is because of selection of Range value in the Application. Actually there is an selection box for user. That is why it is giving red.

Is there a way where I can overcome the problem?