Variance as a Row

I found the following Beastmode calculation

 

(
(SUM(CASE WHEN YEAR(`MyDateColumn`) = YEAR(CURRENT_DATE()) THEN `Amount` ELSE 0 END)
- SUM(CASE WHEN YEAR(`MyDateColumn`) = YEAR(CURRENT_DATE()) - 1 THEN `Amount` ELSE 0 END)
)
/ NULLIF(SUM(CASE WHEN YEAR(`MyDateColumn`) = YEAR(CURRENT_DATE()) - 1 THEN `Amount` ELSE 0 END), 0)
)
 
But it creates a column. I'd like to add it as a row to compare MoM data. Help?

Comments

  • You can use something similar to this to get your value (y-axis) for a MoM comparison. What you need to do is create multiple beastmodes (columns with values) that you can use as series for this comparison. I've done this a number of ways (WoW, rolling 30 days, YoY, etc).Essentially you need to create a beastmode with date filters to only show the value within a certain range and give them easy names to digest (eg This Year Visits and Last Year Visits). You can use this to show actual values or % change of period vs period (or both!).

     

    Now for the date issue. You can then create a general x-axis (eg month(`date`)).

     

    Now you're ready to build your comparison

     

    1. Set your date range selector to All Time
    2. Put your new date column in your x-axis
    3. Sort it ascending
    4. Select your period series for the chart (eg This Year Visits and Last Year Visits). I like using a grouped bar or bar + line depending on what I'm trying to convey.
    5. Now give the card a good title and an even better description so that folks know exactly what they're looking at, how to interpret it, and how it was built.
    6. Practice with other period comparisons and with % changes!
    7. Come back and share what you've learned.
  • @jessicadamiani, did Kung-fu_Panda's reply help you out?

This discussion has been closed.