Hello! We have a very peculiar thing happen to us in a new revenue metric. When we run the query in GrowthBook I get these results (negative means and smaller stddev), while if I copy the exact same query and run it in Snowflake, I get these results (positive means and larger stddev)… 🤷♀️ The graph also looks very strange… Any ideas?
f
future-teacher-7046
11/29/2022, 3:17 PM
Hmm, that's strange. I'll double check, but I'm pretty sure we just run the query directly and display the results exactly as they come back from Snowflake so not sure what's going on.
🙏 1
g
gray-crayon-34592
12/01/2022, 11:08 AM
Hi! I am part of @full-island-88199 team and I've been debugging how the query is built and I don't quite understand why
LEAST
is used (it is shown when clicking on "View Queries" in the Info panel of the metric):
Copy code
__userMetric as (
-- Add in the aggregate metric value for each user
SELECT
LEAST(1, SUM(value)) as value
FROM
__metric m
GROUP BY
m.user_id
),
and it is very odd because when we run the query up until here and with only positive numbers in
value
we get the attached results (in Snowflake).
gray-crayon-34592
12/01/2022, 11:09 AM
I added the first line (
SUM(value) as sum_value
)
gray-crayon-34592
12/02/2022, 8:55 AM
The
least
was there due to having a
1
in the cap value, but the problem still remains. We will investigate more.
gray-crayon-34592
12/02/2022, 11:02 AM
We fixed this by making the source table of the metric a table and not a view. It seems there was something with the SQL language.
Issue is closed from our side.