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 (4-QUARTER(CURDATE()))>0 THEN (4-QUARTER(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.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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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