kapa.ai can i use a case when or if else and use it to trigger different thresholds for different hours (using custom formula in report) or create them as binary report and use it for alerts
Certainly! Based on the knowledge sources, you can use the if or ifs functions in Mixpanel’s custom properties to create a binary flag for specific hours or conditions. Here’s an example formula that flags events occurring during a specific hour (e.g., hour 9) as 1 and all others as 0: plaintext if(HOUR==9, 1, 0)LBKS
If you want to flag multiple hours with different values, you can use the ifs function: plaintext ifs( HOUR == 9, 1, HOUR == 10, 2, HOUR == 11, 3 )LBKS
This formula will return 1 for hour 9, 2 for hour 10, 3 for hour 11, and undefined for all other hours. You can then use these custom properties as binary metrics in your reports and set up alerts for each condition as needed.Note: Replace HOUR
with the actual property name in your data that represents the hour of the event.For more details on using if and ifs in custom properties, see the Custom Properties: Functions documentation.If you need to flag a condition as true/false (binary), you can also use: plaintext if(HOUR == 9, "True", "False")LBKS
Or, for more complex logic: plaintext if((HOUR == 9 or HOUR == 10) and EVENT == "Purchase", 1, 0)LBKS
These examples are directly supported by Mixpanel’s custom property formula syntax as described in the documentation here.
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! 📚
Mixpanel does not currently support setting different alert thresholds for different hours directly within a single alert or via a custom formula in the report. The alerting system allows you to: - Set a single custom threshold (above, below, increases by, decreases by) for a metric in an Insights or Funnels report. - Use anomaly detection (Enterprise only) to automatically detect significant deviations from expected values, but this is not configurable for different thresholds by hour—it's based on statistical modeling of the time series as a whole. - Alerts can be triggered on a segment (e.g., a specific hour if you break down by hour), but each alert is tied to a single threshold per segment, not multiple thresholds for different hours within the same alert.You can use custom properties or formulas (including if-else logic) to create binary metrics (e.g., flagging if a value is above a certain threshold for a given hour), and then set up alerts on those. However, you would need to create separate alerts for each condition you want to monitor, as Mixpanel does not support multiple thresholds within a single alert or dynamic thresholds based on property values like hour of day.If you need to monitor different thresholds for different hours, you would have to: 1. Create a custom property or formula that flags each hour/condition as a separate binary metric. 2. Set up individual alerts for each binary metric or segment.Custom buckets and custom properties support if-else logic for segmentation, but not for dynamic alert thresholds within a single alert. For more advanced, hour-specific thresholding, you would need to manage this with multiple alerts or external automation.References: - Alerts: Get notified about anomalies in your data - Alert Criteria Types - Custom Properties: Calculate new properties on the fly - Custom Buckets FAQ
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.