Mixpanel Community Icon

Using SQL LIKE in Mixpanel Custom Property Formula

·
·

Can we use in Mixpanel in Custom Property Formula something like sql like? I mean var1 LIKE 'abc%'

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Monika, 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Unfortunately, Mixpanel's Custom Property Formula does not directly support SQL-like LIKE operators. However, Mixpanel does offer some similar functionality through other functions that can be used in Custom Property Formulas. Here are some alternatives you can use: 1. has_prefix(): This function checks if a string starts with a specific prefix. It's case-insensitive. Example: has_prefix(var1, "abc") This would be similar to SQL's var1 LIKE 'abc%'2. has_suffix(): This function checks if a string ends with a specific suffix. It's also case-insensitive.3. regex_match(): This function allows you to use regular expressions for more complex pattern matching. Example: regex_match(var1, "^abc.*") This would be equivalent to SQL's var1 LIKE 'abc%'These functions are documented in Mixpanel's Custom Properties reference guide. For more details and examples, you can refer to Mixpanel's Custom Properties documentation.Remember that while these functions provide similar functionality to SQL's LIKE operator, the exact syntax and behavior may differ. Always test your formulas to ensure they behave as expected with your specific data.

    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.