Ability to set a custom date range for custom date attributes

3 Comentários

  • Nathalie Rey

    This would be extremely useful and not sure why this is not a feature already! 

    If not being built soon it would be great to see some recipes on how to create formulas to view items in the current week, day, etc. 

    Thanks! 

    0
  • Erin O'Callaghan
    Zendesk Documentation Team

    Hi Franco Landa, as a workaround, you should be able to create a query using your standard calculated attribute (as you mentioned above), and then add a built-in date attribute as a filter with a custom range. So here’s what I did to create a report that shows me how many tickets were created each week, where the week starts on Friday:

    1. I created a standard calculated attribute with the following formula (adapted from this recipe):
      DATE_FORMAT(START_OF_WEEK_FRIDAY([Ticket created - Date]),
      “YYYY-MM-dd”) + ” ” + “to” + ” ” +
      DATE_FORMAT(END_OF_WEEK_FRIDAY([Ticket created - Date]), “YYYY-MM-dd”)
    2. In the Metrics panel, I added COUNT(Tickets), and in the Rows panel, I added the attribute I just created above.
    3. Next I added a filter of Ticket created - Date.
    4. To create a custom range for the filter, I clicked the attribute filter and went to Edit date ranges > Advanced.
    5. I set the From the beginning of setting to 8/27/2021 (a Friday) and the To the end of setting to 9/2/2021 (a Thursday).
    6. Then I set the Repeat for setting to 4 weeks in the past. (You can set this number to whatever time period you want to report on.)

    The resulting query now shows me how many tickets were created in each of the last 4 weeks, starting on Fridays. This process isn’t as quick as picking one of the simplified ranges for built-in attributes, but the end result is the same. Just make sure your custom attribute is using the same event as your filter attribute (in my example, both are looking at Ticket created - Date).

    Hope this helps!

    1
  • Erin O'Callaghan
    Zendesk Documentation Team

    Hi Nathalie Rey, this short article is a great example of how to view items for the current month (or day, week, etc.): How do I make my metric show always results for the current month?

    Some other good reads on working with dates in Explore are:

    1

Por favor, entrar para comentar.

Powered by Zendesk