<?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: Financial Year calculations (FYTD) - Proc expand in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402418#M66843</link>
    <description>&lt;P&gt;Thanks Mkeintz, i tried it in the similar way. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2017 16:08:40 GMT</pubDate>
    <dc:creator>maximas</dc:creator>
    <dc:date>2017-10-09T16:08:40Z</dc:date>
    <item>
      <title>Financial Year calculations (FYTD) - Proc expand</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402374#M66840</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have monthly sales data for&amp;nbsp; 33 markets for 5 years, I want to calculate FYTD sales.&lt;/P&gt;&lt;P&gt;For us the Financial Year starts from month of April and ends in March.&lt;/P&gt;&lt;P&gt;e.g. FYTD for October 2017 will be sum of sales from April 17 to Oct 17.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have to create a variable named as FYTD and corresponding to each month it will have FYTD sales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i try it using proc expand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 14:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402374#M66840</guid>
      <dc:creator>maximas</dc:creator>
      <dc:date>2017-10-09T14:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Financial Year calculations (FYTD) - Proc expand</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402388#M66841</link>
      <description>&lt;P&gt;Can you show us some sample data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds like &lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_timeseries_sect017.htm" target="_self"&gt;PROC TIMESERIES&lt;/A&gt; might be a better choice.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 15:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402388#M66841</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-09T15:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Financial Year calculations (FYTD) - Proc expand</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402411#M66842</link>
      <description>&lt;P&gt;Here's an example using the monthly data series sashelp.stocks, which I sort because it is stored in reverse chronological order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.stocks  (keep=stock date volume) out=have;
  by stock date;
run;

data want;
  set have;
  by stock;
  Fytd_vol+volume;   format fytd_vol comma13.0;
  if intck('year.4',lag(date),date) then fytd_vol=volume;
  else if first.stock then fytd_vol=volume;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The FYTD_VOL + volume is a "sum" statement which increments fytd_vol without the normal reset to missing at the top of&amp;nbsp; the data step.&lt;/LI&gt;
&lt;LI&gt;The "year.4" time unit is&amp;nbsp; a way to determine years that begin in April, rather than Jan, which provides a way to detect start of fiscal year, by seeing if a March/April boundary is crossed between preceding date and current date.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 09 Oct 2017 15:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402411#M66842</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-09T15:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Financial Year calculations (FYTD) - Proc expand</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402418#M66843</link>
      <description>&lt;P&gt;Thanks Mkeintz, i tried it in the similar way. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 16:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Financial-Year-calculations-FYTD-Proc-expand/m-p/402418#M66843</guid>
      <dc:creator>maximas</dc:creator>
      <dc:date>2017-10-09T16:08:40Z</dc:date>
    </item>
  </channel>
</rss>

