Hi,
My app has the model where a user can create many groups (but capped at 20).
Each time a user creates a group I emit this Keen metric:
name: groups.created
properties:
- user_id
- group_id
- created_at
The analysis I'm trying to calculate is to show how many users have group-count=1, how many have group-count=2, etc, (up to 20).
As a user adds new groups over time they will have multiple Keen "records" they've emitted. So I realize this is a variable data set (is that the right terminology).
I know how I could calculate this in SQL - the following query would do the trick:
select count(c.cnt) as user_count, c.cnt from
(
select
creator_id, count(*) as cnt
from groups
group by creator_id /* creator_id is the User ID who created the group */
) c
group by c.cnt
How can I do this in Keen? If need be I can restructure my collections or events.
Thanks for any guidance.
/Cody Caughlan