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
4 replies
Subscribers
7 subscribers
Views
1952 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I am trying to use the caladddays() function, but I keep getting this error:
jamelj
over 10 years ago
I am trying to use the caladddays() function, but I keep getting this error:
"Expression evaluation error at function 'caladddays': Cannot add more than a year's worth of days."
Is there a way to be able to add more that a year's worth of work days to a date? For example, how can I perfrom the following function:
caladddays(today(),263)
...
OriginalPostID-102385
OriginalPostID-102385
Discussion posts and replies are publicly visible
Parents
0
Michael Tan
Appian Employee
over 10 years ago
Here is a rule you can use which uses the iterative approach mentioned earlier:
if(ri!daysToAdd<=262,caladddays(today(),ri!daysToAdd),reduce(fn!caladddays,merge({today()},{0}),{repeat(quotient(ri!daysToAdd,262),262),mod(ri!daysToAdd,262)}))
This uses the looping function reduce to call the caladddays function as many times as required. If you pass in 787, this is divisible by 262 three times. 262 is then repeated in our array three times. The last portion will be any additional days which yield a remainder. This is returned using the mod function, so the last value will be the remaining days or 0.
The first half of the if statement is for the simple scenario when you are passing in 262 or less days.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Michael Tan
Appian Employee
over 10 years ago
Here is a rule you can use which uses the iterative approach mentioned earlier:
if(ri!daysToAdd<=262,caladddays(today(),ri!daysToAdd),reduce(fn!caladddays,merge({today()},{0}),{repeat(quotient(ri!daysToAdd,262),262),mod(ri!daysToAdd,262)}))
This uses the looping function reduce to call the caladddays function as many times as required. If you pass in 787, this is divisible by 262 three times. 262 is then repeated in our array three times. The last portion will be any additional days which yield a remainder. This is returned using the mod function, so the last value will be the remaining days or 0.
The first half of the if statement is for the simple scenario when you are passing in 262 or less days.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data