% Change calculation for Year Over Year QTD doesn't seems to be working
I am trying create a table with multiple segments as row and Current Year QTD Revenue, Prev Year QTD Revenue and % Change in Revenue.
I was able to follow the documentation (https://knowledge.domo.com/Visualize/Adding_Cards_to_Domo/KPI_Cards/Transforming_Data_Using_Beast_Mode/Sample_Beast_Mode_Calculations%3A_Period-over-Period_Transforms)
and Implement beast modes for Current Year QTD Revenue, Prev Year QTD Revenue.
But when I implement
Ratio: % change between the two using the formula (C/P) - 1 | (Case when (quarter(`Datefield`) = quarter(curdate()) and year(`Datefield`) = year(curdate()) and dayofyear(`Datefield`) <= dayofyear(curdate())) then `Amountfield` end / Case when (quarter(`Datefield`) = quarter(curdate()) and year(`Datefield`) = year(curdate())-1 and dayofyear(`Datefield`) <= dayofyear(curdate())) then`Amountfield` end) -1 |
It doesn't seems to work and am getting blank as % change. Any help would be appreciated.
Note: My data has multiple columns for segmentation and I want to use these 3 beast modes for different segments.
Comments
-
Hi @user19019
There's several examples of doing period over period charts on the dojo. I'd recommend you configure an offset dimensions table to join your data together. @jaeW_at_Onyx has done a great video outlining this process here: https://www.youtube.com/watch?v=CDKNOmKClms
I've given a more textual write up on this here: https://dojo.domo.com/t5/Card-Building/show-percent-on-period-over-period-graph/m-p/50540/highlight/true#M7313
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
I referred the manual writeup .
You are doing Last Quarter Calculation
select d.`dt` as "Report Date", date_sub(`dt`, interval '1' quarter) as "Comparison Date", 'Last Quarter' as 'Period Type'
from `calendar_dates` dHow would you do Current Quarter to date and Previous Year Quarter to Date?
0 -
i hope you solved your problem!
... If you followed the tutorial video Grant posted, (thanks @GrantSmith ) the solution should just be a matter of wrangling MySQL code ... this is a VERY google-able issue. But basically you just need to append a Current QTD and a previous QTD Period Type to the OFFSET_DATE table and then build some beast modes
sum( case when Period type = ...) - sum( case when period type = ... )
If you're looking for people to write code for you, the Dojo does have a Job Board where freelance consultants, https://dojo.domo.com/t5/Job-Board/Freelance-Domo-consultant-available-for-hourly-and-long-term/m-p/48595#M44, are available to do projects for you on an hourly rate!
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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