Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
8 subscribers
Views
3908 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi, I need to calculate a SLA end date based on a SLA start date, the numbe
moritzw
over 10 years ago
Hi,
I need to calculate a SLA end date based on a SLA start date, the number of days the SLA lasts and N x intervals in which the SLA was interrupted. I came up with something like this so far:
=if(isnull(ri!slaStartTime_dt),null,workday(ri!slaStartTime_dt,ri!slaInDays_int,{date(2014,12,25),date(2014,12,26)})) + {interval1,interval2}
However I don't know how to get the sum of multiple intervals at the end. How could I do this?
TIA, Moritz
...
OriginalPostID-126149
OriginalPostID-126149
Discussion posts and replies are publicly visible
0
moritzw
over 10 years ago
got this working using the reduce() looping function.
However, I also need to make sure that only working days are included in the calculation.
So if I interrupt the SLA from Friday to Monday, the SLA End Date would be two additional working days in the future. Not quite sure how to achieve this at the moment.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Steven Miccile
Appian Employee
over 10 years ago
Look into the caladddays function:
forum.appian.com/.../Date_and_Time_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 10 years ago
found a solution. Thanks!
=if(isnull(ri!slaStartTime_dt),null,workday(ri!slaStartTime_dt,ri!slaInDays_int + rule!GetNetworkDaysForSlaInterrupts(ri!slaInterruptStartTimes_dt,ri!slaInterruptEndTimes_dt),{date(2014,12,25),date(2014,12,26)}))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 10 years ago
GetNetworkDaysForSlaInterrupts:
=reduce(fn!sum,0,apply(fn!networkdays,merge(ri!slaInterruptStartDate_dt,ri!slaInterruptEndDate_dt)))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 10 years ago
I think you could make it a bit easier. The apply function returns already a list of numbers which can simply be summed.
GetNetworkDaysForSlaInterrupts:
=fn!sum(apply(fn!networkdays,merge(ri!slaInterruptStartDate_dt,ri!slaInterruptEndDate_dt)))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
moritzw
over 10 years ago
true! good thing the weekend starts soon ;-)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel