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

eager-judge-66640

01/26/2024, 10:25 AM
Good morning, I have a NextJS application with a NodeJS API sending data to a postgres warehouse like so:
then setup a Metric and Experiment like so:
f

fresh-football-47124

01/26/2024, 12:53 PM
Hi Jorge
you're asking about that database error?
e

eager-judge-66640

01/26/2024, 12:53 PM
hi Grahan, yes exactly!
f

fresh-football-47124

01/26/2024, 12:54 PM
so there are two places to check
sounds like you checked the metirc query (thats one of them)
the other is in the assignment query, which you can find from the data source page
e

eager-judge-66640

01/26/2024, 12:56 PM
oohhh I see! but what exactly are the columns i should return? what if there are multiple schemas per datasource?
f

fresh-football-47124

01/26/2024, 12:57 PM
the required columns are the user identifier you have (probably anonymous_id), the timestamp of the exposure, and the experiment id and variation id
We can handle multiple schemas per data source
as long as you can alias and return the right columns, the data can be any structure
(on the edit query form, we'll say on the top what columns need to be returned)
e

eager-judge-66640

01/26/2024, 12:59 PM
got it! awesome now the error is gone! many thanks Graham!
I only had to delete some unexistent columns like campaign_medium and source and then i left the rest, always choosing experiment_viewed table
f

fresh-football-47124

01/26/2024, 1:00 PM
right
any additional columns returned can be used as dimensions
but are not required
e

eager-judge-66640

01/26/2024, 1:00 PM
crazy, i read this page https://docs.growthbook.io/app/datasources#experiment-assignment-queries at least 3 times, but completely confused it with the query in the metrics
f

fresh-football-47124

01/26/2024, 1:01 PM
should we improve the wording?
e

eager-judge-66640

01/26/2024, 1:01 PM
maybe a little HINT would help!
something like: WARNING, this query is different than the METRICS query
f

fresh-football-47124

01/26/2024, 1:01 PM
about where to edit them?
e

eager-judge-66640

01/26/2024, 1:02 PM
no, more like how to distinguish them
maybe a little table that explains the aim of both queries
one to validate the experiment data, and the other to validate the mtric data.
maybe it sounds silly, but they are actually very similar
f

fresh-football-47124

01/26/2024, 1:11 PM
done
❤️ 1
e

eager-judge-66640

01/26/2024, 1:12 PM
oh amazing Graham! many thanks!
4 Views