I have some questions in my dashboard that their final result is a number.
I want to create a question that represents the ratio between them.
For example - I have a question that displays “how many users registered this month” and another question that shows “How many users registered this month + added their phone number”…
How can I create a question that shows the ratio?
I tried to set those questions as metrics but that didn’t help. it sounds like a pretty common usecase.
I think you need to do it as a custom query. First, convert the questions to SQL, copying the SQL to a text editor.
Then create a new question with a native query.
It’s a bit fiddly as you can’t just divide one result by another. Mine was:
SELECT a.ordersum / b.prodcount FROM
(SELECT sum("PUBLIC"."ORDERS"."TOTAL") AS ordersum
FROM "PUBLIC"."ORDERS") a
(SELECT count(*) AS prodcount
FROM "PUBLIC"."PRODUCTS") b