Customizing specific background colors in a discovery - Version 2020.16.031
Good Morning,
Please be so kind as to assist me with the following:
I am trying to create a robot grid for my dashboard. There are 2 ways I need to do this.
1. In the discovery grid I need certain blocks to change colors according to a specific criteria. ( Eg. Red: <60%, Yellow: >60, Green: <68%, Blue: <75%, Purple <80%) This must be done for the HR_EFF measurement on each specific time frame level
2. I have a Dimension that tells me which color a block should be. This must change the HR_EFF block to the specific color they have given in the data.
Kindy advise how this can be done.
Regards
Yolanda
9 replies
-
Hi Yolanda
Your scenario sounds like this would be best addressed by applying value driven colors using a formula to provide the logic.
This approach is described here
I have created an example of the approach on our Explore Server so you can see it working in action
You can sign up to the Explore server environment with the link below
Pyramid Explore Server - How to Sign up
the example is found in this location
Link to the folder HOW TO: Value driven Color cells using RGB
The discover "Discovery - Conditional Color" looks like this
Conditional formatting has been applied to cell backgrounds based on Net Margin values: Purple (Net Margin > 35%), Blue (30% ≤ Net Margin ≤ 35%), Green (25% ≤ Net Margin < 30%), Yellow (20% ≤ Net Margin < 25%), Red (Net Margin < 20%).
Lets go through how we got here
For improved code readability, I defined variables to represent the colors, although this wasn't strictly required.
this is the formula for the 'Color - Red', I wont go through each one but I have created a formula for Yelllow, Green, Blue and Purple.
more details on the RGB function can be found here RGB (PQL)
I then made a formula "Color Value" to return the color required to color a cell based on the value of the Net Margin.
I used a case statement to evaluate each scenario and return the color measure that was required.
Finally, I placed this metric onto the discovery grid in the color zone
this could have also been achieved by right clicking on the 'color value' chip and selecting "edit color logic"
then 'value' > Color Format RGB
this may differ slightly in 2020 where you will have to drop the color chip and select 'Custom Colors'
I hope this helps
thanks
Mark
-
Hi
On top of 's answer, if you have a measure you want to color based on a values of a measure, you can do it like this:
On the grid you have, copy the HR_EFF measure to the color, then right click on the measure in the color and choose "color logic".
and define the color bands:
I think it may be the same with Pyramid 2020, it definitely works in 2023 and upwords.
Regards
-
Hi there,
Thank you both so much. Both work in 2023 (which is still not available to us) but not in 2020.16.
Is there another method in 2020.16. I keep getting errors and our company is unsure of when the upgrade will take place so I cant wait.
-
Hi ,
The syntax for Case may be different for 2020
I believe if you use the following syntax laid out in this link it should work
Also could you share the errors you are getting
thanks
Mark