I want to create a custom property that combines 3 other properties and take a value from each one if it's different from (not set) value. How should I write condition that checks if value is (not set)?
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
To create a custom property that combines 3 other properties and takes a value from each one if it's different from "(not set)", you'll need to use the defined()
function in Mixpanel's custom property formula.The defined()
function determines if a value exists. If a property is not defined on a parent event or profile (i.e., it's "(not set)"), this will return false; otherwise, it will return true.Here's how you could write a formula that checks three properties (let's call them A, B, and C) and uses the first one that is defined: LBKSifs( defined(A), A, defined(B), B, defined(C), C )LBKS
This formula uses the ifs()
function which runs multiple checks and returns a value corresponding to the first true result. It will:
1. First check if property A is defined (not "(not set)"), and if so, return its value
2. If A is not defined, check if B is defined, and if so, return its value
3. If neither A nor B are defined, check if C is defined, and if so, return its value
4. If none of the properties are defined, it will return undefinedYou can create this custom property by clicking the plus button to the right of the search bar in your Mixpanel report, selecting Event Property or User Property, and then entering this formula in the formula bar.Custom Properties: Calculate new properties on the fly
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.