<?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: Creating a New Column with Initial Sequence Data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278415#M54070</link>
    <description>&lt;P&gt;Hi Jim,&lt;BR /&gt;&lt;BR /&gt;I will try this. Thank you for your assistance. I will read through the Scripting Guide as I generate the script.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 23:28:37 GMT</pubDate>
    <dc:creator>toddsmith77</dc:creator>
    <dc:date>2020-07-13T23:28:37Z</dc:date>
    <item>
      <title>Creating a New Column with Initial Sequence Data</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278229#M54049</link>
      <description>&lt;P&gt;I frequently concatenate multiple data tables into a single table and then add two new columns with initialized data. New Column 1 is called "Device" and is a constant that I enter. New Column 2 is called "Index" and is sequential data from 1 to x, where x is the last row in the data table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to script the creation of these two new columns in the concatenated table, ideally with a Pop Up window to ask for the Device number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me generate the script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:16:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278229#M54049</guid>
      <dc:creator>toddsmith77</dc:creator>
      <dc:date>2023-06-10T23:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Column with Initial Sequence Data</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278232#M54050</link>
      <description>&lt;P&gt;OK, this will get you started.&amp;nbsp; Your side of the bargain is that you need to read the Scripting Guide, so you can learn about all of the items in the script, and also learn about what kinds of things you can do to make the script exactly what you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nw = New Window( "Device Input",
	&amp;lt;&amp;lt;modal,
	Border Box( top( 10 ), bottom( 10 ), Left( 10 ), Right( 10 ),
		sides( 15 ),
		Lineup Box( N Col( 1 ),
			Spacer Box( size( 0, 10 ) ),
			Text Box( "Enter Device Name" ),
			dev = Text Edit Box( " ",
				&amp;lt;&amp;lt;set script( devText = dev &amp;lt;&amp;lt; get text )
			)
		)
	)
);

If( nw["button"] == 1,
	dt &amp;lt;&amp;lt; New Column( "Device",
		character,set each value( devText )
	);
	dt &amp;lt;&amp;lt; New Column( "index", set each value( Row() ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Jul 2020 20:30:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278232#M54050</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-12T20:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Column with Initial Sequence Data</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278346#M54059</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;on reading the &lt;A href="https://www.jmp.com/support/help/en/15.1/jmp/introduction.shtml#ww228936" target="_self"&gt;Scripting Guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd also encourage you to get familiar with the &lt;A href="https://www.jmp.com/support/help/en/15.1/#page/jmp/formula-editor.shtml#" target="_self"&gt;Formula Editor&lt;/A&gt;. In particular, the &lt;A href="https://www.jmp.com/support/help/en/15.1/#page/jmp/row-functions.shtml" target="_self"&gt;Sequence() and Count() functions&lt;/A&gt; could help you here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 15:27:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278346#M54059</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-07-13T15:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Column with Initial Sequence Data</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278415#M54070</link>
      <description>&lt;P&gt;Hi Jim,&lt;BR /&gt;&lt;BR /&gt;I will try this. Thank you for your assistance. I will read through the Scripting Guide as I generate the script.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 23:28:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278415#M54070</guid>
      <dc:creator>toddsmith77</dc:creator>
      <dc:date>2020-07-13T23:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Column with Initial Sequence Data</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278499#M54079</link>
      <description>&lt;P&gt;the script above is exactly what you need. So nothing to add for this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you can learn&amp;nbsp; a lot from JMP directly.&lt;/P&gt;
&lt;P&gt;1. In your data table, you can&amp;nbsp; e.g. right click on the last column and choose "New Formula Column"-&amp;gt;"Row"-&amp;gt;"Row".&lt;/P&gt;
&lt;P&gt;--&amp;gt; You will get a new column with a sequence in it from 1 to the end of the data table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Now click on the red triangle in the top left panel of the data table (the scripts part of th edata table). Select Copy Table Script (without data)&lt;/P&gt;
&lt;P&gt;3. Open a script window and paste the code in it. At the bottom of the script you will find the script to create this new column with the formula using the Row() statement. This is what txnelson basically has used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Scripting index and scripting guide are your friends for JSL tasks. and deepen the understanding. But keep in mind you can come far with the automatic creation of code from JMP.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, you should with any scripting/programming language always make yourself familiar to good programming practice :)&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 14:25:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-New-Column-with-Initial-Sequence-Data/m-p/278499#M54079</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2020-07-14T14:25:32Z</dc:date>
    </item>
  </channel>
</rss>

