I read about within on the document, but I couldn’t understand what does it mean exactly.
- Within. Looks at events fired within each cohort member's X days of first use. This is useful when you're interested in the group of users who fired a specific event within X days of becoming a new user.
|2021-05-01||1||Purchase Song or Video|
|2021-05-02||1||Play Song or Video|
The user_id 1 is picked by the below condition. Right?
Can I get some more detailed explanations for the “within”?
Best answer by Saish RedkarView original
Think of it in 2 steps
As far as I can tell, “within 1 days” means you’re looking at a group of users who have performed your specified event (Purchase Song or Video >= 1 time) within 1 day of first use.
I’m 90% sure that “first use” means the first event (most likely “[Amplitude] Start Session”)
I’m not entirely sure about the “in the past 90 days” part. My guess is that you’re only looking at “New users” within the past 90 days (excluding those who’ve visited prior).
After finding the user group, you’re determining how many users have performed “Play Song or Videos” event (if chart is set to “Uniques”).
About your test user_id 1
Given your 2 events, we can’t determine if the user is included or not. The first event is related to Step 1 whereas the 2nd event is related to Step 2.
What you need for Step 1 is the timestamp of the very first event of the user + your filtering event (“Purchase Song or Video”). And of course the user needs to be considered “New” within the past 90 days.
That’s my understanding of it, after a bit of digging :)
Andreas has a great explanation on how the “within” clause works here.
To simplify further, let’s consider two users 1 and 2 and who were new on 05/01.
So, as per the condition, only user 1 would be pulled into the chart since user 1 performed “Purchase Song or Video” event within the 1 day time duration, and not user 2.
Let me know if this helps!
It’s clear! Thanks all~