Hello everyone, Is there a problem with user filte...
# ask-questions
n
Hello everyone, Is there a problem with user filter? this metric in the screenshot is supposed to have the percentage of users with at least 2 purchases, but the results is the count of all purchases. Why is that? Thank you in advance!
any news about this question 😄
f
@future-teacher-7046 or @helpful-application-7107 can you take a look?
n
narcos-waiting.jpg
😂 1
h
I think this metric should be fine? I can't replicate the error. Can you show the results you're getting that indicate that the result is the count of all purchases? Can you run a metric analysis on the fact metric page?
n
Hello @helpful-application-7107 here you can find a screenshot of a recent experiment where the metric fails. Also how it's defined in the fact table, and for some reason on the metric page itself, there is a capping settings but it's not there when you click edit (because it is not count so it makes sense, but I don't know why the settings appeares like it's a count). Also, the metric analysis shows 323% while it's binomial 😄
here is the count metric analysis
h
Thanks this is helpful, I can try to take a look today.
n
great, thank you for taking the time!
h
It does look like a bug...
Hmm I'm not able to recreate this. Can you open the view queries modal on the metric analysis showing 323% and share it with me?
Hmm it looks like you're probably self-hosting an older version of the app actually. So maybe we already fixed this bug.
I think I remember the very first version we shipped of the user filter needing a patch.
n
you're right, I am self-hosting the version 3.4 and the query is missing the user filter as you can see here.
Copy code
__factTable as ( -- Fact Table (purchases)
    SELECT
      user_id as user_id,
      CAST(m.timestamp as DATETIME) as timestamp,
      -- FT-GB: Transaction (binomial) (desktop)
      CASE
        WHEN (
          purchase_device = 'desktop'
          AND transaction_type != 'cc_validation'
        ) THEN 1
        ELSE NULL
      END as m0_value,
      -- FT-GB: 2nd Transaction (after exposure) (binomial) (desktop)
      CASE
        WHEN (
          transaction_type != 'cc_validation'
          AND purchase_device = 'desktop'
        ) THEN 1
        ELSE NULL
      END as m1_value,
      -- FT-GB: 3rd Transaction (after exposure) (binomial) (desktop)
      CASE
        WHEN (
          transaction_type != 'cc_validation'
          AND purchase_device = 'desktop'
        ) THEN 1
        ELSE NULL
      END as m2_value,
      -- FT-GB: >3 Transactions (after exposure) (binomial) (desktop)
      CASE
        WHEN (
          transaction_type != 'cc_validation'
          AND purchase_device = 'desktop'
        ) THEN 1
        ELSE NULL
      END as m3_value,
      -- FT-GB: Transactions (count) (desktop)
      CASE
        WHEN (
          purchase_device = 'desktop'
          AND transaction_type != 'cc_validation'
        ) THEN 1
        ELSE NULL
      END as m4_value,
      -- FT-GB: Transactions Credits (count) (desktop)
      CASE
        WHEN (
          purchase_device = 'desktop'
          AND transaction_type != 'cc_validation'
        ) THEN m.package_value
        ELSE NULL
      END as m5_value
    FROM
      (
        SELECT
          user_id,
          user_pseudo_id as anonymous_id,
          TIMESTAMP_MICROS(event_timestamp) AS timestamp,
          purchase_device,
          item_category,
          transaction_type,
          package_value,
          purchase_source
        FROM
          `fact.purchases`
        WHERE
          event_date BETWEEN PARSE_DATE('%Y%m%d', '20241212') AND PARSE_DATE('%Y%m%d', '20250311')
      ) m
    WHERE
      m.timestamp >= '2024-12-12 08:36:00'
      AND m.timestamp <= '2025-03-11 08:09:17'
  ),
h
Yes, unfortunately you'll need to upgrade to use user filters. We try not to ship versioned numbers with bugs like this but this one slipped through the cracks.
n
Thank you, Luke, for checking it out. I will ask our developers to update it. Have a great day!
Hello @helpful-application-7107, we just updated GB to 3.5 but I still have same problem with same all details.
h
What SQL engine are you using? sorry about this!
n
no problem. We are using BigQuery
@average-airport-34108
a
Hello 🙂 Joining the thread to continue this topic, as Ahmed will be ooo for next 2 weeks.
Hi @helpful-application-7107, any news on this topic that could help us in the right direction?