https://www.growthbook.io/ logo
#announcements
Title
# announcements
f

freezing-finland-88631

08/18/2022, 8:39 PM
Are SQL template variables available within Dimension definitions? We defined a dimension as:
Copy code
SELECT 
  hid as user_id,
  CASE
    WHEN created_at >= '{{ startDate }}' THEN 'New'
    ELSE 'Existing'
  END as value
from owners
But in all queries where we try to slice by the dimension,
{{ startDate }}
isn’t substituted
I think I answered my own question. This is an Experiment dimension since it relies on the experiment assignment date, so must be added to the Data Source SQL directly, right?
f

future-teacher-7046

08/18/2022, 10:06 PM
Yeah, that makes sense to add to the assignment query directly I think.
12 Views