i've got a property 'number of assets' that is sent as property with each user and reflects the number of assets which the user can acces in the system. to determine the total number of assets in one customer system i can use maximum aggregation of the user type 'admin', different systems are distinguished by URL. how can I calculate the total number of assets in all syswtems with mixpanel?
Here's how you can approach calculating the total number of assets across all systems in Mixpanel:
Recommended Approach: Two-Step Analysis
Your logic is:
Per system (URL): find the maximum number of assets among admin users โ this gives the asset count for that system
Sum those maximums across all systems โ total assets across all systems
Unfortunately, Mixpanel's built-in Insights measurements don't natively support a "sum of per-group maximums" in a single query. However, here are your options:
Option 1: Use JQL (JavaScript Query Language)
JQL supports chained aggregations, which is exactly what you need โ first compute the max per URL (system), then sum those maximums:
function main() {
return People()
.filter(function(user) {
return user.properties.role === "admin"; // filter to admin users only
})
.groupBy(["properties.url"], mixpanel.reducer.max("properties.number_of_assets"))
.reduce(mixpanel.reducer.sum("value"));
}This pattern โ grouping first, then reducing again โ is supported in JQL. [JQL Chained Aggregations]
Option 2: Use Insights with Manual Aggregation
In Insights, you can use Aggregate Property with Maximum aggregation, broken down by URL. This gives you the max number of assets per system. However, summing those maximums would need to be done manually (e.g., exported to a spreadsheet). [Aggregate Property]
Option 3: Custom Property + Insights
If your data model allows it, you could use a Custom Property to define intermediate calculations, but custom properties operate at the individual event/profile level and don't support cross-group aggregations like "sum of maximums." [Custom Properties]
Summary: The most powerful and automated way to achieve "sum of per-system maximums" directly in Mixpanel is via JQL, which supports chained aggregations. The Insights UI alone cannot perform this two-level aggregation in a single step.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Great question โ this relates to using Group Analytics with Group Profiles in Mixpanel.
What Group Profiles Can Do
With Group Analytics, you can set a property like number_of_assets directly on a Group Profile (e.g., per customer/company). This is analogous to a user profile property, but at the group level. [Group Analytics Overview]
Can You Sum a Group Profile Property Across All Groups?
The knowledge sources do not explicitly confirm that you can perform a "sum across all group profiles" directly in the Mixpanel Insights UI using a Group Profile property. The Insights Aggregate Property measurements (Sum, Average, etc.) are documented for user profiles and events, but not specifically for Group Profiles. [Aggregate Property]
What You Can Do with JQL
If you set number_of_assets as a Group Profile property, you could query it via JQL using People() scoped to the group โ however, the knowledge sources don't provide explicit documentation on querying Group Profiles (as opposed to User Profiles) via JQL.
Practical Recommendation
Based on the available documentation, the most reliable approach remains the JQL chained aggregation described in your previous query โ filtering admin users by URL (system), taking the max per system, then summing across systems. This doesn't require Group Profiles at all.
If you want to use Group Profiles specifically, I'd recommend checking Mixpanel's Group Analytics documentation or contacting Mixpanel support directly, as the knowledge sources don't contain enough detail to confirm whether summing a Group Profile property across all groups is supported in the UI.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
