Commit c94bc775 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Metrics

parent 1a806995
Pipeline #5681 canceled with stages
WITH total AS (SELECT * from nodes n where n.typename = 30)
, sum AS (SELECT count(*) from total)
, sum AS (SELECT count(*) AS "TOTAL" from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
(SELECT TO_CHAR(((100 * (SELECT * from increase) / (SELECT * from sum))), 'fm00%') AS "CREATED LAST 3 MONTHS")
FROM sum
......
WITH total AS (SELECT * from nodes n where n.typename = 9)
, sum AS (SELECT count(*) from total)
, sum AS (SELECT count(*) AS "TOTAL" from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
(SELECT TO_CHAR(((100 * (SELECT * from increase) / (SELECT * from sum))), 'fm00%') AS "CREATED LAST 3 MONTHS")
FROM sum
WITH total AS (SELECT * from nodes n where n.typename = 90)
, sum AS (SELECT count(*) from total)
, sum AS (SELECT count(*) AS "TOTAL" from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
(SELECT TO_CHAR(((100 * (SELECT * from increase) / (SELECT * from sum))), 'fm00%') AS "CREATED LAST 3 MONTHS")
FROM sum
WITH total AS (SELECT * from nodes n where n.typename = 210)
, sum AS (SELECT count(*) from total)
, sum AS (SELECT count(*) AS "TOTAL" from total)
, increase AS (SELECT count(*) from total as t WHERE t.date >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
(SELECT TO_CHAR(((100 * (SELECT * from increase) / (SELECT * from sum))), 'fm00%') AS "CREATED LAST 3 MONTHS")
FROM sum
......
WITH total AS (SELECT * from auth_user as A)
, sum AS (SELECT count(*) from total)
, sum AS (SELECT count(*) AS "TOTAL" from total)
, increase AS (SELECT count(*) from total as t WHERE t.date_joined >= date_trunc('month', current_date - interval '3' month))
SELECT *,
(SELECT (100 * (SELECT * from increase) / (SELECT * from sum))) AS "LAST 3 MONTHS / TOTAL"
(SELECT TO_CHAR((100 * (SELECT * from increase) / (SELECT * from sum)), 'fm00%') AS "CREATED LAST 3 MONTHS")
FROM sum
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment