Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article offers examples for a user administration related analyses with the dashboard.

...

Number of created and total users per month

Code Block
languagesql
SELECT
CONCAT(CONCAT(to_char(ident.CREATIONTIME,'yyyy'), '-'), to_char(ident.CREATIONTIME,'mm')) AS "Month",
SUM(1) AS "Number",
(
SELECT
COUNT(*)
FROM view_identity
WHERE identitytype = 'USER' AND
CONCAT(CONCAT(to_char(CREATIONTIME,'yyyy'), '-'), to_char(CREATIONTIME,'mm')) <=
CONCAT(CONCAT(to_char(ident.CREATIONTIME,'yyyy'), '-'), to_char(ident.CREATIONTIME,'mm'))
) AS "Total"
FROM view_identity ident WHERE identitytype = 'USER'
GROUP BY CONCAT(CONCAT(to_char(ident.CREATIONTIME,'yyyy'), '-'), to_char(ident.CREATIONTIME,'mm'))
ORDER BY CONCAT(CONCAT(to_char(ident.CREATIONTIME,'yyyy'), '-'), to_char(ident.CREATIONTIME,'mm'));