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://domosupport.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.5K Product Ideas
 1.5K Ideas Exchange
 1.4K Connect
 1.1K Connectors
 284 Workbench
 4 Cloud Amplifier
 4 Federated
 2.7K Transform
 90 SQL DataFlows
 570 Datasets
 2K Magic ETL
 3.4K Visualize
 2.4K Charting
 605 Beast Mode
 18 App Studio
 29 Variables
 602 Automate
 152 Apps
 419 APIs & Domo Developer
 29 Workflows
 2 DomoAI
 28 Predict
 12 Jupyter Workspaces
 16 R & Python Tiles
 366 Distribute
 100 Domo Everywhere
 264 Scheduled Reports
 2 Software Integrations
 98 Manage
 95 Governance & Security
 15 Product Releases
 Community Forums
 37 Getting Started
 28 Community Member Introductions
 90 Community Announcements
 4.8K Archive