It seems the events table is split by date in Goog...
# ask-questions
f
It seems the events table is split by date in Google, then how can I calculate a date range in GB?
f
GrowthBook handles this for you with some fancy logic - if you look at the default queries for GA4, you'll see something like:
Copy code
FROM
  `ga4-sample-1234`.`analytics_3557776766`.`events_*`,
  UNNEST(event_params) AS experiment_id_param,
  UNNEST(event_params) AS variation_id_param
WHERE
  ((_TABLE_SUFFIX BETWEEN '{{date startDateISO "yyyyMMdd"}}' AND '{{date endDateISO "yyyyMMdd"}}') OR
   (_TABLE_SUFFIX BETWEEN 'intraday_{{date startDateISO "yyyyMMdd"}}' AND 'intraday_{{date endDateISO "yyyyMMdd"}}'))
  AND event_name = 'experiment_viewed'  
  AND experiment_id_param.key = 'experiment_id'
  AND variation_id_param.key = 'variation_id'
  AND user_pseudo_id is not null
f
Thanks.
I need this group aggregator to calculate 14 days signup rate, but in GB it requires timestamp and user_id for each query. How can I make it?
f
the query needs to return a timestamp
but that timestamp can be based on anything you like
so you should return the event_date - the where clause will remove invalid rows - we have template variables you can use in the queries for the dates: