Data Interval Using Business Days In MagicETL
I am calculating deadlines by using a dynamic formula in MagicETL, which adds 4 days to a date like so:
CASE WHEN `issue` = 'bug' THEN ( CASE WHEN `priority` = 1 THEN ADDDATE(`CreationDate`, INTERVAL 4 DAY) END )
This works great, however I'm wondering how I could change the interval to simply be four business days instead of four calendar days.
I see in the documentation that there is a page for calculating business days between two dates - https://domohelp.domo.com/hc/en-us/articles/360043428153-Date-Difference-for-Business-Days but it doesn't cover adding business days to a date.
I also see within MagicETL, there is a date operations which allows us to use a "Add to date" operation but business days is not a unit of measurement. Any ideas on how I could update the case statement to be 4 business days rather than calendar? Thanks a lot!
Answers
-
@adamxor - Do you have a dataset that contains a list of days and whether they are a "business day"?
If you are only wanting to exclude weekends, then you could write a statement that changes the number of days to add based on the day of the week of
CreationDate
.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
There's also a Domo Dimensions dataset that has a calendar and contains the more popular holidays as well as a weekend flag. You could use that dataset as a base and add/remove holidays as needed.
I recently set up a solution that would do a mini cartesian join (JOIN between start & End Date) to expand out the days between create/end dates and aggregate back down so you can then subtract the correct number of days after your datediff calculation
1 -
I've written up a very simplistic example of adding business days which doesn't take into account holidays or when the business may be closed. @Gordon_Pont is a more correct solution to account for these holidays and weekends but wanted to share how you can roughly do it with a formula: https://dojo.domo.com/main/discussion/52678/domo-ideas-conference-beast-modes-add-business-days#latest
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**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