Is there a way to create a custom property that is max of a property value. Our scenario - we track user trial with a Trial event that captures trial_start and trial_end. if user requests trial extension, a new Trial event is fired with new trial_end date. We want to know how many users trial expired "before last x days", and for this we need to check the trial_end on the latest Trial event.
There is a "max()" function for custom properties but I think the issue you are going to have is the way you are tracking data. You are tracking an event property but it seems like you want a user_property. You could/should (perhaps) add a user property which is the trial_start_date and trial_end_date and you could update that property(ies) when they do a new trial. You could also add a user_property for trial_count which you increment when they do a second/third/etc trial. Would make for easy cohort determination too
thanks Andrew S. - max ( ) function is limited to determining max of two numbers. not that useful. unfortunately, the user_profile properties doesn't work, being a saas, we have workspaces and users, a user can be part of multiple workspaces and workspaces can have multiple users. we create one user profile for each user (unique email). user's activity (events in mixpanel) is tracked in the workspace context. so, for example, a user can be paid subscriber for workspace A, free plan in workspace B, and in trial for workspace C. [Very similar to slack). Every event maintains workspace_id that let us analyze user's activity in the context of a workspace via group key etc.
Even if we could find the Last Value of certain property, it would work. MP gives "First Value" function but not the "Last Value".
you could use "group profiles" for tracking your workspaces (in our example, channels).
so each user is assigned to a channel and we can then do analysis at the channel level.
and yes, "last value" would work perfectly but to my knowledge that is not available (although I know others have suggested it before, probably worth putting in the product-ideas channel)
from 2022