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

[METRICS] better formating

parent 38954975
Pipeline #5684 canceled with stages
......@@ -2,7 +2,7 @@ WITH total AS (SELECT * from nodes n where n.typename = 30)
, 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 TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm0D00%') AS "CREATED LAST 3 MONTHS")
(SELECT TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm99%') AS "CREATED LAST 3 MONTHS")
FROM sum
......
......@@ -2,6 +2,6 @@ WITH total AS (SELECT * from nodes n where n.typename = 9)
, 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 TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm0D00%') AS "CREATED LAST 3 MONTHS")
(SELECT TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm99%') AS "CREATED LAST 3 MONTHS")
FROM sum
......@@ -2,6 +2,6 @@ WITH total AS (SELECT * from nodes n where n.typename = 90)
, 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 TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm0D00%') AS "CREATED LAST 3 MONTHS")
(SELECT TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm99%') AS "CREATED LAST 3 MONTHS")
FROM sum
......@@ -2,7 +2,7 @@ WITH total AS (SELECT * from nodes n where n.typename = 210)
, 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 TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm0D00%') AS "CREATED LAST 3 MONTHS")
(SELECT TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm99%') AS "CREATED LAST 3 MONTHS")
FROM sum
......
......@@ -2,7 +2,7 @@ WITH total AS (SELECT * from auth_user as A)
, 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 TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm0D00%') AS "CREATED LAST 3 MONTHS")
(SELECT TO_CHAR((ROUND(100 * (SELECT * from increase) / (SELECT * from sum))), 'fm99%') 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