Projected monthly total based on current progress in current month
Is there a way to project the month-end value based on the current month's progress in a bar chart? So if there are 10 days of data totaling 1M widgets during September (9/1-10), it will project 3M widgets for the current month (1M will be solid and 2M will be striped to signify striped).
I see a whole bunch of options in the Last Value Projection tool… but none of them seem to provide a simple estimate. Below is an example, which is misleading…
Best Answers
-
You can utilize a window function to calculate the estimated month depending on the number of days that have elapsed in the current month.
LAST_DAY returns the number of days in the month
Running Total:
CASE WHEN `Date` < CURRENT_DATE() THEN
SUM(SUM(`Sales`)) OVER (PARTITION BY LAST_DAY(`Date`) ORDER BY `Date`)
ENDEnd of Month Estimate:
CASE WHEN `Date` < CURRENT_DATE() THEN
SUM(SUM(`Sales`)) OVER (PARTITION BY LAST_DAY(`Date`) ORDER BY `Date`)
/
DAYOFMONTH(`Date`)
*
DAYOFMONTH(LAST_DAY(`Date`))
END**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@NathanDorsch You can have more control over projections by adding a second Beast Mode series to your bar chart instead of using the Last Value Projection in Analyzer. In your case, the formula should look something like this:
sum(case when LAST_DAY(`Date`) = LAST_DAY(CURRENT_DATE()) then `Value` * (DAY(LAST_DAY(CURRENT_DATE())) - DAY(CURRENT_DATE())) / DAY(LAST_DAY(CURRENT_DATE())) else 0 end)
0
Answers
-
You can utilize a window function to calculate the estimated month depending on the number of days that have elapsed in the current month.
LAST_DAY returns the number of days in the month
Running Total:
CASE WHEN `Date` < CURRENT_DATE() THEN
SUM(SUM(`Sales`)) OVER (PARTITION BY LAST_DAY(`Date`) ORDER BY `Date`)
ENDEnd of Month Estimate:
CASE WHEN `Date` < CURRENT_DATE() THEN
SUM(SUM(`Sales`)) OVER (PARTITION BY LAST_DAY(`Date`) ORDER BY `Date`)
/
DAYOFMONTH(`Date`)
*
DAYOFMONTH(LAST_DAY(`Date`))
END**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@NathanDorsch You can have more control over projections by adding a second Beast Mode series to your bar chart instead of using the Last Value Projection in Analyzer. In your case, the formula should look something like this:
sum(case when LAST_DAY(`Date`) = LAST_DAY(CURRENT_DATE()) then `Value` * (DAY(LAST_DAY(CURRENT_DATE())) - DAY(CURRENT_DATE())) / DAY(LAST_DAY(CURRENT_DATE())) else 0 end)
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.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive