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.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive