Getting value of previous quarter and comparison
Hello Team,
I have a date column named 'Fiscal quarter start date' and another Beast mode with calculated value for 'Customer Survey'
I want to create a beast mode in which I will compare the Customer survey of the Current Quarter with the second last quarter. I tried to create a Case statement but unable to get results card is not loading any results. Please help
Best Answers
-
@MayaU_01 - I think you should look at my response to another recent question.
I showed the way I like to do what I refer to as trends. Comparing year to previous year and the year before that. I use the same calculation formula to compare previous quarters across multiple years.Using this calculation, add another line that says:
and QUARTER('date') < = QUARTER(CURRENT_DATE())
And you will have a comparison of quarter to previous quarter. And quarters of the year to quarters of previous years.
What I don't show on that other thread is that I use a similar formula to then represent the difference or delta between them. Take the result of one quarter and subtract from the next and you get the difference. Take that difference over the previous total and you get the percentage of increase or decrease relative to the previous quarters.This then lets me setup a table view or a bar chart, line chart, etc….with comparisons next to each other. When I take the above formula for difference and put it over the previous total, I get the percentage of increase or decrease.
.25 or 25% means a growth over the previous period of 25%.
Then I set up a table chart that has columns for
PY QTD {whatevers} | CY QTD {whatevers} | CY QTD Difference | CY QTD % of Change | etc.
Here's the other thread…** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
Agree with @ArborRose, you'll need Beast Modes for each quarter and then compare between them. Just be aware that the
QUARTER
formula will work for the Gregorian Calendar, if you need to use a fiscal calendar that does not goes from January → December, then you'll need to adjust to account for that.0
Answers
-
Whenever I'm doing Period over Period analysis I will structure my data with my own custom date dimension dataset. You can then define how the offsets are and allows you to more easily filter your datasets so that you can look at this quarter but also have records for last quarter.
I've done a write up on this approach here:
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
You would want to use the Lag Windows Function in order to get the previous value.
- LAG(SUM(`surveyvalue`)) OVER (ORDER BY `fiscalquarterdate`)
It's also worth pointing out that the Flex Table card is a great card for showing a previous value next to a current value. It's highly configurable to show a combination of values, bar graphs, percent changes and directional indicators. Here is the KB article:
https://domo-support.domo.com/s/article/360043429073?language=en_US
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Hi,
I have used this method of LAG, but using this i am getting value of previous quarter in this quarter which is i think is the task of this function.
I may have explained the question wrong.I thought to use that value but it will not help.
My question is - I have columns, Client, Mydate column, Survey Value (A Beast mode).
I am making a table view - with client in first column then add last 4 quarters of Survey value in the next 4 columns and then make a last column in which I am writing a beast mode which is - If the current quarter survey value is greater than survey value of second last quarter then 'Good' If decreased then 'BAd' If same then 'Same' If there is value in last quarter but no value in this quarter then 'No response'
CASE WHEN
Survey
> LAG (Survey
, 2 ) OVER (ORDER BYFiscal Quarter Start Date
) THEN 'Increased'Survey
< LAG(Survey
,2) OVER (ORDER BYFiscal Quarter Start Date
) THEN 'Decreased'
Else 'Same'
ENDthis beast mode is not helping and I am unsure that what else can help me.
0 -
@MayaU_01 - I think you should look at my response to another recent question.
I showed the way I like to do what I refer to as trends. Comparing year to previous year and the year before that. I use the same calculation formula to compare previous quarters across multiple years.Using this calculation, add another line that says:
and QUARTER('date') < = QUARTER(CURRENT_DATE())
And you will have a comparison of quarter to previous quarter. And quarters of the year to quarters of previous years.
What I don't show on that other thread is that I use a similar formula to then represent the difference or delta between them. Take the result of one quarter and subtract from the next and you get the difference. Take that difference over the previous total and you get the percentage of increase or decrease relative to the previous quarters.This then lets me setup a table view or a bar chart, line chart, etc….with comparisons next to each other. When I take the above formula for difference and put it over the previous total, I get the percentage of increase or decrease.
.25 or 25% means a growth over the previous period of 25%.
Then I set up a table chart that has columns for
PY QTD {whatevers} | CY QTD {whatevers} | CY QTD Difference | CY QTD % of Change | etc.
Here's the other thread…** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
Agree with @ArborRose, you'll need Beast Modes for each quarter and then compare between them. Just be aware that the
QUARTER
formula will work for the Gregorian Calendar, if you need to use a fiscal calendar that does not goes from January → December, then you'll need to adjust to account for that.0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive