0

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

null
    • Global Architect
    • Mark_Oldfield.1
    • 2 wk ago
    • Reported - view

    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

    • Customer Solutions Architect
    • Moshe_Yossef
    • 13 days ago
    • Reported - view

    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

    • Yolanda_Heldsinger.1
    • 13 days ago
    • Reported - view

    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.

    • Global Architect
    • Mark_Oldfield.1
    • 13 days ago
    • Reported - view

    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

    CASE (PQL)

    Also could you share the errors  you are getting

    thanks 

    Mark

      • Yolanda_Heldsinger.1
      • 13 days ago
      • Reported - view

       Hi,

      Either way that I do this in 2020 or 2023, I seem to only be seeing 2 colors. Do you perhaps know what I am doing wrong?

      Below is the 2023 test version

      • Yolanda_Heldsinger.1
      • 13 days ago
      • Reported - view

      @Yolanda Heldsinger  This is my case PQL for 2020 

      • Global Architect
      • Mark_Oldfield.1
      • 13 days ago
      • Reported - view

       looking at the case ... you need to check for between 2 values for the cases for yellow, green , etc

      therefore the Yellow statement should look like [Measure] >=60 && [Measure ] < 68, the && represents in the code represents a logical AND.

      This will allow the next criteria to be evaluated and so forth

      hope this helps

      thanks

      Mark.

      • Yolanda_Heldsinger.1
      • 13 days ago
      • Reported - view

       This is the error I get when doing the &&

      • Yolanda_Heldsinger.1
      • 13 days ago
      • Reported - view

       my 2023 calc is the same as yours but also not giving me the different colors

Content aside

  • 13 days agoLast active
  • 9Replies
  • 55Views
  • 4 Following