I want to create a question to calculate the "New Customer Rate," which is the number of new customers over a specific time period.
I am using a field filter mapped to orders.time
with a SQL parameter order_time
. The field filter works for queries like this:
SELECT *
FROM orders
[[WHERE {{order_time}}]]
However, when I try to use the field filter to retrieve orders from a previous time period using the following query:
SELECT *
FROM orders
[[WHERE DATE(orders.time) < {{order_time}}]]
I encounter this error:
ERROR: syntax error at or near ">=" Position: 203
Does anyone have a solution that still uses the field filter? or do I have to use a filter variable