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

View original

11 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!

 

Userlevel 4
Badge +2

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 7
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.

Userlevel 4
Badge +2

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?

Userlevel 4
Badge +2

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!

Userlevel 4
Badge +2

Hey @lukeamp

Hope your weekend was great!

According to this documentation, Amplitude pulls the IDFV or generates a random alphanumeric string that ends with the letter 'R' for the device ID; this string is stored locally in the browser's cookie or mobile device. For web-based applications, Amplitude will set the device ID to a randomly generated UUID by default. It will persist unless a user clears their browser cookies and/ or is browsing in private mode. Therefore, I am not too sure that this approach of forcing device ID = company ID will work. 

Userlevel 5
Badge +2

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!

Just want to add that given your original data format, you can count the unique companies by switching to weekly view, and then using Formula PROPCOUNT, while grouping your event by the property that you want to count unique values for.

 

 

Reply