View: V_StepThroughput
This view shows how many documents were processed in the last hour.
|
DocumentCount | The number of documents with a task (ID
in W_Token). |
ID | The ID of the process step (ID in
C_ProcessStep). |
Name | The name of the process step (Name
in C_ProcessStep). |
ProcessID | The ID of the process (ProcessID
in C_ProcessStep). |
Process | The name of the process (Name in
C_Process). |
Client | The name of the client (Name in C_Client).
|
LastRoutedAt | When the task (token) was assigned to
this process step (date and time) |
DateOnly | When the task (token) was assigned to
this process step (only the date) |
SQL Script
CREATE VIEW [dbo].[V_StepThroughput]
AS
SELECT COUNT(dbo.W_Token.ID) AS DocumentCount, dbo.C_ProcessStep.ID, dbo.C_ProcessStep.Name, dbo.C_ProcessStep.ProcessID, dbo.C_Process.Name AS Process,
dbo.C_Client.Name AS Client, dbo.W_Token.LastRoutedAt, CONVERT(datetime, CONVERT(char(10), dbo.W_Token.LastRoutedAt, 112)) AS DateOnly
FROM dbo.W_Token INNER JOIN
dbo.C_ProcessStep ON dbo.W_Token.ProcessStepID = dbo.C_ProcessStep.ID INNER JOIN
dbo.C_Process ON dbo.C_ProcessStep.ProcessID = dbo.C_Process.ID INNER JOIN
dbo.C_Client ON dbo.C_Process.ClientID = dbo.C_Client.ID
GROUP BY dbo.C_ProcessStep.Name, dbo.C_ProcessStep.ProcessID, dbo.C_ProcessStep.ID, dbo.C_Process.Name, dbo.C_Client.Name, CONVERT(datetime,
CONVERT(char(10), dbo.W_Token.LastRoutedAt, 112)), dbo.W_Token.LastRoutedAt
HAVING (CONVERT(datetime, CONVERT(char(10), dbo.W_Token.LastRoutedAt, 112)) = CONVERT(datetime, CONVERT(char(10), GETUTCDATE(), 112))) AND (DATEDIFF(second,
dbo.W_Token.LastRoutedAt, GETUTCDATE()) <= 3600)
Uses
Related topics
The available tables
The available views