hi. newbie question. no matter what query I put fo...
# announcements
r
hi. newbie question. no matter what query I put for bigquery it seems to try the default query on a table named `pages`:
f
Hi Mohammad. This is because of the 'pageview' query that it set on the data source page.
We use the pageview query to collect time series info so we can plot the metric over time.
r
Hi Graham. Where can I edit this? I thought we only provide one query which I changed
ok I realized those queries are part of config.yaml.
thanks
f
đź‘Ť
r
so I see its makes a query like
Copy code
__users as (
  -- Users visiting specific pages
  SELECT
    p.user_id as user_id,
    MIN(p.timestamp) as actual_start,
    DATETIME_ADD(MIN(p.timestamp), INTERVAL 3 DAY) as conversion_end,
    DATETIME_SUB(MIN(p.timestamp), INTERVAL 30 MINUTE) as session_start
  FROM
    __pageviews p
  WHERE
    p.timestamp >= DATETIME "2021-10-23 00:00:00"
    AND p.timestamp <= DATETIME "2022-01-21 00:00:00"
  GROUP BY
    p.user_id
but get this error. I believe bigquery doesn’t support MINUTE on DATETIME_SUB?
Copy code
DATETIME_SUB does not support the MINUTE date part at [18:5]
basically :
Copy code
p.timestamp >= DATETIME "2021-10-23 00:00:00"
requires timestamp to be of type DATE/DATETIME but
Copy code
DATETIME_SUB(m.timestamp, INTERVAL 30 MINUTE)
does not work on the above types and only works on timestamp types
is there any bigquery sample?
looks like it doesn’t like timestamp values. converting to datetime helped