Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
6 replies
Answers
3 answers
Subscribers
7 subscribers
Views
6483 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi, I have a problem with the rule "weeknum()": evaluated o
Victor Bouchery
A Score Level 2
over 8 years ago
Hi,
I have a problem with the rule "weeknum()": evaluated on Monday 4th of January 2016 it returns the week number 2 when outlook (following to my knowledge the norm ISO-8601) indicates 1 for this week. Hence there is a shift for all of the following weeks of the future years (until the next 53rd week, or something like that...)
I understand this is due to considerating or not the 53rd week of year 2015.
Could you tell me if this is a lack from Appian? Is there another standard way to derive the ISO weeknumber?
Thanks in advance!
OriginalPostID-181981
OriginalPostID-181981
Discussion posts and replies are publicly visible
Parents
+1
Victor Bouchery
A Score Level 2
over 8 years ago
Here is the implementation of the rule.
weeknumCustom:
with(
local!weeknum: int(
(
dayofyear(
ri!date
) - userweekday(
ri!date,
2 /* monday to sunday */
) + 10
) / 7
),
if(
local!weeknum < 1,
rule!lastWeek(
year(
ri!date
) - 1
),
if(
local!weeknum > rule!lastWeek(
year(
ri!date
)
),
1,
local!weeknum
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Reply
+1
Victor Bouchery
A Score Level 2
over 8 years ago
Here is the implementation of the rule.
weeknumCustom:
with(
local!weeknum: int(
(
dayofyear(
ri!date
) - userweekday(
ri!date,
2 /* monday to sunday */
) + 10
) / 7
),
if(
local!weeknum < 1,
rule!lastWeek(
year(
ri!date
) - 1
),
if(
local!weeknum > rule!lastWeek(
year(
ri!date
)
),
1,
local!weeknum
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Children
No Data