https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
j

jolly-raincoat-86650

02/15/2022, 2:50 AM
Would appreciate some help on this issue... getting an error when clicking "Import Past Experiments". BTW, Pageview Query is working. Experiments Query error: "Table name "experiment_viewed" missing dataset while no default dataset is set in the request." (I found this question asked before -- unfortunately, did not see a solution). Using BigQuery Thank you
f

fresh-football-47124

02/15/2022, 3:07 AM
Hi James
f

future-teacher-7046

02/15/2022, 3:07 AM
Can you click on "View Queries" in GrowthBook for the import and paste in the SQL that you see?
j

jolly-raincoat-86650

02/15/2022, 4:03 AM
Hi @fresh-football-47124 Hope you're well. @future-teacher-7046
Copy code
-- Past Experiments
WITH __experiments as (
  SELECT
    user_id,
    anonymous_id,
    received_at as timestamp,
    experiment_id,
    variation_id
  FROM
    experiment_viewed
),
__experimentDates as (
  SELECT
    experiment_id,
    variation_id,
    date_trunc(timestamp, DAY) as date,
    count(distinct anonymous_id) as users
  FROM
    __experiments
  WHERE
    timestamp > DATETIME "2021-02-11 14:04:04"
  GROUP BY
    experiment_id,
    variation_id,
    date_trunc(timestamp, DAY)
),
__userThresholds as (
  SELECT
    experiment_id,
    variation_id,
    -- It's common for a small number of tracking events to continue coming in
    -- long after an experiment ends, so limit to days with enough traffic
    max(users) * 0.05 as threshold
  FROM
    __experimentDates
  WHERE
    -- Skip days where a variation got 5 or fewer visitors since it's probably not real traffic
    users > 5
  GROUP BY
    experiment_id,
    variation_id
),
__variations as (
  SELECT
    d.experiment_id,
    d.variation_id,
    MIN(d.date) as start_date,
    MAX(d.date) as end_date,
    SUM(d.users) as users
  FROM
    __experimentDates d
    JOIN __userThresholds u ON (
      d.experiment_id = u.experiment_id
      AND d.variation_id = u.variation_id
    )
  WHERE
    d.users > u.threshold
  GROUP BY
    d.experiment_id,
    d.variation_id
)
SELECT
  *
FROM
  __variations
WHERE
  -- Experiment was started recently
  date_diff(DATETIME "2022-02-11 14:04:04", start_date, DAY) < 6
  OR -- OR it ran for long enough and had enough users
  (
    date_diff(end_date, start_date, DAY) >= 6
    AND users > 100
    AND -- Skip experiments at start of date range since it's likely missing data
    date_diff(start_date, DATETIME "2021-02-11 14:04:04", DAY) > 2
  )
ORDER BY
  experiment_id ASC,
  variation_id ASC
Table name "experiment_viewed" missing dataset while no default dataset is set in the request.
f

fresh-football-47124

02/15/2022, 4:05 AM
huh
the experiments query looks not right:
Copy code
SELECT
    user_id,
    anonymous_id,
    received_at as timestamp,
    experiment_id,
    variation_id
  FROM
    experiment_viewed
that looks like the default values
can you check that?
j

jolly-raincoat-86650

02/15/2022, 4:08 AM
@fresh-football-47124 You mean this?
f

fresh-football-47124

02/15/2022, 4:09 AM
ya, that is different than what is showing in the combined query
j

jolly-raincoat-86650

02/15/2022, 4:09 AM
I refreshed the page etc as well just to make sure.
f

fresh-football-47124

02/15/2022, 4:09 AM
ok
can you try refreshing the experiment results query?
like running it again?
j
Same issue.
f

fresh-football-47124

02/15/2022, 4:15 AM
one sec, let me look
👍 1
j

jolly-raincoat-86650

02/15/2022, 4:20 AM
Build: d062759 (2022-02-10)
f

future-teacher-7046

02/15/2022, 4:22 AM
Does the same error happen when you click "Refresh List"?
Just clicking on "Import" doesn't re-run the SQL automatically. It will re-use the previous results by default until you force it to refresh by clicking that button
👍 1
f

fresh-football-47124

02/15/2022, 4:26 AM
👍 1
j

jolly-raincoat-86650

02/15/2022, 4:48 AM
Thank you - didn't know about the refresh part. Looks like something is wrong with the variable name.
f

future-teacher-7046

02/15/2022, 5:03 AM
What data type is that
event_params
column?
is it stored as JSON?
j

jolly-raincoat-86650

02/15/2022, 5:06 AM
@future-teacher-7046 Got it. Need to unnest. Thank you
7 Views