Using metrics in IF- or CASE-statements not working?

3 Comments

  • Graeme Carmichael
    Community Moderator

    Oliver

    I can get an IF statement to return different metrics based on a ticket group condition.

    You have provided good detail in your request, but it may help to show the exact custom metric code you are using and the HOW selects in your report. Hopefully, we can get to the bottom of it.

    0
  • Oliver Knigge

    Hi Graeme,

    thanks for reaching out. 

    I have solved this task otherwise by summing both metrics with an IFNULL-condition.
    Both metrics were:

    1. Med time spent per Ticket (min)
    2. Med time spent per Call Ticket (min)

    The metric which sums these two metrics called "Med time spent per Ticket or Call (min)":

    SELECT IFNULL (Med time spent per Call Ticket (min)),0) + IFNULL (Med time spent per Ticket (min),0)

    This does exactly what I want. I have to say, that only one of these two metrics can have a value, the value of other metric will be then always nothing (NULL). Maybe this caused the problem above, that sometimes NULL was returned. 

    0
  • Graeme Carmichael
    Community Moderator

    Oliver

    That is great news. Thanks for reporting back. I shall keep that in mind for future use.

    0

Please sign in to leave a comment.

Powered by Zendesk