Find the difference in forecast and revenue in first quarter and distribute the difference amount
Find the difference in forecast and revenue in first quarter and distribute the difference amount to rest of the quarter's forecast
For eg: forecast for Q1,2,3,4 is 1M each and sales bring up revenue of 800k in first quarter then the difference 200k should be distributed to rest of the quarter's for cast so Q2,3,4 forcast will be 1.066 M each
Here is what i have built (logic):
(SUM(CASE when QUARTER(`revenueDateEST`)<=QUARTER(CURDATE()) AND YEAR(`revenueDateEST`)=YEAR(CURDATE()) THEN `DisplayBase Quota` ELSE 0 END)
 SUM(CASE when QUARTER(`revenueDateEST`)<=QUARTER(CURDATE()) AND YEAR(`revenueDateEST`)=YEAR(CURDATE()) THEN (CASE when `Product`='DisplayBase' then `Revenue`else 0 end) ELSE 0 END))
/ (CASE WHEN (4QUARTER(CURDATE()))>0 THEN (4QUARTER(CURDATE())) ELSE 1 END)
+sum((CASE when QUARTER(`revenueDateEST`)=QUARTER(CURDATE())and YEAR(`revenueDateEST`)=YEAR(CURDATE()) then `Quota`else 0 end))
But, this is not working as expected, could anyone help with the code for the above, thanks in advance.
Answers

Adithya a screenshot of how you set up your beast mode would help.
I suspect you have Q1,2,3,4 on the axis. If so then you canot use your beast mode because in Q2 i need to know the data that was in Q1,3 and 4 in order to answer the question.
therefore you must use a cumulative sum (which is a window function) to begin addressing the question.
sum(sum(amount)) over (order by date asc)
I suspect what you need to do is take the cumulative sum of the revenue. subtract the cumulative sum of the base quota, and then average that out over the remaining quarters.
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 
@jaeW_at_Onyx as i explained in the question already, forecast/quota for Q1,2,3,4 is 1M each and sales bring up revenue of 800k in first quarter then the difference 200k should be distributed to rest of the quarter's forecast/quota so Q2,3,4 forcast will be 1.066 M each
Please see the formula which i used in question so that you would know what are the field names used, please let me know if you need any more inputs. thanks for replying to my conversation.
0
Categories
 All Categories
 1.6K Product Ideas
 1.6K Ideas Exchange
 1.4K Connect
 1.1K Connectors
 286 Workbench
 4 Cloud Amplifier
 6 Federated
 2.7K Transform
 91 SQL DataFlows
 585 Datasets
 2.1K Magic ETL
 3.6K Visualize
 2.4K Charting
 642 Beast Mode
 34 App Studio
 33 Variables
 628 Automate
 159 Apps
 430 APIs & Domo Developer
 37 Workflows
 2 DomoAI
 31 Predict
 12 Jupyter Workspaces
 19 R & Python Tiles
 378 Distribute
 107 Domo Everywhere
 266 Scheduled Reports
 5 Software Integrations
 104 Manage
 101 Governance & Security
 6 Domo University
 15 Product Releases
 Community Forums
 40 Getting Started
 30 Community Member Introductions
 93 Community Announcements
 4.8K Archive