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
 10.5K All Categories
 8 Connect
 918 Connectors
 250 Workbench
 470 Transform
 1.7K Magic ETL
 69 SQL DataFlows
 477 Datasets
 193 Visualize
 252 Beast Mode
 2.1K Charting
 11 Variables
 17 Automate
 354 APIs & Domo Developer
 89 Apps
 3 Workflows
 20 Predict
 5 Jupyter Workspaces
 15 R & Python Tiles
 247 Distribute
 63 Domo Everywhere
 243 Scheduled Reports
 21 Manage
 42 Governance & Security
 174 Product Ideas
 1.2K Ideas Exchange
 12 Community Forums
 27 Getting Started
 14 Community Member Introductions
 55 Community News
 4.5K Archive