If date falls within the current month
I am trying to calculate the # of visits (that a therapist does) per working day against a goal of how many visits per day we budgeted them to do in a month. I am running into an issue with the calculation for the current month.
For example, the goal for June was 22 visits a day and we had 733 visits in the month of June and 22 working days in the month. So I have 733 visits/ 22 working days to get me 33.12 visits per day and a variance of 11.32 vs our goal of 22.
But July is currently happening so it does not make sense to divide it by the total number of working days in the month, it needs to be the number of working days passed this month. I have another beast mode to calculate that and it is working to show me how many days we are in to the current month.
What I cant figure out is the proper beast mode for:
case when todays date is apart of the month of date, then divide it by business days into the month
else divide it by total working days in a month
or an alternative would be to get the calculation for the business days into the month to calculate it based on the date column vs todays date (so it would show 22/22 days into June and 15/22 days into July), but I also am unsure how to do that.
Any suggestions?
Best Answers
-
You can use the LAST_DAY function to determine if the current day is part of the same month:
CASE WHEN LAST_DAY(CURRENT_DATE()) = LAST_DAY(`Date`) THEN [Current month number of working days] ELSE [total month working days] END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hi @MThebeau
You may use the Domo Dimension.
Go to connectors and type dimension, It should look like the following screenshot'Happy to Help'1
Answers
-
You can use the LAST_DAY function to determine if the current day is part of the same month:
CASE WHEN LAST_DAY(CURRENT_DATE()) = LAST_DAY(`Date`) THEN [Current month number of working days] ELSE [total month working days] END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thank you!! @GrantSmith Do you know about a calendar that DOMO has built out that can be shared that has the working days for the year built out to include holidays since the SQL code for it does not?
0 -
Hi @MThebeau
You may use the Domo Dimension.
Go to connectors and type dimension, It should look like the following screenshot'Happy to Help'1
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