I have two properties, one containing the session number on the web and the second one containing the session number for apps. I want to create a custom property that will disregard the platform and just contain the session number overall. Describe me how to do it
Hi Robert Š., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
You can do this with a Custom Property that combines your two existing properties into one. Mixpanel’s custom properties let you build a new property from existing ones using a formula language. [Custom properties]Assume:
- Web session number property = web_session_number
- App session number property = app_session_numberYou’d create a Custom Event Property like: 1. In a report (e.g. Insights), open the custom property formula bar.
2. Choose Custom Event Property (so you can use event properties from both platforms). [Custom properties]
3. In the formula, reference your two properties (press . to pick them from the menu). For example, if only one of them is ever set on a given event, you can use an ifs expression to pick whichever is defined first: [Functions]
text
ifs(
defined(.web_session_number), .web_session_number,
defined(.app_session_number), .app_session_number
)
```LBKSLBKS - `defined()` checks whether a property exists on that event. [[Functions](https://docs.mixpanel.com/docs/features/custom-properties#functions)]LBKS4. Click **Apply** to use it in the current report; click **Save** (and optionally **Save and Share**) to reuse it across reports. [[Custom properties](https://docs.mixpanel.com/docs/features/custom-properties)]LBKSThis will give you a single “session number overall” property that ignores platform and just returns whichever session-number property is present on the event.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
