<?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: Dividing Vertically (Rate of change) in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188798#M12974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;This lag function is everything that I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I wish I knew sql)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 17:55:26 GMT</pubDate>
    <dc:creator>Greek</dc:creator>
    <dc:date>2014-02-27T17:55:26Z</dc:date>
    <item>
      <title>Dividing Vertically (Rate of change)</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188794#M12970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following table and I would like to calculate the rate of change between individual years. The second table is my desired output. It can be done easily in excel, but it is a small step of a large sas code and I would rather not interrupt the process... Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="262"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="173"&gt;Year&lt;/TD&gt;&lt;TD class="xl63" width="89"&gt;Percentage&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;4.71%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;6.17%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;3&lt;/TD&gt;&lt;TD class="xl65"&gt;7.82%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;4&lt;/TD&gt;&lt;TD class="xl65"&gt;9.90%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;5&lt;/TD&gt;&lt;TD class="xl65"&gt;11.69%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="438"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="173"&gt;Year&lt;/TD&gt;&lt;TD class="xl65" width="89"&gt;Percentage&lt;/TD&gt;&lt;TD class="xl65" width="176"&gt;Change from Prev Year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl67"&gt;4.71%&lt;/TD&gt;&lt;TD class="xl67"&gt;N/A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl67"&gt;6.17%&lt;/TD&gt;&lt;TD class="xl67"&gt;31.00%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20"&gt;3&lt;/TD&gt;&lt;TD class="xl67"&gt;7.82%&lt;/TD&gt;&lt;TD class="xl67"&gt;26.74%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20"&gt;4&lt;/TD&gt;&lt;TD class="xl67"&gt;9.90%&lt;/TD&gt;&lt;TD class="xl67"&gt;26.60%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20"&gt;5&lt;/TD&gt;&lt;TD class="xl67"&gt;11.69%&lt;/TD&gt;&lt;TD class="xl67"&gt;18.08%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 13:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188794#M12970</guid>
      <dc:creator>Greek</dc:creator>
      <dc:date>2014-02-27T13:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing Vertically (Rate of change)</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188795#M12971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.Percentage,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.percentage / t2.percentage as ChangeFromPrevYear&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left outer join have t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.year-1=t2.year&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 14:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188795#M12971</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-02-27T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing Vertically (Rate of change)</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188796#M12972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a data step, with a lag function to reference the previous cell. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;pct_change=percentage/lag1(percentage)-1;&lt;/P&gt;&lt;P&gt;format pct_change percent8.2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 15:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188796#M12972</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-02-27T15:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing Vertically (Rate of change)</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188797#M12973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your approach might be easier for this case.&amp;nbsp; Most of the time I revert to sql as that's what I grew up with and it seems to be a bit more straightforward if you end up needing more complex criteria than just the previous record.&amp;nbsp; Also, the data must be sorted for the data step approach...not necessary for sql (although you probably would want it sorted just to help performance).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 15:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188797#M12973</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-02-27T15:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing Vertically (Rate of change)</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188798#M12974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;This lag function is everything that I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I wish I knew sql)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 17:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Dividing-Vertically-Rate-of-change/m-p/188798#M12974</guid>
      <dc:creator>Greek</dc:creator>
      <dc:date>2014-02-27T17:55:26Z</dc:date>
    </item>
  </channel>
</rss>

