Skip to main content
Solved

Group by event properties


lukeamp
Helpful Hero
Forum|alt.badge.img+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

Best answer by ning.chang

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
Did this topic help you find an answer to your question?

13 replies

lukeamp
Helpful Hero
Forum|alt.badge.img+1
  • Author
  • Helpful Hero
  • 8 replies
  • May 2, 2021

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!

 


ning.chang
Team Member
Forum|alt.badge.img+7
  • Team Member
  • 72 replies
  • Answer
  • May 3, 2021

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


lukeamp
Helpful Hero
Forum|alt.badge.img+1
  • Author
  • Helpful Hero
  • 8 replies
  • May 4, 2021

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!


Saish Redkar
Expert
Forum|alt.badge.img+10

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.


ning.chang
Team Member
Forum|alt.badge.img+7
  • Team Member
  • 72 replies
  • May 5, 2021

Exactly what Saish said ^^ :grin:  


lukeamp
Helpful Hero
Forum|alt.badge.img+1
  • Author
  • Helpful Hero
  • 8 replies
  • May 5, 2021

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?


ning.chang
Team Member
Forum|alt.badge.img+7
  • Team Member
  • 72 replies
  • May 5, 2021

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


lukeamp
Helpful Hero
Forum|alt.badge.img+1
  • Author
  • Helpful Hero
  • 8 replies
  • May 5, 2021

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?


lukeamp
Helpful Hero
Forum|alt.badge.img+1
  • Author
  • Helpful Hero
  • 8 replies
  • May 9, 2021

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!


ning.chang
Team Member
Forum|alt.badge.img+7
  • Team Member
  • 72 replies
  • May 17, 2021

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. 


MikkoKarvonen
Peer Moderator
Forum|alt.badge.img+3
lukeamp wrote:

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.

 

 


  • New Member
  • 2 replies
  • January 12, 2023

Hello, i am having a ton of trouble adding in multiple grouped by within a single event.

 

Example, I am looking to see total revenue by a certain product or total revenue by a certain color.

 

When comparing this chart to my gross revenue, to ensure the numbers match - they do not.

My gross revenue chart is $10k less than my gross revenue by product chart.

 

How are these values being calculated?

 

 

The chart on the left has the additional grouping by product name, which does not match the chart on the right - shouldn’t it??


Jeremie Gluckman
Team Member
Forum|alt.badge.img+9

Hi @adam.s, Please excuse the delay. Were you able to resolve this?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings