Solved

Group by event properties


Badge +1

Hi all!

I’m new to Amplitude. Just tried to push some data and I was successful. I’m especially interested in the event_properties and how I can create some expressive charts around them.

However, I don’t see any options to “group by property_x”? 

For example, let’s say I store a event property“company” for a user. How can I make a chart to group the events by company, so I know which company did create how many events on a daily / weekly level?

Here is a sketch :)

Can you advise?

Thank you!

Lukas

icon

Best answer by ning.chang 3 May 2021, 06:59

Hello Luke! Welcome to the Amplitude community!! :wave_tone1:

You can actually group_by an event property if you apply the group_by filter to the event itself in the left-hand module! 

Just a side note though, most use cases will have ‘company’ as a user property instead of an event property, since that is typically a characteristic or trait of a user, instead of an attribute of a particular event. You can read more about user vs. event properties here: https://help.amplitude.com/hc/en-us/articles/115002380567

This definitely depends on your particular use case though, just something I wanted to highlight in case it’s helpful :slight_smile:

Cheers!

Ning

View original

9 replies

Badge +1

Found this out myself, If I add the “company” as user_property, then I can group_by this property and get the result I want.

However, it would still be very cool to be able to group gy event_properties. Is that possible somehow?

Thank You!

 

Badge +1

Hello Luke! Welcome to the Amplitude community!! :wave_tone1:

You can actually group_by an event property if you apply the group_by filter to the event itself in the left-hand module! 

Just a side note though, most use cases will have ‘company’ as a user property instead of an event property, since that is typically a characteristic or trait of a user, instead of an attribute of a particular event. You can read more about user vs. event properties here: https://help.amplitude.com/hc/en-us/articles/115002380567

This definitely depends on your particular use case though, just something I wanted to highlight in case it’s helpful :slight_smile:

Cheers!

Ning

Badge +1

Hi @ning.chang

This worked! 

One related question: How can I now display the weekly active “companies”? With other words:

  • “Event totals” = All events
  • “Uniques” = Unique users
  • ? = Unique companies

Any idea?

Thank you!

Userlevel 5
Badge +4

Hey @lukeamp ,
For that particular use case, you can either instrument a user property which uniquely identifies a given company or utilize Amplitude’s group properties and then use the grouping to count accordingly.

You can read more on the Accounts feature here. Note that this is a paid add-on.

Hope this helps.

Badge +1

Exactly what Saish said ^^ :grin:  

Badge +1

Hey @Saish Redkar!

Thanks! Ok I see. Hmm. Well we are just starting out and even though we applied for startup scholarship I don’t know if that would be included in our package. 

As Alternative Approach, since “active companies” is one of our key metrics, I’m thinking of using the company id as “user id” and the actual user id as property (or maybe “device id”?). Should that work as well?

Greetings?

Badge +1

Hey Lukas,

The alternative you suggest works as well, which will be to instrument the '[Amplitude] User ID' field to be set to ‘Company A’ instead of 'User A'. 

You can even consider setting up two projects, one to track uniques at a company level and not to track uniques at a user level (although this will mean your event volume essentially doubling). 

Badge +1

Ok great, I’ll think this through. And what about using the “device id” as user id along with the “user id” as company id?

Badge +1

Hi @ning.chang, what do you think about the approach of using the device_id as (some sort of) company id? Will we be able to group users by device_id=company_id then and the the total number of companies easily? Thanks!

Reply