<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Next Sunday Formula in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728302#M226609</link>
    <description>&lt;P&gt;I have formula for next Sunday and previous Monday of the week.&lt;/P&gt;
&lt;P&gt;SUNDAY:&amp;nbsp; &amp;nbsp;intnx('week.1',datepart(ACTVN_DAT),1)&lt;/P&gt;
&lt;P&gt;Monday:&amp;nbsp; &amp;nbsp;intnx('WEEK.2',datepart(ACTVN_DAT),0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I realized that it is giving me next Sunday if my ACTVN_DAT falls on Sunday itself (which tells formula is good). Example is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasuser_sk_0-1616446494183.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56280i85E1E84E397D9499/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasuser_sk_0-1616446494183.png" alt="sasuser_sk_0-1616446494183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I amend my formula to keep my Next_Sunday as it is if it falls on Sunday. This is what I want in my data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasuser_sk_1-1616446862038.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56281i5DCE276101D11F3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasuser_sk_1-1616446862038.png" alt="sasuser_sk_1-1616446862038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;March 21st &amp;amp; Jan 3rd was Sunday. So I want Next_Sunday as 03/21/2021 &amp;amp; 01/03/2021 respectively. However. Jan 21st is Thursday so my formula works right for this date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Mar 2021 21:03:55 GMT</pubDate>
    <dc:creator>sasuser_sk</dc:creator>
    <dc:date>2021-03-22T21:03:55Z</dc:date>
    <item>
      <title>Next Sunday Formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728302#M226609</link>
      <description>&lt;P&gt;I have formula for next Sunday and previous Monday of the week.&lt;/P&gt;
&lt;P&gt;SUNDAY:&amp;nbsp; &amp;nbsp;intnx('week.1',datepart(ACTVN_DAT),1)&lt;/P&gt;
&lt;P&gt;Monday:&amp;nbsp; &amp;nbsp;intnx('WEEK.2',datepart(ACTVN_DAT),0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I realized that it is giving me next Sunday if my ACTVN_DAT falls on Sunday itself (which tells formula is good). Example is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasuser_sk_0-1616446494183.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56280i85E1E84E397D9499/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasuser_sk_0-1616446494183.png" alt="sasuser_sk_0-1616446494183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I amend my formula to keep my Next_Sunday as it is if it falls on Sunday. This is what I want in my data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sasuser_sk_1-1616446862038.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56281i5DCE276101D11F3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sasuser_sk_1-1616446862038.png" alt="sasuser_sk_1-1616446862038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;March 21st &amp;amp; Jan 3rd was Sunday. So I want Next_Sunday as 03/21/2021 &amp;amp; 01/03/2021 respectively. However. Jan 21st is Thursday so my formula works right for this date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 21:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728302#M226609</guid>
      <dc:creator>sasuser_sk</dc:creator>
      <dc:date>2021-03-22T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Next Sunday Formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728307#M226612</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311117"&gt;@sasuser_sk&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just subtract one day before applying INTNX:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;Next_Sunday=intnx('week',datepart(ACTVN_DAT)&lt;FONT color="#00FF00"&gt;&lt;STRONG&gt;-1&lt;/STRONG&gt;&lt;/FONT&gt;,1);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;(The "&lt;FONT face="courier new,courier"&gt;.1&lt;/FONT&gt;" after "&lt;FONT face="courier new,courier"&gt;week&lt;/FONT&gt;" is redundant.)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 21:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728307#M226612</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-22T21:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Next Sunday Formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728311#M226614</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;. This worked just fine.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 21:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Next-Sunday-Formula/m-p/728311#M226614</guid>
      <dc:creator>sasuser_sk</dc:creator>
      <dc:date>2021-03-22T21:40:50Z</dc:date>
    </item>
  </channel>
</rss>

