<?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 Re: Help on getting year-to-date function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101381#M28464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again with consideration of fiscal and calendar year something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week(yourdatevariable) = (week(today()) - 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be close to what you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jun 2013 20:51:45 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-06-10T20:51:45Z</dc:date>
    <item>
      <title>Help on getting year-to-date function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101379#M28462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the below table i want to write an sql to get year-to-last week data dynamically so whenever i run the below query it should give me the data starting from financial week 1 to last week. In the below eg if i run today(10th June 13) it should give me data starting from week 1 to week 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using the following query to connect to fact table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;rsubmit&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;create&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;table&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; RDW1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;select&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a1.WK_IDNT, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(a1.F_SLS_AMT)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;as&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; SALES&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;from&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; RDW.SLS_SBC_LW_DM a1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RDW.TIME_WK_DM&amp;nbsp;&amp;nbsp;&amp;nbsp; a2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;where&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; a1.WK_IDNT=a2.WK_IDNT &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ??????????????????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; group &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;by &lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;a1.WK_IDNT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;endrsubmit&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="year to last week.JPG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3668_year to last week.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 15:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101379#M28462</guid>
      <dc:creator>dwhsrinath</dc:creator>
      <dc:date>2013-06-10T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help on getting year-to-date function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101380#M28463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your financial year is the same as fiscal year, you could dig into the intnx function, which helps you calculate date intervals dynamically. Idf the standard intervals doesn't fit, it even lets you use an imported calendar...&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p0syn64amroombn14vrdzksh459w.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p10v3sa3i4kfxfn1sovhi5xzxh8n.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 15:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101380#M28463</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-06-10T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help on getting year-to-date function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101381#M28464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again with consideration of fiscal and calendar year something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week(yourdatevariable) = (week(today()) - 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be close to what you're looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 20:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-on-getting-year-to-date-function/m-p/101381#M28464</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-06-10T20:51:45Z</dc:date>
    </item>
  </channel>
</rss>

