<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hi,  I have a problem with the rule &amp;quot;weeknum()&amp;quot;: evaluated o</title><link>https://community.appian.com/discussions/f/rules/6434/hi-i-have-a-problem-with-the-rule-weeknum-evaluated-o</link><description>Hi, I have a problem with the rule &amp;quot;weeknum()&amp;quot;: 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</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Hi,  I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/81481?ContentTypeID=1</link><pubDate>Mon, 10 May 2021 07:02:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:770bb3a0-d49f-4027-ac59-6e2e12317782</guid><dc:creator>sindhug0003</dc:creator><description>&lt;p&gt;Thanks, This logic helped us !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,  I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/45494?ContentTypeID=1</link><pubDate>Wed, 17 May 2017 13:26:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:08eb42e5-abc6-4df7-b940-01cd991e00c0</guid><dc:creator>Sandro Oberdorfer</dc:creator><description>Thanks, we just ran into that issue and this really helped!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;&lt;br /&gt;I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/25257?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 17:47:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65d90f46-9895-4185-9dc0-acd938a672cb</guid><dc:creator>Victor Bouchery</dc:creator><description>lastWeek:&lt;br /&gt;if(&lt;br /&gt;  contains(&lt;br /&gt;    /* 53rd week year */&lt;br /&gt;    {&lt;br /&gt;      2009,&lt;br /&gt;      2015,&lt;br /&gt;      2020,&lt;br /&gt;      2026,&lt;br /&gt;      2032&lt;br /&gt;    },&lt;br /&gt;    ri!year&lt;br /&gt;  ),&lt;br /&gt;  53,&lt;br /&gt;  52&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;&lt;br /&gt;I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/25256?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 17:46:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a56bd801-1fb0-44da-82bf-e45297b5f3f8</guid><dc:creator>Victor Bouchery</dc:creator><description>Here is the implementation of the rule. &lt;br /&gt;weeknumCustom: &lt;br /&gt;with(&lt;br /&gt;  local!weeknum: int(&lt;br /&gt;    (&lt;br /&gt;      dayofyear(&lt;br /&gt;        ri!date&lt;br /&gt;      ) - userweekday(&lt;br /&gt;        ri!date,&lt;br /&gt;        2 /* monday to sunday */&lt;br /&gt;      ) + 10&lt;br /&gt;    ) / 7&lt;br /&gt;  ),&lt;br /&gt;  if(&lt;br /&gt;    local!weeknum &amp;lt; 1,&lt;br /&gt;    rule!lastWeek(&lt;br /&gt;      year(&lt;br /&gt;        ri!date&lt;br /&gt;      ) - 1&lt;br /&gt;    ),&lt;br /&gt;    if(&lt;br /&gt;      local!weeknum &amp;gt; rule!lastWeek(&lt;br /&gt;        year(&lt;br /&gt;          ri!date&lt;br /&gt;        )&lt;br /&gt;      ),&lt;br /&gt;      1,&lt;br /&gt;      local!weeknum&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;&lt;br /&gt;I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/25180?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2015 21:33:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90600a99-7f36-4f24-aac1-56ba4486c454</guid><dc:creator>Victor Bouchery</dc:creator><description>Ok, I going to write a rule for that. &lt;br /&gt;Thanks for the link.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hi,&lt;br /&gt;&lt;br /&gt;I have a problem with the rule "weeknum()": evaluated o</title><link>https://community.appian.com/thread/25179?ContentTypeID=1</link><pubDate>Wed, 02 Dec 2015 20:42:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:05e6c8f0-10f9-4532-82bc-7960e163271f</guid><dc:creator>Lakshmi Meyyappan</dc:creator><description>This seems to be a limitation of Appian because it did not correctly take into account week 53 for 2015. You should be able to write the logic to calculate it yourself, you can find the formula online (&lt;a href="https://en.wikipedia.org/wiki/ISO_week_date#Calculation)"&gt;en.wikipedia.org/.../ISO_week_date&lt;/a&gt; and you can write an expression rule to perform this calculation with logic to check for a possible week 53.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>