PoP Cards with Summary Number Showing the Total PoP Variance
I'm using the PoP cards to show monthly variances versus the same month in the prior year. I'd like to have the summary number show the total variance as a percent increase/decrease across the full time period selected in the card. For example, the default time period is YTD and is displayed monthly. I'd like the summary number to show the total YTD change versus the same period in the prior year. Basically, the summary number should show the variance percentage, if you graphed by year instead of month.
What would be ideal is if the summary number were dynamic so it always shows the total for whatever time period the user selects, even if it's across years.
Is that possible?
Thanks,
Nathan
Comments
-
I have actually created this card in our environment. It's showing this year by month over last year (same period) I have the variance % trending over each month and the total variance for the year is achieved by having the BeastMode for the variance % set to "Use All Values". As shown below
Here's a generalized version of my BeastMode formula. You should be able to tailor this to your needs:
CASE WHEN
(COUNT(CASE WHEN
`Date Field` IS NOT NULL and
`Date Field` < DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 11 month) AND
`Date Field` >= DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 23 month) AND
`Date Field` < DATE_SUB(CURDATE(), interval 1 year)
THEN `Field to Count`
END)) = 0
THEN 0
ELSE(COUNT(CASE WHEN
`Date Field` IS NOT NULL and
`Date Field` >= DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 11 month) AND
`Date Field` <= CURDATE()
THEN `Field to Count`
END)
/
COUNT(CASE WHEN
`Date Field` IS NOT NULL and
`Date Field` < DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 11 month) AND
`Date Field` >= DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 23 month) AND
`Date Field` <= DATE_SUB(CURDATE(), interval 1 year)
THEN `Field to Count`
END))
- 1
ENDThe purpose of the first case is to eliminate any errors from a divide by 0 for previous year count.
This is basically doing the (Current Year Count) / (Previous Year Count) - 1 which gives us variance or % change.
Let me know if you have any questions.
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the thumbs up if this post helped you.0 -
Thanks for the quick reply. Your suggestion conceptually works, but it doesn't seem to work for my use case. I'm using one of the new Period Over Period chart types and have the date set to Year to Date, by Month. I can see the variance for each month in the chart and could see the YTD YoY variance if I graph it by year. What I'm hoping to do is show it by month in the chart and then have the summary number show it at the aggregate level. I'm thinking it doesn't work since the card is set to Year to Date, so Domo doesn't view the prior year data as being part of the date range from the summary number perspective.
0 -
Ahh, I see. I'm actually doing PoP using a Line + Grouped Bar.
My X-Axis is month names using:
MONTHNAME(`Date Field`)
Y-Axis is the Variance BeastMode from earlier.
And 2 Series fields
Previous 12 Months:
COUNT(CASE WHEN `Date Field` IS NOT NULL and `Date Field` < DATE_SUB(CURDATE(), interval 12 month) AND `Date Field` >= DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 23 month) THEN `Field to Count` END)
Current 12 Months:
COUNT(CASE WHEN `Date Field` IS NOT NULL and `Date Field` >= DATE_SUB(DATE_FORMAT(CURDATE(), '%Y-%m-01'),interval 11 month) THEN `Field to Count` END)
This way it breaks it across months, you have two columns, one for this year and previous year and your variance line across the graph.
Maybe this will work for you as well?
0 -
I'm having the same issue - hoping there's a solution to this!
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive