<?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: summing monthly rows to arrive at fiancial year total in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/413123#M26566</link>
    <description>&lt;P&gt;Thank you, very helpful.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 00:09:35 GMT</pubDate>
    <dc:creator>Phil_from_PGA</dc:creator>
    <dc:date>2017-11-14T00:09:35Z</dc:date>
    <item>
      <title>summing monthly rows to arrive at fiancial year total</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/411036#M26388</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;Hi, I have data such as below and need to sum the sales by month to get a financial year total for 2013-14 and separately for 2014-15 where financial year for 2013-14 is July 2013 to June 2014 and for 2014-15 it is July 2014 to June 2015. That is, 2013-14 should sum to 342 and 2014-15 to 269. I also don't know how to turn the variable called monthly to a SAS month format in creating the example dataset below.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; monthly sales;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JUL2013 9&lt;/P&gt;&lt;P&gt;AUG2013 12&lt;/P&gt;&lt;P&gt;SEP2013 23&lt;/P&gt;&lt;P&gt;OCT2013 0&lt;/P&gt;&lt;P&gt;NOV2013 1&lt;/P&gt;&lt;P&gt;DEC2013 22&lt;/P&gt;&lt;P&gt;JAN2014 45&lt;/P&gt;&lt;P&gt;FEB2014 5&lt;/P&gt;&lt;P&gt;MAR2014 77&lt;/P&gt;&lt;P&gt;APR2014 6&lt;/P&gt;&lt;P&gt;MAY2014 97&lt;/P&gt;&lt;P&gt;JUN2014 45&lt;/P&gt;&lt;P&gt;JUL2014 9&lt;/P&gt;&lt;P&gt;AUG2014 23&lt;/P&gt;&lt;P&gt;SEP2014 23&lt;/P&gt;&lt;P&gt;OCT2014 0&lt;/P&gt;&lt;P&gt;NOV2014 1&lt;/P&gt;&lt;P&gt;DEC2014 2&lt;/P&gt;&lt;P&gt;JAN2015 56&lt;/P&gt;&lt;P&gt;FEB2015 5&lt;/P&gt;&lt;P&gt;MAR2015 70&lt;/P&gt;&lt;P&gt;APR2015 68&lt;/P&gt;&lt;P&gt;MAY2015 7&lt;/P&gt;&lt;P&gt;JUN2015 5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 03:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/411036#M26388</guid>
      <dc:creator>Phil_from_PGA</dc:creator>
      <dc:date>2017-11-07T03:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: summing monthly rows to arrive at fiancial year total</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/411053#M26389</link>
      <description>&lt;P&gt;Using proper SAS dates usually makes things simpler (once you understand how it all works)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input monthStr $ sales;
month = input(cats("01",monthStr),date9.);
format month monyy7.;
fy = year(intnx("year.7", month,0)); 
drop monthStr;
datalines;
JUL2013 9
AUG2013 12
SEP2013 23
OCT2013 0
NOV2013 1
DEC2013 22
JAN2014 45
FEB2014 5
MAR2014 77
APR2014 6
MAY2014 97
JUN2014 45
JUL2014 9
AUG2014 23
SEP2014 23
OCT2014 0
NOV2014 1
DEC2014 2
JAN2015 56
FEB2015 5
MAR2015 70
APR2015 68
MAY2015 7
JUN2015 5
;

proc sql;
create table fySales as
select fy, sum(sales) as fySales
from have
group by fy;

select * from fySales;

quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Nov 2017 04:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/411053#M26389</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-11-07T04:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: summing monthly rows to arrive at fiancial year total</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/413123#M26566</link>
      <description>&lt;P&gt;Thank you, very helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 00:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/summing-monthly-rows-to-arrive-at-fiancial-year-total/m-p/413123#M26566</guid>
      <dc:creator>Phil_from_PGA</dc:creator>
      <dc:date>2017-11-14T00:09:35Z</dc:date>
    </item>
  </channel>
</rss>

