Adding business days to a date via MagicETL
Hi, I'm currently calculating a deadline using a dynamic formula in MagicETL. It looks like this:
CASE WHEN `issue` = 'bug' THEN ( CASE WHEN `priority` = 1 THEN ADDDATE(`CreationDate`, INTERVAL 4 DAY) END )
The calculation works great, but I was wondering what would be the best way to update it to 4 business days, rather than calendar days (as interval uses)? I was reading the documentation here https://domohelp.domo.com/hc/en-us/articles/360043428153-Date-Difference-for-Business-Days but it only covers calculating business days between two dates, rather than adding business days to a date.
I also looked at the available date operations available in MagicETL and see that there is a "Add To Date" option but unfortunately "Business Days" is not a unit of measurements - which would be really useful.
Any ideas on how the above case statement could be modified to use business days instead? Thanks!
Answers
-
Hi @adamxor
I just gave a presentation at Domopalooza on beast modes and I discussed this scenario. There's even a write-up here on the Dojo that I did as well: https://dojo.domo.com/discussion/54551/dp22-using-beast-mode-to-build-data-storytelling-adding-business-days
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
You can find my talk on this and other beast modes on demand here: https://domopalooza2022.brandlive.com/home/en/session/4e03890e-9651-11ec-b383-5b1ed051e2ca
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Hey @Grant perfect timing! I applied your formula into my calculation, substituting 4 instead of
Estimated Deliver Days
andCreationDate
instead ofShip Time
. I also usedDATE(CreationDate)
since my raw data is a timestamp.This seems to work great i.e. for an input of DATE(2022-02-17T14:03:48Z) I get an output of 2022-02-23T00:00:00Z. Given that 17th February is a Thursday, the output should land Wednesday the 23rd, and it does. Another input is DATE(2021-11-08T16:44:43Z), which is a Monday so the output should be Friday the 12th, and it is - 2021-11-12T00:00:00Z. Thanks a lot!
0
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
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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