Mixpanel Community Icon

Create Total Value USD by Adjusting Currency Values in Events

·
·

I have an event 'Subscription purchased', which has 2 event properties: "currency' and 'Value USD'. I want to create a custom event property called Total Value USD. What formula can I use so that if 'Currency' = 'GBP', then it should multiply 'Value USD' by 1.25

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

    Hi Chris S., 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
    ·
    ·

    To create a custom event property called "Total Value USD" based on the conditions you described, you can use the following formula in Mixpanel's Custom Properties feature: LBKSif(currency == "GBP", <Value USD> * 1.25, <Value USD> )LBKSThis formula uses the if function, which is one of the available functions in Mixpanel's Custom Properties. Here's how it works: 1. It checks if the "currency" property is equal to "GBP". 2. If true, it multiplies the "Value USD" property by 1.25. 3. If false (i.e., the currency is not GBP), it simply returns the original "Value USD" value.To create this custom property in Mixpanel: 1. Click the plus button to the right of the search bar in your report. 2. Select "Event Property" to open the property builder. 3. Name your property "Total Value USD". 4. In the formula bar, enter the formula provided above. 5. Click "Apply" to use it in your current report, or "Save" to make it available for future use.For more detailed instructions on creating custom properties, you can refer to the Custom Properties documentation.Remember that the comparison in the if function is case-sensitive, so make sure your "currency" property uses "GBP" exactly as written in the formula.

    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.