i got an event which has two boolean properties A and B. how can i create a pie chart reprot that schow the percentages of event occurences with A, B, A&B or None?
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
You can create a pie chart in Mixpanel Insights that shows the percentages of event occurrences with properties A, B, A&B, or None. Here's how to do it: 1. Go to the Insights report in Mixpanel 2. Select your event as the metric 3. Change the chart type to "Pie chart" (this is available when calculating a metric across the entire time period) 4. Use Custom Properties to create a new property that categorizes your event occurrencesFor the custom property, you'll need to create a formula that categorizes each event into one of your four desired segments. Here's how to create this custom property: 1. Click the plus button to the right of the search bar and select "Event Property" 2. Give your property a name like "A and B Segments" 3. In the formula field, you can use a formula that categorizes each event based on properties A and B 4. Apply the custom property to your report 5. Break down your event by this new custom propertyThe formula would need to categorize each event into "A only", "B only", "A and B", or "None" based on the boolean values of properties A and B.Custom Properties will allow you to create this categorization on the fly without modifying your underlying data.After applying this custom property, your pie chart will display the percentage breakdown of these four segments, giving you a clear visualization of how your event occurrences are distributed across these property combinations.
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'll create the formula for a custom property that categorizes events based on the boolean properties scanFaceRecognition
and scanSmartTagging
. This will help you create the pie chart showing the distribution of events with these properties.Here's the formula you can use in Mixpanel's custom property builder: LBKSifs( properties["scanFaceRecognition"] == true and properties["scanSmartTagging"] == true, "Both Face Recognition & Smart Tagging", properties["scanFaceRecognition"] == true and (properties["scanSmartTagging"] == false or not defined(properties["scanSmartTagging"])), "Face Recognition Only", properties["scanSmartTagging"] == true and (properties["scanFaceRecognition"] == false or not defined(properties["scanFaceRecognition"])), "Smart Tagging Only", "None" )LBKS
To create this custom property: 1. In your Insights report, click the plus button next to the search bar
2. Select "Event Property"
3. Name your property (e.g., "Scan Features Used")
4. Paste the formula above into the formula field
5. Click "Apply" to use it in your current report or "Save" to make it available for future use
6. Break down your event by this new custom property
7. Change the visualization to a pie chartThis formula uses the ifs()
function to check different combinations of your boolean properties and categorize each event accordingly. The formula handles cases where one or both properties might be undefined as well.Custom Properties provides these logical functions that allow you to create conditional categorizations based on your event properties.
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! 📚
Based on the documentation, the plus button for creating custom properties in Mixpanel is located to the right of the search bar in the report interface. According to the Mixpanel documentation: "Click the plus button to the right of the search bar, then select Event Property or User Property to open the property builder." Custom PropertiesWhen you're in an Insights report or another report type, you'll see a search bar that allows you to search for properties. The plus button should be positioned to the right of this search bar. After clicking this button, you'll be able to select whether you want to create a custom event property or user property, which will open the property builder interface where you can enter the formula we discussed earlier.If you're having trouble locating this button in the interface, you might want to check if you're in a report view (like Insights) where custom properties can be created, as the button may not appear in all sections of Mixpanel.I hope this helps clarify where to find the plus button!
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 see the issue with the formula. The error about "an even number of arguments" is likely related to the ifs()
function syntax in Mixpanel's custom properties.The ifs()
function requires pairs of arguments (condition, value), and the error suggests there might be an issue with how the arguments are structured. Let's correct the formula: LBKSifs( scanFaceRecognition == true and scanSmartTagging == true, "Both Face Recognition & Smart Tagging", scanFaceRecognition == true and (scanSmartTagging == false or not defined(scanSmartTagging)), "Face Recognition Only", scanSmartTagging == true and (scanFaceRecognition == false or not defined(scanFaceRecognition)), "Smart Tagging Only", true, "None" )LBKS
The key changes I made:
1. Removed properties["..."]
syntax - in Mixpanel's custom property builder, you can reference properties directly by name
2. Added a final true, "None"
pair to ensure we have a complete set of condition/value pairs
3. Made sure each condition has a corresponding valueAccording to the Mixpanel documentation on custom properties, the ifs()
function syntax is: LBKSifs(condition1, value1, condition2, value2, …)LBKS
Each condition needs a corresponding value, and the function returns the value corresponding to the first true condition. The last condition should typically be a catch-all (like true
) to handle cases where none of the previous conditions are met.Try this updated formula in the custom property builder.
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 understand you're getting an error about unknown variables 'scanFaceRecognition' and 'scanSmartTagging' even though your properties are named that way. This is likely due to how properties need to be referenced in Mixpanel's custom property formulas.In Mixpanel's custom property builder, you need to use the correct syntax to reference event properties. Let's fix the formula: LBKSifs( defined(event.properties.scanFaceRecognition) and event.properties.scanFaceRecognition == true and defined(event.properties.scanSmartTagging) and event.properties.scanSmartTagging == true, "Both Face Recognition & Smart Tagging", defined(event.properties.scanFaceRecognition) and event.properties.scanFaceRecognition == true and (not defined(event.properties.scanSmartTagging) or event.properties.scanSmartTagging == false), "Face Recognition Only", defined(event.properties.scanSmartTagging) and event.properties.scanSmartTagging == true and (not defined(event.properties.scanFaceRecognition) or event.properties.scanFaceRecognition == false), "Smart Tagging Only", true, "None" )LBKS
Alternatively, you can try a simpler syntax: LBKSifs( properties.scanFaceRecognition == true and properties.scanSmartTagging == true, "Both Face Recognition & Smart Tagging", properties.scanFaceRecognition == true and (properties.scanSmartTagging != true), "Face Recognition Only", properties.scanSmartTagging == true and (properties.scanFaceRecognition != true), "Smart Tagging Only", true, "None" )LBKS
The key is to use the correct property reference format according to Mixpanel's custom properties documentation. The exact syntax might vary slightly depending on your Mixpanel version, but one of these approaches should work.If you're still encountering issues, you might want to try using the dot notation to access your properties (as shown above) or check if there are any typos in the property names.
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 change your Mixpanel pie chart to show percentages instead of totals, you can use the "Percentage of Overall" comparison option. Here's how to do it: 1. In your Insights report with the pie chart visualization, look for the "Compare" menu at the top of the chart 2. Click on "Compare" and select "Percentage of Overall" from the dropdown menuThis will display each segment as a percentage of the total rather than showing absolute values.According to the Mixpanel documentation, the "Percentage of Overall" option "allows users to see how segments perform as a percentage of the total" Advanced Comparison Features.For pie charts specifically, this is a natural visualization option since pie charts inherently represent parts of a whole. The documentation confirms that pie charts support the "Percentage of Overall" comparison type.If you don't see percentages displayed on the chart itself after making this change, check if there are any display options in the chart settings that allow you to show the percentage values directly on the pie slices.I hope this helps you display the percentages for your scanFaceRecognition and scanSmartTagging segments!Is there anything else you'd like to know about customizing your Mixpanel pie chart?
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! 📚
Based on the Mixpanel documentation, there are specific conditions when comparison options might be disabled or greyed out in the interface.According to the documentation: "Mixpanel will proactively disable this option when this comparison option won't give meaningful results" Advanced Comparison Features.The reason your "Compare" dropdown options are greyed out could be due to: 1. The specific chart configuration you're using might not support certain comparison types. As mentioned in the documentation, not all chart types support all comparison options.2. For pie charts specifically, the documentation indicates that pie charts support "Percentage of Overall" but do not support "Time Comparison" or "Percentage change over Baseline" Advanced Comparison Features.The compatibility table from the documentation shows: - Pie charts only support "Percentage of Overall" comparison - They do not support "Time Comparison" or "Percentage change over Baseline"This is likely why some options in your dropdown are greyed out - they're not applicable to pie chart visualizations.To see percentages in your pie chart, you might need to look for other display options specific to the pie chart visualization, as the comparison options have these limitations for this chart type.Is there a specific comparison option you were trying to enable?
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 understand you're having trouble with the percentage comparison option being greyed out in your pie chart with a custom property breakdown.According to the Mixpanel documentation, there are specific conditions when comparison options might be disabled. For pie charts specifically, while they should support the "Percentage of Overall" comparison option, there are some limitations that might cause this option to be greyed out.From the documentation: "Mixpanel will proactively disable this option when this comparison option won't give meaningful results" Advanced Comparison Features.There are a few possible reasons why the percentage comparison option is greyed out: 1. Custom property calculation: When using custom properties for breakdowns, sometimes the underlying data structure might not support percentage calculations in the way Mixpanel expects.2. Data type incompatibility: The custom property you created might have a data structure that doesn't work well with percentage calculations.3. Visualization limitations: Some specific configurations of pie charts might have limitations with comparison options.As an alternative approach to see percentages: - Check if your pie chart already shows percentages by default (many pie chart implementations automatically show percentage distributions) - Look for display or formatting options specific to the pie chart visualization - Try hovering over pie segments to see if percentage information appears in tooltipsIf you need to explicitly see percentages, you might also consider trying a different chart type like a bar chart with the same breakdown, where the comparison options might be more readily available.Is the pie chart showing the breakdown of your custom property with the four categories (Both, Face Recognition Only, Smart Tagging Only, None) correctly, just without percentage labels?
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.