Average based on Months Passed and Months left in year
Hello,
Looking to take a goal I have already calculated and be able to show how much is needed on average per month until the end of the year. Additionally, calculate the average based on months passed.
An example would be a goal of 500 topics posted during the year and currently there are 250 topics posted. I have an ETL that calculates how many I need, in this example 250 topics to be posted to reach the goal. From there how can I show that with 2 months left in the year I would need 125 topics posted per month ie. Topics needed/months left in year.
Secondly, how can I show the average amounts of topics posted in the prior 10 months ie. new topics this year/months passed.
Thank you
Comments
-
Are you wanting just a simple number or are you wanting to graph this over time?
If you're wanting a simple number:
Topics needed per month:
(MAX(`Goal`) - SUM(`Topics`)) / (12 - MONTH(CURDATE()) + 1) -- +1 to include the current month
Average amount of topics prior 10 months:
CASE WHEN MONTH(CURDATE()) <> 1 THEN -- protect against divide by 0 error for the start of the year SUM(`Topics`) / (MONTH(CURDATE()) - 1) -- Don't include the current month END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi @GrantSmith,
Thank you for the answer! I am looking to graph this over time instead of a just a simple number. Any further help with that would be appreciated!
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
- 57 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