Calculate Business Days w/ a Negative Integer
Comments
-
Hello Decisioneers,
For my situation, Ive a negative value integer trying to calculate a business prior to a set date. So for example, say the day Im looking for is August 9th and the assignment is due 3 business days before then. How can I go about this in a flow? Not sure if Decisions has any business day specific steps. Thank you in advance!
-
Hi jmcmann49,
I’ve attached an example sub-flow which takes into account any weekends and holidays you’ve specified for a location. Ive detailed how this flow functions below.
[color=rgb(0, 0, 0)]The inputs for this subflow are:[/color]
[color=rgb(0, 0, 0)]
[/color]
[color=rgb(0, 0, 0)]DaysInPast- [/color][color=rgb(0, 0, 0)]an integer of days going back[/color][color=rgb(0, 0, 0)]
[/color][color=rgb(0, 0, 0)]DateToCheck- [/color][color=rgb(0, 0, 0)]the starting date for this calculation[/color][color=rgb(0, 0, 0)]
[/color][color=rgb(0, 0, 0)]LocationName- [/color][color=rgb(0, 0, 0)]Indicates Location which indicates holidays (System > System Data > Locations)[/color][color=rgb(0, 0, 0)]Flow Overview:[/color]
[color=rgb(0, 0, 0)]First, there is a rule which makes sure the value is not below 0 or negative. Then we have a subtract step to account for the additional day that’s in the Get Business Days Between Dates For Location step. [/color][color=rgb(0, 0, 0)]The multiplication step is simply to transform our duration value into a negative (Duration*-1). The Find Guessed Start Date step takes the StartDate and subtracts the Duration giving us the date/reference point for the last steps.[/color]
[color=rgb(0, 0, 0)]Finally, Get Business Days step goes into a rule which continues to calculate busi[/color][color=rgb(0, 0, 0)]ness days between two dates until the business days are equal to the duration from the input. Once they are equal, you’ll have the output date and number of business days from the indicated start date.[/color]
[i]edited by Scott@decisions.com on 10/1/2019[/i]
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions