<?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 Is there an alternative to iterating through rows using column formula? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/422520#M67159</link>
    <description>&lt;P&gt;I have a dataset which is a series of test runs, all collected in one table. The experiment is 6 sweeps from high to low speed for each sample, and what I need to do is assign the correct sweep number to each one (i.e. from 1 to 6) and then restart the sequence for the next sample. I could easily do this with the sequence or count function, however the number of points in each sweep is not always the same, it varies around 24-26. See image below for an example of one "sweep" from high to low speed before starting the next one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this could be done with a script, however my experience in that area is minimal. Is there a quick and dirty way of doing it using column formulas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="david_gillespie_0-1633009799849.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36190i4567ED730E5A4465/image-size/large?v=v2&amp;amp;px=999" role="button" title="david_gillespie_0-1633009799849.png" alt="david_gillespie_0-1633009799849.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:37:46 GMT</pubDate>
    <dc:creator>david_gillespie</dc:creator>
    <dc:date>2023-06-10T23:37:46Z</dc:date>
    <item>
      <title>Is there an alternative to iterating through rows using column formula?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/422520#M67159</link>
      <description>&lt;P&gt;I have a dataset which is a series of test runs, all collected in one table. The experiment is 6 sweeps from high to low speed for each sample, and what I need to do is assign the correct sweep number to each one (i.e. from 1 to 6) and then restart the sequence for the next sample. I could easily do this with the sequence or count function, however the number of points in each sweep is not always the same, it varies around 24-26. See image below for an example of one "sweep" from high to low speed before starting the next one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this could be done with a script, however my experience in that area is minimal. Is there a quick and dirty way of doing it using column formulas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="david_gillespie_0-1633009799849.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36190i4567ED730E5A4465/image-size/large?v=v2&amp;amp;px=999" role="button" title="david_gillespie_0-1633009799849.png" alt="david_gillespie_0-1633009799849.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:37:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/422520#M67159</guid>
      <dc:creator>david_gillespie</dc:creator>
      <dc:date>2023-06-10T23:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to iterating through rows using column formula?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/422526#M67160</link>
      <description>&lt;P&gt;Lag() could be helpful here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace :Column 1 with your speed column:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Row() == 1, curVal = 1);
If(:Column 1 &amp;gt; Lag(:Column 1),
	curVal += 1
);
curVal;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1633010918251.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36191i0CB0A6E30DB724E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1633010918251.png" alt="jthi_0-1633010918251.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 14:08:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/422526#M67160</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-30T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an alternative to iterating through rows using column formula?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/423575#M67263</link>
      <description>&lt;P&gt;Thanks for the help, that worked for each set of 6 runs of each sample. I added an extra line in to bring the counter back to 1 after each 6 sweeps so the below formula and code assigns the right sweep number with all the data stacked in one table!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1, curVal = 1 );
If( :speed &amp;gt; Lag( :speed ),
	curVal += 1
);
If( curVal &amp;gt; 6, CurVal = 1 );
curVal;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="david_gillespie_0-1633421007508.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/36301iD2AB33CE39FC7A07/image-size/medium?v=v2&amp;amp;px=400" role="button" title="david_gillespie_0-1633421007508.png" alt="david_gillespie_0-1633421007508.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 08:07:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-alternative-to-iterating-through-rows-using-column/m-p/423575#M67263</guid>
      <dc:creator>david_gillespie</dc:creator>
      <dc:date>2021-10-05T08:07:55Z</dc:date>
    </item>
  </channel>
</rss>

