How can I use UNION in a formual for two events without duplicating data?
The knowledge sources don't contain information about using a "UNION" formula for combining two events in Mixpanel reports or formulas.
What the knowledge sources do cover is the union() method for user/group profile properties. This method appends new values to a list profile property while excluding duplicates, which prevents data duplication in list-type properties.
For example, in JavaScript:
// set profile properties for user "1234"
mixpanel.identify('1234');
mixpanel.people.set({
name: 'Sam',
roles: ['sales', 'engineer']
});
// will be ignored since "engineer" already exists in "roles"
mixpanel.people.union('roles', 'engineer');
// add "legal" to "roles" since it doesn't exist yet
mixpanel.people.union('roles', 'legal');
This union() method is available across multiple SDKs (JavaScript, Python, Ruby, Flutter, React Native, Android, Unity, etc.) for both user profiles and group profiles.
If your question is about combining events in a Mixpanel report formula (e.g., in Insights), the knowledge sources do not contain enough information to answer that. I'd recommend checking the Mixpanel documentation directly or reaching out to Mixpanel support for guidance on report-level formulas.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
