Skip to end of banner
Go to start of banner

User Active Intervials View

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Name

UserActiveIntervals

Type

View

Description

A count of actions completed by users in 30 minute intervals. Only intervals with at least one completed action are included and these are considered active intervals.

Data Category

Event Field/Column Name

Data Type

Description

Applicability

Sample Value

Notes

Key

TenantId

VARCHAR

Unique ID associated with each Quavo client.

ALWAYS

qvo-stg

Key

Tenant

VARCHAR

A tenant is a Quavo customer that uses QFD.  Each tenant is assigned a unique Tenant ID.

ALWAYS

Default

Key

ClientId

VARCHAR

A unique ID representing a single client.

ALWAYS

Default

Key

Client

VARCHAR

A client is a Quavo customer that uses QFD through a relationship with a Quavo tenant.  Each client is assigned a unique Client ID.

ALWAYS

Default

Activity Details

PerformedByUserName

VARCHAR

Username of the user that completed the action.

ALWAYS

devan.robertson@quavo.com

Activity Details

PerformedBy

VARCHAR

First initial and last name of the user that completed the action.

ALWAYS

D. Robertson

Activity Details

Interval

DATE

Datetime that represents the start time of a 30 minute activity interval.

ALWAYS

2024-11-23 00:00:00.000

Activity Details

Actions

Number

Count of actions completed during interval.

ALWAYS

3

SQL

For greater transparency, and to provide clients with a “jumping off” point for their own queries, the SQL used to generated this view is provided below.

SELECT 
     a.tenantid,
     t.name,
     a.clientid,
     c.commonname,
     addedbyid,
     CONCAT(LEFT(u.firstname, 1), '. ', u.lastname) AS PerformedBy,
     IFF(MINUTE(a.createdatetime) < 30,
     TO_TIMESTAMP_TZ(DATEADD(MI, 0, DATEADD(H, HOUR(a.createdatetime), TO_DATE(a.createdatetime)))::varchar || ' +0000'),
     TO_TIMESTAMP_TZ(DATEADD(MI, 30, DATEADD(H, HOUR(a.createdatetime), TO_DATE(a.createdatetime)))::varchar || ' +0000')) AS "Interval",
      count(*) AS "Actions"
FROM completedactions AS a
JOIN userprofile AS u ON a.tenantid = u.tenantid AND a.addedbyid = u.userid
JOIN tenant AS t ON a.tenantid = t.tenantid
JOIN client AS c ON a.tenantid = c.tenantid AND a.clientid = c.clientid
WHERE
    addedbyid != 'System'
GROUP BY a.tenantid, t.name, a.clientid, c.commonname, addedbyid, PerformedBy, "Interval"
ORDER BY t.name, c.commonname, PerformedBy, "Interval" DESC

Change Log

Date

Change Summary

12/11/2024

  • Converted timestamps from NTZ to TZ format for compatibility

  • Added SQL Reference

  • No labels