Explore recipe: Change color of % one-touch tickets when it reaches a certain value

Return to top

18 Comments

  • Andrei Kamarouski
    Community Moderator
    The Wise One - 2021

    Hi, 

    Does the code for formatting support extended IF statements like this? 

    IF (Metric1=X AND Attribute 1="YYY") ...
    0
  • Eric Gao
    Zendesk Customer Care

    Hi Andrei,

    The IF block does support multiple conditions on both the metrics and the attributes. That said, we recommend testing out each condition individually first before conjoining them in a single condition (using AND/OR).

    Warm Regards,
    Eric

    Eric G. Gao | Technical Support Architect | Zendesk

    0
  • Michael Fitz

    I was unable to get the color formatting working with KPI visualization type. I switched to a Table visualization and it worked. Just FYI in case anyone was having issue.

    Edit: Link to the feature request. https://support.zendesk.com/hc/en-us/community/posts/360042104174-Explore-color-conditional-formatting-is-only-in-Table-format-

    0
  • Ravindra Singh

    How to change color of Priority and Ticket solved month, in the given query, please refer snapshot of the query.

    0
  • Marco
    Zendesk Customer Care
    Hi Ravindra, at the moment there would be no way to change the colors of the columns the way the report is set up. In your screenshot, we are asking Explore to just combine two attributes and show the data. Meaning "August - Minor", "August - Serious" etc. 
     
    Unlike for example if you have the Ticket Solved - Month as a column and the Priority as a row, which would result into something like this automatically changing colors. In here, we are telling Explore to display the number of tickets being created (or solved in your case, just used created here as it has more data in my test account), and and separate them by priority. 
     

     
    Hope this helps! Cheers! 
    0
  • Monica Maldonado

    Hey, how do I write > or =?  Because here we get bigger or smaller and if the value is equal will be included as smaller. What is the simbol?

     

    0
  • Dave Dyson
    Zendesk Community Manager
    Hi Monica,
     
    You can use OR, e.g.:
     
    IF (SUM(onetouchtickets-c133534e9b) > .80) OR (SUM(onetouchtickets-c133534e9b) = .80) THEN
     
    See also Explore functions reference
    1
  • Monica Maldonado

    Hi Dave, 

    Thanks for answering. 

    I tried but it didn't work to me. So i decided just put a number behind, like the last number i want to have red. i.e. .69 when your target is 70. That works too.

    Have a great day

    0
  • Monica Maldonado

    Hi,

    Do you know any way of excluding Totals from the formatting?

     

    0
  • Dane
    Zendesk Engineering
    Hi Monica,
     
    Totals are considered as part of the metric values and the conditional formatting will always be applied. 
     
    The only alternatives are to remove the totals from the query or include additional logic in the conditional formatting to remove the color when the totals exceed a certain value.
     
    Hope this helps.
     
    Cheers,
    Dane
    -1
  • Olivier Saugoux

    Hello,

     

    I would like to know if it can be possible to define different colors on graphs got with explosions (see example below):

    I would like to have a different graph color for each group in my example.

    Thanks a lot.

     

    Olivier

    0
  • Erin O'Callaghan
    Zendesk Documentation Team

    Hi Olivier Saugoux, you can use the SWITCH function to accomplish this. What you’ll need to do is create and add a standard calculated metric (in addition to the metric you already have in the screenshot above) with a formula that follows this pattern:

    SWITCH ([Group]) {
        CASE "Name of group 1": 1
        CASE "Name of group 2": 2
        CASE "Name of group 3": 3
        CASE "Name of group 4": 4
        DEFAULT: 5
    }

    Make sure to use the AVG aggregator with your standard calculated metric. After you’ve added this new metric to your report, click it and select Color (near the bottom) and click Apply.

    Your explosions should now be showing in different colors. You can modify the colors a bit by going to the Chart configuration menu > Colors > Color encoding. Note that the colors will be determined on a spectrum—you won’t be able to pick a specific color for a specific attribute value.

    Here's an example of what my test report looks like using this method:

    0
  • Molly Feil

    Hello! If I were looking to use this with the median resolution time metric ( MED(Full resolution time(hrs)) ) how would you plug that in? We're looking for anything at or below 2.5 hrs to show up in green and anything at 2.6 hrs or higher to be red. For some reason, I can't get the code to cooperate and it's throwing errors before I've changed anything.

    The existing code:

    IF (MED(Full resolution time (hrs)) > 50) THEN
        {
            "backgroundColor": "",
            "precision": 0,
            "scale": 1,
            "prefix": "",
            "decimalSeparator": ".",
            "italic": FALSE,
            "bold": FALSE,
            "suffix": "",
            "fontColor": "",
            "thousandsSeparator": " "
        }
    ELIF (IS_NAN(MED(Full resolution time (hrs)))) THEN
        {
            "backgroundColor": "#dddddd"
        }
    ELSE
        {
            "fontColor": "#30aabc"
        }
    ENDIF

    Any advice would be greatly appreciated! 

    1
  • Gab Guinto
    Zendesk Customer Care
    Hi Molly,
     
    Let me create a ticket for you so that we can investigate on this further. 
    0
  • Laura Walker

    Hi There! I am looking to do something similar! 

    I am currently breaking down an SLA report by hours but with decimals.

    I created this report that shows when a ticket was flagged as urgent and when it was marked as "Solved". We do this because we have an internal SLA to solve any urgencies within a specific time frame. Let's say that is 48 hours as an example. I am trying to add conditional formatting that will highlight everything that is greater than 48 hours in red. When I do this the conditional formatting removes my decimals place of 2. I tried adding to the equation to look like so and it was marked as OK but it still doesn't pick up the 2 decimal places. Any thoughts?

    IF (SUM(Priority Urgent hours to solved) > 48) THEN
        {
            "backgroundColor": "#ff726f",
            "precision": 0,
            "scale": 1,
            "prefix": "",
            "decimalPlace": "2",
            "decimalSeparator": ".",
            "italic": FALSE,
            "bold": FALSE,
            "suffix": " hrs",
            "fontColor": "",
            "thousandsSeparator": " "
        }
    ELIF (IS_NAN(SUM(Priority Urgent hours to solved))) THEN
        {
            "backgroundColor": "#dddddd"
        }
    ELSE
        {
            "fontColor": ""
        }
    ENDIF

     

    This is before the conditional formatting: 

     

    and after:

    0
  • Dave Dyson
    Zendesk Community Manager
    Hi Laura,
     
    I think it's because of the inclusion of "precision": 0 in your list (you'd want "precision": 2 instead), and I don't think that "decimalplace" is a valid argument. See Changing the format of results for a list of valid arguments you can include.
     
     
    0
  • Laura Walker

    Thank you Dave!! That did the trick!! 

    0
  • Dave Dyson
    Zendesk Community Manager
    Glad I could help, Laura!
    0

Please sign in to leave a comment.

Powered by Zendesk