Explore - Format KPI metric as text

Answered

6 Comments

  • Hillary Latham
    Community Moderator

    Milton, you will need a combination of tools in Explore to build tis out. 

    For the coloring, the feature in Explore is under Chart Configuration > Display Format > Advanced.  This recipe talks about how to use this feature: https://support.zendesk.com/hc/en-us/articles/360047788473-Explore-recipe-Change-color-of-one-touch-tickets-when-it-reaches-a-certain-value

    To show good/not good, you will need to create your own metric or attribute with a formula to show good/not good based on your values.  There are probably many ways to attack this.  I would read up on either "standard calculated metric", "standard calculated attribute" or possibly "result metric calculation."  After you pick a method based on your data, let me know if you need further help.

    0
  • Milton

    Thanks Hilary, I did try those but still haven't managed to quite crack it.

    As far as I can tell, the ability to conditionally format a metric only works with a table visualisation. As soon as a different type is selected you lose the option for any advanced formatting. I could live with losing that functionality though, if I could get the next bit working.

    I've tried different combinations of the calculated metric and attribute and the closest I've got it to work how I wanted is to use a "result metric calculation" like:

    SUM(Score) / SUM(TOTAL)

    This gives me the % I want but if I try and format this as good/not good using something like the below, it doesn't display anything at all:

    IF SUM(Score) / SUM(TOTAL) >= 0.9 THEN "Good"
    ELIF SUM(Score) / SUM(TOTAL) <0.9 THEN "Not good"
    ENDIF

    I'm guessing because as it's a metric, it's expecting a number value?

    0
  • Stephen Belleau

    I feel like something's not quite right here. I tried several things with formulas but nothing works. This is what I expected to be a solution:

    1. It makes sense that metrics are expecting a number value because it forces you to apply an aggregator. So what I tried was to first create a new metric to give us a binary 1 or 0 depending on the value of Score. 

    Metric: Score binary

    IF SUM(Score) / SUM(TOTAL) >= 0.9 THEN 1
    ELIF SUM(Score) / SUM(TOTAL) <0.9 THEN 0
    ENDIF

    That part works fine. 

    2. Add this metric "Score binary" to the report. Now create a result metric calculation. This is where I would expect to be able to replace our 1 or 0 with "Good" or "Not good", because result metric calculation does not require an aggregator. 

    I tried all sorts of things. I tried SWITCH/CASE function. I tried STRING to convert the number 1/0 into text 1/0 and then SWITCH/CASE to replace 1/0 with "Good"/"Not good". I tried all of that with REPLACE as well.

    No matter what it just looks like there's no way to render a metric as text. Since we could do that in Insights, I really hope this capability gets added (or that there's a solution we haven't figured out yet).

    The closest we can get is indeed to follow Hillary's tip with advanced display format. Milton not only can you change the color, you can also conditionally add a suffix. So append " - Good" for >= 0.9 or append " - Not good" for <0.9

    Yes that's only possible in a table, but you can manipulate the table style. Hide the header to make it a single-cell table, and enlarge the text size to match the KPI size. It's not perfect but it's the best I can come up with ¯\_(ツ)_/¯

    0
  • Hillary Latham
    Community Moderator

    For a metric you would need something numeric, 1 or 0.  For an attribute, you can use text.  Have you tried created this as an attribute?  I have many attributes with text - then I can manipulate and sum totals based on the text values.

    I'm not sure how to switch the value of a metric to display as text if you need the 'good' and 'not good'.  I would either post some feedback to Explore to add this feature similar to Insights (https://support.zendesk.com/hc/en-us/community/topics/360001200913) or start a chat with a Zendesk agent and see if they can help you figure it out.

    0
  • Milton

    Do you have an example of a similar attribute Hilary? Be interested to see how you've set it up!

    0
  • Hillary Latham
    Community Moderator

    Sure, Milton.  I haven't made an attribute quite like what you are trying to do, but I've made several to try and classify a ticket based on the title and they output text.  From here, I can add this attribute to a query and have another metric like Count(Tickets) show me the # of tickets with each value (or with a NULL).  This is one of the simpler ones:

    0

Please sign in to leave a comment.

Powered by Zendesk