How can I compare an event property to a specific date, in a custom property?
Hi Eliza W., 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 compare an event property to a specific date in a custom property by: 1. Making sure the property you’re comparing is a Date (or casting it if needed).
2. Using the standard comparison operators (<, > , <=, > =, ==, !=) in the custom property formula. [Comparison ops]For example, if you have an event property Event Date and you want to check whether it is on or after 2024-01-01, your custom property formula could look like: text <Event Date> > = "2024-01-01T00:00:00"LBKSYou can then wrap that in an if to return labels: text if(<Event Date> > = "2024-01-01T00:00:00", "On or after 2024-01-01", "Before 2024-01-01")LBKSCustom properties support date arithmetic via datedif and also allow comparing two date properties directly (e.g., datedif(A, B, "D"), or A > B). [Custom props funcs]
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.
Hey, the AI answer sorted me out. I wanted to specify a particular date in a custom property but I couldn't find any examples or instructions in the regular help docs. I was trying things like "2025-01-01", date("2025-01-01"). Just needed the extra bit with the time.
Thanks for checking in!
