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

cold-winter-14544

04/12/2023, 11:16 PM
Hey! I am trying to make a simple GrowthBook metrics analysis but I get some errors. We are using Amplitude as our product analysis platform so I had to export our data to AWS Athena (I am not even sure if we did this right but GrowthBook seems to think it is?). Anyway, I just create a metric, "Doctor List", which is supposed to get all the "Doctor List" events that already exist, but when I try to analyse this metric by clicking on "Run analysis" I get the following error: line 1411 mismatched input '$'. Expecting: '*', <expression>. The SQL query that GrowthBook is generating is:
Copy code
-- Last 90 days - Doctor List Metric
WITH
  __metric as ( -- Metric (Doctor List)
    SELECT
      anonymous_id as anonymous_id,
      1 as value,
      m.timestamp as timestamp,
      m.timestamp as conversion_start,
      m.timestamp as conversion_end
    FROM
      (
        SELECT
          user_id,
          $ amplitude_id as anonymous_id,
          event_time as timestamp
        FROM
          $ events
        WHERE
          event_type = 'Doctor List'
      ) m
    WHERE
      m.timestamp >= from_iso8601_timestamp('2023-01-12T23:11:24.843Z')
      AND m.timestamp <= from_iso8601_timestamp('2023-04-16T23:11:24.843Z')
  ),
 .......
Line 14 (where the error is) is basically this:
$ amplitude_id as anonymous_id,
Here is the actual SQL Query that you get when creating the metric:
Copy code
SELECT
  user_id,
  $amplitude_id as anonymous_id,
  event_time as timestamp
FROM
  $events
WHERE
  event_type = 'Doctor List'
f

fresh-football-47124

04/12/2023, 11:34 PM
Hi Gabriel- it might be easier to help you debug this in person
can you run that query against Athena directly?
seems like maybe some character escaping isn’t working or needs adjusting somewhere
c

cold-winter-14544

04/12/2023, 11:45 PM
I think our aws athena setup is wrong which isn't surprising since it's the first time we use it 😅 we'll see if we manage to make it work
9 Views