I want to create a property calculated custom field at profile level where tells me with yes or no if the first seen is within or not business hours. how can I do this
Hi Juan I., 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 at the profile level that indicates whether a user's first seen time is within business hours or not, you can use Mixpanel's Custom Properties feature. Here's how you can approach this:1. First, create a custom property using the Custom Properties feature in Mixpanel.2. In the formula for this custom property, you'll need to use the $mp_first_event_time
reserved profile property, which represents the time of the user's very first event in Mixpanel.3. Then, you can use a combination of functions to check if this time falls within business hours. Here's an example of how the formula might look:LBKSif( and( hour($mp_first_event_time) > = 9, hour($mp_first_event_time) < 17, weekday($mp_first_event_time) > = 1, weekday($mp_first_event_time) <= 5 ), "Yes", "No" )LBKS
This formula assumes business hours are 9 AM to 5 PM, Monday to Friday. You can adjust these values as needed for your specific business hours.4. After creating the custom property, you can save it to make it available for use in your analyses.For more detailed instructions on creating custom properties, you can refer to the <https://docs.mixpanel.com/docs/features/custom-properties#creating-a-custom-property|Custom Properties documentation>.Note that custom properties are calculated on the fly when you use them in reports, so this approach allows you to create this property without modifying your data collection or processing pipeline.Custom Properties: Calculate new properties on the fly provides more information on the functions and operators you can use in custom property formulas.Remember that $mp_first_event_time
is a reserved profile property in Mixpanel, representing the time of the user's very first 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.
Let me check the knowledge base for you again. One moment! đ
To use the $mp_first_event_time
property, you don't need to find it in your Lexicon. This is because $mp_first_event_time
is a special reserved profile property that Mixpanel automatically calculates and maintains for each user profile. Here's what you need to know:1. $mp_first_event_time
is a reserved profile property in Mixpanel. It represents "the time of the user's (or group's) very first event in Mixpanel."2. This property is automatically calculated by Mixpanel, so you don't need to explicitly track or set it yourself.3. Even if you don't see it in your Lexicon, you can still use it in your custom property formulas or analyses.4. The property will be available for use as long as you have events being tracked for your users in Mixpanel.If you're still having trouble using this property, here are a few things you can check:- Make sure you're looking for it in the correct place. When creating a custom property, you should be able to access $mp_first_event_time
by typing a period (.) and searching for it among the available properties.- Ensure that you have events being tracked for your users. If no events have been tracked, this property won't have a value.- If you're still unable to find or use this property, it might be worth contacting Mixpanel support as there could be a configuration issue with your project.Remember, $mp_first_event_time
is a system-generated property, so it won't appear in your Lexicon alongside your custom-defined properties. You can use it directly in your formulas and analyses without needing to define or import it.Reserved Properties: Properties used for system features provides more information about reserved properties like $mp_first_event_time
in Mixpanel.
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.
Let me check the knowledge base for you again. One moment! đ
Yes, you can definitely use $mp_first_event_time
in a formula for a custom property in Mixpanel. This is exactly what custom properties are designed for - to create new properties based on existing ones, including reserved properties like $mp_first_event_time
.Here's how you can do it:1. Go to the Custom Properties feature in Mixpanel.
2. Create a new custom property.
3. In the formula editor, you can use $mp_first_event_time
directly in your formula.For example, you could use it in a formula like this:LBKSif( and( hour($mp_first_event_time) > = 9, hour($mp_first_event_time) < 17, weekday($mp_first_event_time) > = 1, weekday($mp_first_event_time) <= 5 ), "Yes", "No" )LBKS
This formula checks if the user's first event time was during business hours (9 AM to 5 PM, Monday to Friday).Remember, when you're creating the formula, you can access $mp_first_event_time
by typing a period (.) and searching for it among the available properties.For more information on creating custom properties and using formulas, you can refer to the <https://docs.mixpanel.com/docs/features/custom-properties#creating-a-custom-property|Custom Properties documentation>. This guide provides detailed instructions on how to create and use custom properties, including how to use existing properties in your formulas.Custom Properties: Calculate new properties on the fly also provides examples of how to use various functions and operators in your custom property formulas, which can be helpful when working with time-based properties like $mp_first_event_time
.
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.
Let me check the knowledge base for you again. One moment! đ
To get the hour of the first time seen using formulas available in Mixpanel for custom properties, you can use the hour()
function in combination with the $mp_first_event_time
reserved profile property. Here's how you can do it:1. Create a new custom property in Mixpanel.
2. In the formula editor, use the following formula:LBKShour($mp_first_event_time)LBKS
This formula will extract the hour (in 24-hour format) from the user's first event time.If you want to convert it to a 12-hour format with AM/PM indicator, you can use a more complex formula:LBKSif( hour($mp_first_event_time) == 0, "12 AM", if( hour($mp_first_event_time) < 12, string(hour($mp_first_event_time)) + " AM", if( hour($mp_first_event_time) == 12, "12 PM", string(hour($mp_first_event_time) - 12) + " PM" ) ) )LBKS
This formula will return the hour in a more readable format like "3 PM" or "11 AM".Remember that $mp_first_event_time
is a reserved profile property in Mixpanel that represents "the time of the user's (or group's) very first event in Mixpanel" <https://docs.mixpanel.com/docs/data-structure/property-reference/reserved-properties|Reserved Properties: Properties used for system features>.For more information on creating custom properties and using formulas, you can refer to the Custom Properties documentation. This guide provides detailed instructions on how to create and use custom properties, including how to use existing properties and functions in your formulas.
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.
Let me check the knowledge base for you again. One moment! đ
I apologize for the confusion in my previous responses. You're correct that hour
and weekday
are not available functions in Mixpanel's custom property formulas. Let me provide you with the correct information based on the available Mixpanel documentation.To extract the hour from the $mp_first_event_time
, you can use the datetime_extract()
function. Here's how you can create a custom property to get the hour of the first time seen:LBKSdatetime_extract($mp_first_event_time, "hour")LBKS
This will return the hour in 24-hour format (0-23).For determining if it's within business hours or weekdays, you'll need to use a combination of datetime_extract()
functions. Here's an example of how you might create a custom property to check if the first seen time is within business hours (assuming 9 AM to 5 PM, Monday to Friday):LBKSif( and( datetime_extract($mp_first_event_time, "hour") > = 9, datetime_extract($mp_first_event_time, "hour") < 17, datetime_extract($mp_first_event_time, "day_of_week") > = 1, datetime_extract($mp_first_event_time, "day_of_week") <= 5 ), "Yes", "No" )LBKS
Note that datetime_extract()
with "day_of_week" returns 0 for Sunday, 1 for Monday, and so on.For more information on the available functions and how to use them in custom properties, you can refer to the <https://docs.mixpanel.com/docs/features/custom-properties#functions|Custom Properties documentation>. This documentation provides a comprehensive list of functions you can use in your custom property formulas, including date and time manipulation functions.I apologize again for the earlier misinformation. Thank you for bringing this to my attention, as it allows me to provide you with the correct and most up-to-date information.
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.