Hi, I want to create a formula metric that calculates the difference between two metrics at the current and previous time intervals. How do i do that?
Hi Lennard H., 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 create a formula metric that calculates the difference between two metrics at the current and previous time intervals, you can use Mixpanel's Formulas feature. Here are the steps:1. Click the Metrics button, then select Formula. Each event in the query shows a letter next to it, which indicates its variable name. 2. Use these letters in combination with the arithmetic operators to calculate a more advanced query. Mixpanel supports the following operators:
- Add: -
- Subtract: -
- Multiply: -
- Divide: /
- Use parentheses ()
to influence the order of operations.3. You can also use numbers as constants in a formula. For example, you can multiply a ratio by 100 to display as a percentage, or divide a property value tracked in seconds by 3,600 to display the value in hours.4. You can rename a formula by selecting Rename in the overflow menu of the formula.Please note that you cannot nest a formula metric when constructing another formula.To compare the current period of time to previous periods, you can use the Compare to past button at the top of your Insights graph and select the time period you wish to compare to. You can also select a custom date range.For more details, you can refer to the Mixpanel documentation on Formulas and Time Period Comparisons.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
⤵️ Hint: Mention @kapa.ai in the thread for follow-ups.