Василий Островский
08/24/2021, 12:44 PMJakub Sterba
08/24/2021, 1:30 PMSELECT COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid}) WHERE {attribute/attr.dshb_recruiting_ratio.applicationstatus} = "Hired"
(do not forget to quote strings in GD.CN)
All:
SELECT COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid})
Ratio:
SELECT {metric/Hired}/{metric/All}
Use brackets for nesting of metric expressions
Note that WHERE clause comes after the select clause in which you specify aggregation function, arithmetics formulas etc. You can however nest other metric definition using brackets if you cannot reference existing metric with desired metric definition.
SELECT
( SELECT COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid})
WHERE {attribute/attr.dshb_recruiting_ratio.applicationstatus} = "Hired"
) / COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid})
this will let you specify WHERE clause for the count in numerator of the fraction but not in the denominator.Василий Островский
08/24/2021, 1:51 PM"maql": "SELECT(SELECT COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid}) WHERE {attribute/attr.dshb_recruiting_ratio.applicationstatus} = 'Hired')/COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid})"
Василий Островский
08/24/2021, 1:53 PM"The MAQL query='PARSE METRIC SELECT(SELECT COUNT({attribute/890c63a7e00143009206e44e1f8fdd29:attr.dshb_recruiting_ratio.jobpostingid}) WHERE {attribute/890c63a7e00143009206e44e1f8fdd29:attr.dshb_recruiting_ratio.applicationstatus} = 'Hired')/COUNT({attribute/890c63a7e00143009206e44e1f8fdd29:attr.dshb_recruiting_ratio.jobpostingid})' could not be parsed."
David Kubecka
08/24/2021, 2:07 PM"SELECT(SELECT COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid}) WHERE {attribute/attr.dshb_recruiting_ratio.applicationstatus} = \"Hired\")/COUNT({attribute/attr.dshb_recruiting_ratio.jobpostingid})"
Василий Островский
08/24/2021, 2:46 PMDavid Kubecka
08/24/2021, 3:12 PMDavid Kubecka
08/24/2021, 3:13 PMВасилий Островский
08/24/2021, 3:38 PMВасилий Островский
08/24/2021, 3:41 PMDavid Kubecka
08/24/2021, 3:41 PMDavid Kubecka
08/24/2021, 3:42 PMwhy don't you use DISTINCT notationMAQ COUNT has DISTINCT semantics by default
David Kubecka
08/24/2021, 3:44 PMhttps://<your_host>/measures/
) That should help you with most of the syntax issues.Василий Островский
08/24/2021, 3:58 PMВасилий Островский
08/24/2021, 3:59 PMВасилий Островский
08/24/2021, 7:45 PMВасилий Островский
08/24/2021, 7:48 PMDavid Kubecka
08/25/2021, 7:01 AMDavid Kubecka
08/25/2021, 7:02 AMDavid Kubecka
08/26/2021, 6:26 AMВасилий Островский
08/26/2021, 8:21 AMMartin Svadlenka
08/26/2021, 9:02 AM