<?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: How to fill sequential numbers (starting from 1) in a column when identical items appear in another column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678858#M86515</link>
    <description>&lt;P&gt;As long as the partIDs are grouped as you stated, this will work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Row() == 1, 1,
	Lag( :partID ) == :partID, Lag( :Runs ) + 1,
	1
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Sep 2023 16:03:40 GMT</pubDate>
    <dc:creator>mmarchandTSI</dc:creator>
    <dc:date>2023-09-18T16:03:40Z</dc:date>
    <item>
      <title>How to fill sequential numbers (starting from 1) in a column when identical items appear in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678832#M86514</link>
      <description>&lt;P&gt;Lets say I have a two column data. The first column partID, second column is a measured value for that part. Each part is measured N times so that partID column has rows with the ID appearing N times in the table until the next partID apepars. I want to create a new column with number of measurement repeats/Runs for a given part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, for identical partIDs appearing in the partID column, I want to fill the Runs column with sequential numbers starting from 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if part A is measured 11 times, the Runs column goes gets row entries from 1 to 11. Next part B is measured 9 times, the&amp;nbsp;Runs column goes has row entries 1 to 9 and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I automate this via JSL?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 15:45:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678832#M86514</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-09-18T15:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill sequential numbers (starting from 1) in a column when identical items appear in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678858#M86515</link>
      <description>&lt;P&gt;As long as the partIDs are grouped as you stated, this will work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Row() == 1, 1,
	Lag( :partID ) == :partID, Lag( :Runs ) + 1,
	1
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2023 16:03:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678858#M86515</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2023-09-18T16:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill sequential numbers (starting from 1) in a column when identical items appear in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678881#M86517</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt;&amp;nbsp;solution is a fine solution.&amp;nbsp; But as usual, in JMP there are multiple ways to get to the solution.&amp;nbsp; Here is an alternative solution&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Cumulative Sum( 1, :partID )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2023 16:32:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678881#M86517</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-09-18T16:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill sequential numbers (starting from 1) in a column when identical items appear in another column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678882#M86518</link>
      <description>&lt;P&gt;Col Cumulative Sum with value of 1 should work with current JMP versions&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(10),
	Compress File When Saved(1),
	New Column("Column 1",
		Character,
		"Nominal",
		Set Values({"A", "A", "A", "A", "B", "B", "C", "C", "C", "D"})
	)
);

dt &amp;lt;&amp;lt; New Column("Run", Numeric, Ordinal, Formula(
	Col Cumulative Sum(1, :Column 1)
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2023 16:32:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-fill-sequential-numbers-starting-from-1-in-a-column-when/m-p/678882#M86518</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-09-18T16:32:20Z</dc:date>
    </item>
  </channel>
</rss>

