how can I calculate the average length and maximum length of text properties
Hi Tobias, 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 calculate the average and maximum length of text (string) properties in Mixpanel, you can use custom properties to compute the length of a string, and then use aggregate functions in Insights reports.Step 1: Create a Custom Property for String LengthMixpanel allows you to define custom properties using formulas. You can create a custom property that calculates the length of your text property (e.g., "comment", "search_term") using the formula builder in the report interface. While the exact function for string length is not explicitly mentioned in the knowledge sources, Mixpanel's custom property feature supports Excel-like formulas and provides a list of available functions via Ctrl + Space in the formula bar. You would typically look for a function like LEN()
or similar in the formula builder interface to compute string length. If such a function is available, you can define: LBKSLEN([Your Text Property])LBKS
Step 2: Aggregate the Custom PropertyOnce you have the custom property for string length, you can use the Insights report to aggregate this property: - To find the average length, use the "Average" aggregation on your custom property.
- To find the maximum length, use the "Maximum" aggregation.These aggregation options are available for numeric properties in Insights reports, including those created via custom properties. You can select these from the measurement dropdown in the report builder, as described in the documentation on aggregate property measurements and aggregation options Insights: Measurements and Aggregate Property.Note:
If you do not see a string length function in the custom property formula builder, then this calculation may not be directly supported in the Mixpanel UI, and you would need to preprocess this data before sending it to Mixpanel or use JQL (JavaScript Query Language) for advanced queries. However, the knowledge sources do not explicitly mention a built-in string length function or a direct method for this calculation.Summary:
- Use a custom property to calculate string length (if supported).
- Aggregate using "Average" and "Maximum" in Insights.If you need to perform this calculation and cannot find the string length function, you may need to preprocess your data or use JQL, but the knowledge sources do not provide explicit details on this approach.Custom Properties: Calculate new properties on the fly
Insights: Measurements
Aggregate Property
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! 📚
You can use the len()
function in Mixpanel’s custom property formula builder to calculate the length of a string property. For example, if your property is called comment
, the formula would be: LBKSlen(comment)LBKS
This will return the number of characters in the comment
property for each event. You can then use this custom property in your reports to calculate averages, maximums, etc.
Custom Properties: Functions
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! 📚
If your original property is already a custom property, you can still use it as an input to another custom property formula in Mixpanel. The formula builder allows you to reference existing custom properties by name, just like you would with standard event or user properties.For example, if you have a custom property called my_custom_string
, you can calculate its length with: LBKSlen(my_custom_string)LBKS
This chaining is supported in Mixpanel’s custom property system, so you can build on top of previously defined custom properties. The documentation confirms that you can use custom properties almost anywhere you use regular properties, and the formula builder supports referencing them in new formulas Custom Properties: Calculate new properties on the fly.If you encounter any issues, ensure that the custom property you are referencing is available in the property dropdown or via autocomplete in the formula builder. If it does not appear, it may not be saved globally or may not be available in the current report context.
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 create a custom property in Mixpanel: 1. Go to a report (such as Insights, Funnels, or Retention). 2. Click the plus button to the right of the search bar. 3. Select "Event Property" or "User Property" to open the property builder. 4. Optionally, give your property a name. 5. Enter your formula in the formula bar. You can use functions and reference existing properties. Use Ctrl + Space to see available functions and period (.) to search for properties. 6. Click Apply to use the custom property locally in your report. 7. To save the custom property for reuse in other reports, click Save. You can also add a description and choose to share it with colleagues or teams.Note: Custom properties are local to the report by default. Only when you save them do they become available for reuse and appear in the Lexicon. If you cannot find your custom property in Lexicon, it may not have been saved globally yet Creating a Custom Property.
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.
Duh
Let me check the knowledge base for you again. One moment! 📚
I'm sorry, but the knowledge sources do not provide a screenshot or explicit description of the exact location of the "plus button" in the new Mixpanel UI layout. The documentation states to "click the plus button to the right of the search bar" when creating a custom property, but it does not specify its precise placement or appearance in the latest interface. If you are unable to find it, it may help to look for a "+" icon near the property or event search bar within a report (such as Insights), or consult Mixpanel's in-app help or support for the most up-to-date UI guidance Creating a Custom Property.
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.