Notification

Icon
Error

Top 10 users submitting tickets - Top 10 users submitting tickets by month and year

Posted: Wednesday, July 17, 2019 9:29:44 PM(UTC)
LGuth

LGuth

Member Original PosterPosts: 5
0
Like
I would like to have a report showing the top 10 users that have submitted tickets by month and year.
I'm not real savvy on writing code.
Could someone help me?

Linda Guth
====

Maybe this report below that shows the top Ticket Types can be modified to show User Names instead?

Select Top 1000000 DatePart(yyyy, htblticket.date) As Year,
DatePart(mm, htblticket.date) As Month,
'../helpdesk/icons/' + htbltickettypes.icon As icon,
htbltickettypes.typename As Type,
Count(htblticket.ticketid) As TicketCount,
Cast((Count(htblticket.ticketid) / Cast(TicketCount.Amount As decimal) *
100) As decimal(10,2)) As [Type%]
From htblticket
Inner Join htbltickettypes On htbltickettypes.tickettypeid =
htblticket.tickettypeid
Inner Join (Select DatePart(yyyy, htblticket.date) As Year,
DatePart(mm, htblticket.date) As Month,
Count(htblticket.ticketid) As Amount
From htblticket
Where htblticket.spam <> 'True'
Group By DatePart(yyyy, htblticket.date),
DatePart(mm, htblticket.date)) As TicketCount On TicketCount.Year =
DatePart(yyyy, htblticket.date) And TicketCount.Month = DatePart(mm,
htblticket.date)
ChuckSchurman
#1ChuckSchurman Member Posts: 1  
posted: 8/22/2019 3:53:21 AM(UTC)
Well, what I have is not top 10, it's count by month, 3 month and year, but it's a starting point for ya.



per year
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where htblticket.date > GetDate() - 365
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Per 3 Month
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where htblticket.date > GetDate() - 90
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Per current month
Quote:

Select Top 1000000 htblusers.name As Name,
htblusers.username,
Count(htblticket.ticketid) As TicketCount
From htblticket
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Where DatePart(mm, htblticket.date) = DatePart(mm, GetDate()) And
DatePart(yyyy, htblticket.date) = DatePart(yyyy, GetDate()) And
htblticket.spam <> 'True'
Group By htblusers.name,
htblusers.username,
htblusers.userdomain,
htblticket.fromuserid
Order By Name

Active Discussions

Lansweeper 2019 Fall Release
by  Guest   Go to last post Go to first unread
Last post: 10/1/2019 3:10:48 PM(UTC)
Lansweeper Introducing Our Brand New Report Library
by  Esben.D  
Go to last post Go to first unread
Last post: 7/2/2019 2:09:53 PM(UTC)
Lansweeper Lansweeper subreddit
by  Esben.D   Go to last post Go to first unread
Last post: 4/4/2019 8:57:11 AM(UTC)
Lansweeper 2019 Spring Release
by  Esben.D  
Go to last post Go to first unread
Last post: 3/5/2019 4:11:32 PM(UTC)
Lansweeper Mozilla Firefox Remote Execution Vulnerability
by  Esben.D   Go to last post Go to first unread
Last post: 10/5/2018 12:33:36 PM(UTC)
Lansweeper Lansweeper 7 Released
by  Esben.D  
Go to last post Go to first unread
Last post: 9/19/2018 1:33:10 PM(UTC)
Lansweeper MEGA Chrome Extension Vulnerability
by  Esben.D   Go to last post Go to first unread
Last post: 9/6/2018 1:25:43 PM(UTC)
Lansweeper Intel Foreshadow Vulnerability
by  Esben.D  
Go to last post Go to first unread
Last post: 8/20/2018 1:54:28 PM(UTC)