تخطي إلى المحتوى الرئيس

How do I report agent replies for a specific date range or compare years? - قاعدة المعلومات / Q&A / Reports & DPQL - Deskpro Support

How do I report agent replies for a specific date range or compare years?

قائمة المؤلفين
  • Kim

The built-in agent replies report only offers preset periods. To use your own date range, or to compare this year with last year, create a custom stat with the dates written into the DPQL query.

Create the custom stat

  1. Go to Reports > Stats and click Create statistic.

  2. Add a title.

  3. Open the Raw DPQL tab.

  4. Paste one of the queries below.

  5. Click Save.

Replies per agent for a date range

This query counts agent replies, not internal notes, for each agent:

SELECT DPQL_COUNT() AS 'Replies'
FROM tickets_messages
WHERE tickets_messages.date_created > '2026-08-01'
  AND tickets_messages.date_created < '2026-09-01 00:00:00'
  AND tickets_messages.is_agent_note = 0
  AND tickets_messages.person.is_agent = 1
GROUP BY tickets_messages.person AS 'Agent'
ORDER BY @'Replies' DESC

Change the two dates to the range you want. A date with no time is treated as 00:00.

Replies this year compared with last year

This query shows replies by month for this year and last year. Display it as a line or bar graph.

SELECT DPQL_COUNT() AS 'This year'
FROM tickets_messages
WHERE tickets_messages.date_created = %THIS_YEAR%
  AND tickets_messages.is_agent_note = 0
  AND tickets_messages.person.is_agent = 1
GROUP BY LPAD(DPQL_MONTHNAME(tickets_messages.date_created), 2, '0') AS 'Month'
LAYER WITH
SELECT DPQL_COUNT() AS 'Last year'
FROM tickets_messages
WHERE tickets_messages.date_created = %LAST_YEAR%
  AND tickets_messages.is_agent_note = 0
  AND tickets_messages.person.is_agent = 1
GROUP BY LPAD(DPQL_MONTHNAME(tickets_messages.date_created), 2, '0') AS 'Month'

💡 Note: To count tickets that received a reply, instead of individual replies, replace DPQL_COUNT() with DPQL_COUNT_DISTINCT(tickets_messages.ticket.id) in both parts. Each ticket is then counted once per month.


مفيد. غير مفيد