show percent on period over period graph
I want to show the percentage of anonymous callers on a period over period bar graph but the %percent over time option in the bar label setting uses the total of the entire time periods (current quarter, prior quarter and prior year) in the denominator. I want the percentage of anonymous just for the quarter and one for the prior quarter and one of the prior year bar.
I am thinking i need to create beast mode field(s) to do this but can't seem to get it. This Relates to whether a hotline call was anonymous or not.
Here is what I have: SUM(`Anonymous` when 'yes')/ SUM(`Anonymous` when 'yes' AND 'no')
I have tried using count and count case when but keep getting syntax errors. I have attached a copy of my chart, but the percentages are wrong, as mentioned the denominator is the count of all three time periods. Thank you in advance for any assistance on how to accomplish this. Jill
Comments

Hi @user082291
It's not quite possible to use a period over period chart when you're wanting to plot two different period intervals (quarter and year).
I'm not a real fan of the period over period charts and prefer to do my own as I have more flexibility over the data than I do the chart.
What you can do is create a date dimension table which calculates the dates for this year, last year, last quarter etc. I utilized a MySQL dataflow to calculate these from the calendar dates Domo Dimension dataset.
select d.`dt` as "Report Date", date_sub(`dt`, interval '0' year) as "Comparison Date", 'Current' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '7' day) as "Comparison Date", 'Last Week' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '1' month) as "Comparison Date", 'Last Month' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '28' day) as "Comparison Date", '28 Days Ago' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '364' day) as "Comparison Date", 'Last Year (DOW Aligned)' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '1' year) as "Comparison Date", 'Last Year' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '2' year) as "Comparison Date", '2 Years Ago' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '728' day) as "Comparison Date", '2 Years Ago (DOW Aligned)' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '3' year) as "Comparison Date", '3 Years Ago' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '1,092' day) as "Comparison Date", '3 Years Ago (DOW Aligned)' as 'Period Type' from `calendar_dates` d UNION select d.`dt` as "Report Date", date_sub(`dt`, interval '1' quarter) as "Comparison Date", 'Last Quarter' as 'Period Type' from `calendar_dates` d
(feel free to take out scenarios you won't need to reduce the data size of the resulting dataset)
Using this dataset I'll then utilize a Fusion to join my data set date to this date dimension's Comparison Date (this is important).
Once I have that Fusion dataset created I can then use that within a card (bar chart in your case) and utilize some beast modes to calculate the numbers like:
Last Quarter:
CASE WHEN SUM(CASE WHEN `Period Type` = 'Last Quarter' THEN 1 ELSE 0 END) = 0 THEN 0 ELSE SUM(CASE WHEN `Period Type` = 'Last Quarter' AND `Anonymous`='Y' THEN 1 ELSE 0 END) / SUM(CASE WHEN `Period Type` = 'Last Quarter' THEN 1 ELSE 0 END) END
Last Year:
CASE WHEN SUM(CASE WHEN `Period Type` = 'Last Year' THEN 1 ELSE 0 END) = 0 THEN 0 ELSE SUM(CASE WHEN `Period Type` = 'Last Year' AND `Anonymous`='Y' THEN 1 ELSE 0 END) / SUM(CASE WHEN `Period Type` = 'Last Year' THEN 1 ELSE 0 END) END
This Year:
CASE WHEN SUM(CASE WHEN `Period Type` = 'Current' THEN 1 ELSE 0 END) = 0 THEN 0 ELSE SUM(CASE WHEN `Period Type` = 'Current' AND `Anonymous`='Y' THEN 1 ELSE 0 END) / SUM(CASE WHEN `Period Type` = 'Current' THEN 1 ELSE 0 END) END
You can then graph by Quarter to get the amounts for This Quarter, Last Quarter, Last Year's Quarter utilizing these beastmodes.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**5 
Hello @GrantSmith Thank you for your input, this is most helpful. I will give this a try.
0
Categories
 All Categories
 1.2K Product Ideas
 1.2K Ideas Exchange
 1.3K Connect
 1.1K Connectors
 273 Workbench
 2 Cloud Amplifier
 3 Federated
 2.7K Transform
 78 SQL DataFlows
 525 Datasets
 2.1K Magic ETL
 2.9K Visualize
 2.2K Charting
 434 Beast Mode
 22 Variables
 511 Automate
 114 Apps
 389 APIs & Domo Developer
 8 Workflows
 26 Predict
 10 Jupyter Workspaces
 16 R & Python Tiles
 332 Distribute
 77 Domo Everywhere
 255 Scheduled Reports
 66 Manage
 66 Governance & Security
 1 Product Release Questions
 Community Forums
 40 Getting Started
 26 Community Member Introductions
 68 Community Announcements
 4.8K Archive