https://www.growthbook.io/ logo
s

some-umbrella-45927

06/13/2023, 5:49 PM
Hi. Is there a way to join the experiment assignment query to metrics using 2 keys? Currently, it's merging using _user_id_, but I would like to join on an additional key. Thank you.
f

fresh-football-47124

06/13/2023, 8:19 PM
Trying to think- If you are ANDing the ids you can select both and concatenate them and alias the results as some new id
s

some-umbrella-45927

06/16/2023, 3:18 PM
Thanks @fresh-football-47124. What if I have metrics pulling from various sources? For example, there's one metric I want to merge using two keys, but for the other metrics I only need to merge using one key.
f

fresh-football-47124

06/16/2023, 3:20 PM
We will allow that - as long as you can describe a way in SQL to join between the identifiers. Each metric defines what identifier they apply to
so if you have a metric by user id, and randomize by IP or something else, we will use the join query between those two ids in the eventual query. You will see a place to add a join query on the data sources page once you add more than one identifier types
s

some-umbrella-45927

06/16/2023, 3:35 PM
Great, thanks!