Tip: Year over Year Reporting Using "Running Year (Month)" Custom Attribute

6 Comentarios

  • Chris Wooten
    Zendesk Luminary

    Your second metric syntax comes up with an error now for some reason. Love this idea and would appreciate the help.

    0
  • Crawford Philleo

    Hey there - thanks for checking this out. I'm looking at the version on my own dashboard, and I see I'm using the `TODAY()` function instead of `NOW()`. Let me know if that fixes the issue - if not, it'd be helpful to know what error you're sseing.

    Thanks!

     

     

     

    0
  • Darryll Holmes

    @Crawford Philleo

    This returns an error:

    IF (DATE_GREATER_OR_EQUAL([Ticket created - Date],
    DATE_ADD(START_OF_MONTH(NOW()),"year",-2)))
      AND DATE_LESS([Ticket created - Date],
    DATE_ADD(START_OF_MONTH(NOW()),"year",-1)))
    THEN [Ticket ID]
    ENDIF

    What is the correct formula to use?

    0
  • Brett Bowser
    Zendesk Community Manager
    Hey Darryll, 
     
    I think this may be because of a misplaced closing bracket. Can you try this formula?
     
    IF (DATE_GREATER_OR_EQUAL([Ticket created - Date],
    DATE_ADD(START_OF_MONTH(NOW()),"year",-2))
    AND DATE_LESS([Ticket created - Date],
    DATE_ADD(START_OF_MONTH(NOW()),"year",-1))
    )
    THEN [Ticket ID]
    ENDIF
     
    Hope his helps!
    0
  • Bobby

    It's bonkers to me that a help article created by a ZD community manage returns an error in ZD Explore. 

    0
  • Crawford Philleo

    Hey there -  I think that the code blocks in the article were introducing some errors because of how the formulas were formatted. I usually put line breaks in Explore formulas so they are easier to read, but when I paste them into the article, then try to copy/paste them back into Explore again, they return an error for some reason. The formulas I originally wrote also used certain functions that have since started to return errors under certain circumstances, (following with recent updates to Explore under the hood), so I think they needed to be updated anyway. 

    I played around with this a bit, and it seems like I can paste the formulas into the HC article here if they are more inline style. I think these should work as they have been edited above (pending approval). I just created a test in my own instance, and it looks like it's working with the formulas written as follows:

    Metric: Tickets - Current 12 months:

    IF(DATE_GREATER_OR_EQUAL([Ticket created - Date], DATE_ADD(START_OF_MONTH(TODAY()), "year", -1)) AND DATE_LESS([Ticket created - Date],START_OF_MONTH(TODAY())))
    THEN [Ticket ID]
    ENDIF

    Metric: Tickets - Previous 12 Months: 

    IF (DATE_GREATER_OR_EQUAL([Ticket created - Date], DATE_ADD(START_OF_MONTH(TODAY()), "year", -2)) AND DATE_LESS([Ticket created - Date],DATE_ADD(START_OF_MONTH(TODAY()), "year", -1)))
    THEN [Ticket ID]
    ENDIF

    Attribute: Running Year (Month):

    IF(MONTH_NUMERIC([Ticket created - Date]) < MONTH_NUMERIC(TODAY()) AND YEAR([Ticket created - Date]) > YEAR(DATE_ADD(TODAY(), "year", -2)))
    THEN CURRENT_YEAR()
    ELSE CURRENT_YEAR() - 1
    ENDIF


    Hope you're able to get this to work on your end!

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk