<?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 How to compare each row to the one before in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13995#M13134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear JMP users/developers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set and I would like to compare the increase/decrease in percentages for each column by year&lt;/P&gt;&lt;P&gt;Let's say I would like to know the percentage of RoomNight change compared to the year before.&lt;/P&gt;&lt;P&gt;Could any one please tell me the formula for it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9649_2015-08-25_12-33-42.png" style="width: 484px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2106i7091211260D41D27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9649_2015-08-25_12-33-42.png" alt="9649_2015-08-25_12-33-42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2016 00:28:27 GMT</pubDate>
    <dc:creator>saitcopuroglu</dc:creator>
    <dc:date>2016-10-19T00:28:27Z</dc:date>
    <item>
      <title>How to compare each row to the one before</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13995#M13134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear JMP users/developers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set and I would like to compare the increase/decrease in percentages for each column by year&lt;/P&gt;&lt;P&gt;Let's say I would like to know the percentage of RoomNight change compared to the year before.&lt;/P&gt;&lt;P&gt;Could any one please tell me the formula for it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9649_2015-08-25_12-33-42.png" style="width: 484px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2106i7091211260D41D27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9649_2015-08-25_12-33-42.png" alt="9649_2015-08-25_12-33-42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:28:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13995#M13134</guid>
      <dc:creator>saitcopuroglu</dc:creator>
      <dc:date>2016-10-19T00:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each row to the one before</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13996#M13135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the Lag() function. For example:&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #032ce4;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #032ce4;"&gt;New Column&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Annual Change"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Numeric&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Format&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Percent"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Row&lt;/SPAN&gt;&lt;STRONG&gt;()&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;!=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;STRONG&gt;((&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;/&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 10:18:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13996#M13135</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-08-25T10:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each row to the one before</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13997#M13136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 10:26:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13997#M13136</guid>
      <dc:creator>saitcopuroglu</dc:creator>
      <dc:date>2015-08-25T10:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each row to the one before</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13998#M13137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you again and what is the logic of Lag() when comparing all years to the first year or second (or any selected year)?&lt;/P&gt;&lt;P&gt;Lets say I would like to compare the Room Night inc/dec to the 2007 or 2013?&lt;/P&gt;&lt;P&gt;Many many thanks for your support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 10:40:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13998#M13137</guid>
      <dc:creator>saitcopuroglu</dc:creator>
      <dc:date>2015-08-26T10:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each row to the one before</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13999#M13138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lag() always refer to a row relative to the current row. To compare with a fixed reference year it may be easier to use an index. Lag() can also be used but would require that the data is regular with no missing years. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #008f00;"&gt;// Using a fixed index, assuming 2007 in first row&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #032ce4;"&gt;New Column&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Change since 2007"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Numeric&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Format&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Percent"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Formula&lt;STRONG&gt;((&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;])&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;/&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #008f00;"&gt;// The same using lag (assuming there are no missing years)&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #032ce4;"&gt;New Column&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"&lt;SPAN style="color: #942193; font-family: Courier;"&gt;Change since 2007&lt;/SPAN&gt;_2"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Numeric&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #032ce4;"&gt;Format&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Percent"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Formula&lt;STRONG&gt;((&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Year&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Row&lt;/SPAN&gt;&lt;STRONG&gt;()]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2007&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;/&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Room Night&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Year&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Row&lt;/SPAN&gt;&lt;STRONG&gt;()]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2007&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 12:16:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-compare-each-row-to-the-one-before/m-p/13999#M13138</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-08-26T12:16:50Z</dc:date>
    </item>
  </channel>
</rss>

