In this article, you'll learn about using Explore date functions that help you to focus your calculations on the first or the last event in a series.
Typically, when you report on specific events or the time between them, some of the events are not unique. For example, one ticket can have multiple resolution events. The Explore earliest and latest date functions help you find unique first and last events.
Explore features the following four earliest and latest date functions:
- DATE_FIRST(time attribute)
Returns the earliest date or timestamp according to attributes added to the report and is affected by all applied filters.
Example:DATE_FIRST([Update - Timestamp])
Returns the earliest update timestamp taking into account all attributes you added to the report.
- DATE_LAST(time attribute)
Returns the latest date or timestamp according to attributes added to the report and is affected by all applied filters.
Example:DATE_LAST([Update - Timestamp])
Returns the latest update timestamp taking into account all attributes you added to the report.
- DATE_FIRST_FIX(time attribute, attribute1, attribute2, ...)
Returns the earliest date or timestamp according to the attributes specified in the function. Attributes added to the report will not affect the calculation but any filters applied will be taken into account.
Example:DATE_FIRST_FIX([Update - Timestamp], [Update ticket ID])
Returns the earliest update timestamp per ticket, regardless of the attributes from the report.
- DATE_LAST_FIX(time attribute, attribute1, attribute2, ...)
Returns the latest date or timestamp according to the attributes specified in the function. Attributes added to the report will not affect the calculation but any filters applied will be taken into account.
Example:DATE_LAST_FIX([Update - Timestamp], [Update ticket ID])
Returns the latest update timestamp per ticket, regardless of the attributes from the report.
Examples for using earliest and latest date functions
This section contains the following examples:
- Using the DATE_LAST function to find tickets solved on the last day of the month for a group
- Using the DATE_FIRST function to find the earliest daily ticket assignment
- Using the DATE_LAST_FIX function to find the final ticket resolution date
- Using the DATE_LAST_FIX function to find the latest agent comment time
- Using the DATE_FIRST_FIX function to find the first internal comment time
Using the DATE_LAST function to find tickets solved on the last day of the month for a group
In this example you'll use the DATE_LAST function to create a report that returns tickets solved on the last date, then by adding year, month and group attributes to the report you will get resolutions for the last date of the month for each group.
To create the report
- Create a new report using theSupport: Ticketsdataset.
- Create a standard calculated metric namedTickets solved on last datewith the following formula:
IF DATE_LAST([Ticket solved - Date])=[Ticket solved - Date] THEN [Ticket ID] ENDIF
- Edit the metric you just created and set its default aggregator toCOUNT. Remove any other aggregators.
- Add theTicketsandTickets solved on last datemetric to theMetricspanel of the report builder.
- In theRowspanel, add theTicket solved - YearandTicket solved - Monthattributes. You’ll see total number of solved tickets and tickets solved on the last day of the month, for example:
- In theRowspanel, add theTicket groupattribute. You’ll see that the tickets solved on the last date are determined per group in addition to year and month:
Using the DATE_FIRST function to find the earliest daily ticket assignment
In this example you'll use the DATE_FIRST function to create a report that returns the earliest ticket assignment timestamp. Then, you'll add the assignee and date attributes to get the earliest timestamp per date and assignee.
To create the report
- Create a new report using theSupport: Ticketsdataset.
- Create a standard calculated attribute namedEarliest assignment - timestampwith the following formula:
IF DATE_FIRST([Ticket first assigned - Timestamp])=[Ticket first assigned - Timestamp] THEN [Ticket first assigned - Timestamp] ENDIF
- Add theTicketsmetric to theMetricspanel of the report builder.
- In theRowspanel, add theAssignee nameandTicket assigned - Dateattributes. Configure the second attribute to show tickets created this week.
- In theRowspanel, add theEarliest assignment - timestampattribute, then filter it by excluding NULL values. You’ll see the earliest daily ticket assignments by assignee and date, for example:
Using the DATE_LAST_FIX function to find the final ticket resolution date
门票可以解决和重新开放多个时间s. In some cases, you only want to see the latest resolution. In this example you'll use the DATE_LAST_FIX function to produce a metric that will return the number of final ticket resolutions.
To create the report
- Create a new report using theSupport: Updates historydataset.
- Create a standard calculated metric namedFinal resolutionswith the following formula:
IF ([Changes - Field name]="status" AND [Changes - Previous value]!="solved" AND ([Changes - New value]="solved" OR [Changes - New value]="closed") AND DATE_LAST_FIX([Update - Timestamp], [Update ticket ID], [Changes - Field name], [Changes - New value])=[Update - Timestamp]) THEN [Update ID] ENDIF
- Edit the metric you just have created and set its default aggregator toCOUNT. You can also remove other aggregators.
- Add theResolutionsandFinal resolutionsmetrics to theMetricspanel of the report builder.
- In theFilterspanel, add theUpdate - Dateattribute and configure this to show updates in the last 30 days. Your report will return the total number of resolutions and number of final resolutions. You can slice these metrics using any attributes, for exampleUpdate ticket group.
Using the DATE_LAST_FIX function to find the latest agent comment time
In this example you'll use the DATE_LAST_FIX function to create an attribute that will return the latest agent comment timestamps that will not be sliced by the attributes from the report. This report can help you detect agent seats that were not used for a long time.
To create the report
- Create a new report using theSupport: Updates historydataset.
- Create a standard calculated attribute namedLatest agent comment - timestampwith the following formula and enable theSort like time attributesetting:
IF ([Comment present]=TRUE AND [Comment public]=TRUE AND DATE_LAST_FIX([Update - Timestamp],[Comment present],[Comment public],[Updater name])=[Update - Timestamp]) THEN [Update - Timestamp] ENDIF
- Add theCommentsmetric to theMetricspanel of the report builder.
- In theFilterspanel, add theTicket created - Dateattribute and configure this to show updates in the last week or month.
- In theFilterspanel, add theUpdater roleattribute and configure this to showAgentsandAdmins.
- In theRowspanel, add theUpdater nameattribute.
- Finally, in theRowspanel, add theLatest agent comment - timestampattribute, then filter it to exclude NULL values. You’ll see the list of agents and their latest comment timestamps:
Using the DATE_FIRST_FIX function to find the first internal comment time
One of the default metrics available in the Tickets dataset is First reply time. It gives you insight on how long it took for an agent to respond to the end user. Some customers have internal processes where an internal comment is added to the ticket before a public reply.
In this example, you'll use the DATE_FIRST_FIX function to create a report that returns the average first internal comment time by month.
To create the report
- Create a new report using theSupport: Updates historydataset.
- Create a standard calculated attribute namedFirst internal comment - Timestampwith the following formula and enable theSort like time attributesetting:
IF ([Comment present]=TRUE AND [Comment public]=FALSE AND DATE_FIRST_FIX([Update - Timestamp],[Update ticket ID],[Comment present],[Comment public])=[Update - Timestamp]) THEN [Update - Timestamp] ENDIF
- Create a standard calculated metric namedFirst internal comment time (hrs)with the following formula:
DATE_DIFF([First internal comment - Timestamp], [Ticket created - Timestamp], "nb_of_hours")
- Edit the metric you just created, set it's default aggregator toAVG, display format toCustom, and setDecimal pointsto1andSuffixtohrs
- In theFilterspanel, add theTicket created - Dateattribute and configure this to show updates in the last three months.
- Add theFirst internal comment time (hrs)metric to theMetricspanel of the report builder.
- In theColumnspanel, add theTicket created - Monthattribute and configure this to show updates in the last 6 months.
- Finally, in theVisualization typesmenu, select theColumnchart. You’ll see the first internal comment time by month:
34 Comments
Hello!
我想把一份报告的门票gone the longest without a public comment by an internal agent.
I have added a custom standard calculated attribute for latest public comment:
And I have built a report in the updates history dataset using the metric D_COUNT Tickets Updated w/public comment + the rows:
最新的公众意见(这就是我叫calculated attribute)
Ticket ID
Ticket organization name
Ticket subject
Updater name
Assignee name
Filters:
Updater role: Agent, Admin
Ticket status: On hold
Comment public: exclude NULL and FALSE
The returned results seem to be correct (in that the rows containing a value in the latest public comment column have the correct value), but most of the rows are returning no values/NULL for the latest public comment column. Why would this be the case? What changes should I make for this report?
Is it possibly to use DATE_FIRST to report on the first date an organization created a ticket?
Our use-case is that we want to understand ticket volumes for newly launched customers. I cannot go off of the date that the organization was added to ZenDesk, because we historically have added organizations when they sign contracts... it can be years before they actually launch.
So, the metric I need is 'first time existing organization submitted a ticket', set it to filter on dates within the last let's say 3 months, and then I would pull in ticket volumes by week for the organizations that fit the calculated metric.
Let me know if I am on the right track here or if this is something impossible.. or possible via another route. Thanks!
I have been trying to build a report where it returns the timestamp that a ticket was first set to pending or on-hold but something isn't right as I am getting null values for some tickets that did have that change happen. The numbers that do get returned appear accurate. This may or may not include other changes in the same update, which I don't care about checking.
My calculated attribute isUpdate to Pending/On-Hold.
Then I am plugging that into a calculated metric:
I suspect there is something off about the DATE_FIRST_FIX and have tried changing the values there but most combinations lead to nothing at all being returned. Is something causing it to be unable to detect the first change in some cases?
I'm trying to accomplish the same as Jordan and keep getting blank results for tickets that were changed to status "Pending".
Pleasesign into leave a comment.