Hello! We have a very peculiar thing happen to us ...
# give-feedback
f
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
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
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).
I added the first line (
SUM(value) as sum_value
)
The
least
was there due to having a
1
in the cap value, but the problem still remains. We will investigate more.
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.