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
5 replies
Subscribers
7 subscribers
Views
2648 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi all, Is there any quick way to get date value when it is specified in re
henryd
over 9 years ago
Hi all,
Is there any quick way to get date value when it is specified in recurring format calendar? For example, the first Monday of December of each year.
Thanks.
OriginalPostID-171719
OriginalPostID-171719
Discussion posts and replies are publicly visible
0
Nick Vigilante
Appian Employee
over 9 years ago
To make sure I understand you correctly, are you looking for a way to calculate the first Monday of December based on a given year using SAIL?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
henryd
over 9 years ago
Hi Nick,
The requirement is right. But I am looking for any way of expression rule to accomplish this, not in SAIL.
Thanks,
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
I think there is no direct way, but you can start with the the first day in that month, then check which weekday that is and add a few days.
I did a quick test for this expression
=with(
local!start: date(year(ri!date), month(ri!date), 1),
local!wDay: weekday(local!start, 2),
local!start + day() * (8-local!wDay)
)
It might be not perfect but should help you getting started.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Nick Vigilante
Appian Employee
over 9 years ago
Please test this out:
if(
weekday(date(ri!year, 12, 1), 3)=0,
date(ri!year, 12, 1),
if(
weekday(date(ri!year, 12, 2), 3)=0,
date(ri!year, 12, 2),
if(
weekday(date(ri!year, 12, 3), 3)=0,
date(ri!year, 12, 3),
if(
weekday(date(ri!year, 12, 2), 4)=0,
date(ri!year, 12, 4),
if(
weekday(date(ri!year, 12, 5), 3)=0,
date(ri!year, 12, 5),
if(
weekday(date(ri!year, 12, 6), 3)=0,
date(ri!year, 12, 6),
date(ri!year, 12, 7)
)
)
)
)
)
)
You must create one rule input which is an integer that takes the year you specify.
Hope this helps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
henryd
over 9 years ago
Thank Stefan for your initial idea and Thank Nick for your for implementation.
Henry
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel