<?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: new column with initial data values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40618#M23777</link>
    <description>&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make some tables, save and close them, but keep a list
n = 4;
fList = {};
for(t=1, t&amp;lt;=n, t++,
	fName = "Table "||Char(t)||".jmp";
	dt = NewTable(fName, NewColumn("Data", Formula(RandomInteger(10))));
	dt &amp;lt;&amp;lt; AddRows(20);
	InsertInto(fList, fName);
	Close(dt, Save("$DESKTOP/"||fName));
);

// Open the tables in the list and add the column
for(t=1, t&amp;lt;=NItems(fList), t++,
	fName = fList[t];
	dt = Open("$DESKTOP/"||fName);
	colVals = {};
	for(r=1, r&amp;lt;=NRow(dt), r++,
		InsertInto(colVals, fName);
	);
	dt &amp;lt;&amp;lt; NewColumn("File Name", Character, Values(colVals));
	DeleteFile("$DESKTOP/"||fName);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Jun 2017 09:30:06 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2017-06-19T09:30:06Z</dc:date>
    <item>
      <title>new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3884#M3884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to script the creation of a new column &lt;SPAN style="text-decoration: underline;"&gt;with initial data values&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my best guess, but it doesn't work. Cannot find any help on "initial data values" in the scripting guide. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Marianne&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dt=current data table();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dt&amp;lt;&amp;lt;new column("Selected", character, initial data values(constant("YES")));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 12:54:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3884#M3884</guid>
      <dc:creator>MTOF</dc:creator>
      <dc:date>2011-10-18T12:54:53Z</dc:date>
    </item>
    <item>
      <title>new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3885#M3885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're close.&amp;nbsp; This will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;dt&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;current data table&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;()&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;new column&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"Selected"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; character&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; set each value&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"YES"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 13:54:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3885#M3885</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2011-10-18T13:54:09Z</dc:date>
    </item>
    <item>
      <title>new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3886#M3886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Excellent, just what I needed &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon" src="https://community.jmp.com/4.5.5/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 20:47:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/3886#M3886</guid>
      <dc:creator>MTOF</dc:creator>
      <dc:date>2011-11-01T20:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40591#M23759</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar but a little more complicated problem:&lt;/P&gt;&lt;P&gt;The initial value I try to set is a function of loop index.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose I have 50 files to open. When open each file, I want to add a new column, and fill the new column with the file name of this file. The initial value is supposed to be a constant. But, when this function is used within a loop, the code seems stuck. It opens the first file, without filling the initial value, and stopped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I make it work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 21:56:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40591#M23759</guid>
      <dc:creator>JMP_Learner</dc:creator>
      <dc:date>2017-06-16T21:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40618#M23777</link>
      <description>&lt;P&gt;Maybe something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Make some tables, save and close them, but keep a list
n = 4;
fList = {};
for(t=1, t&amp;lt;=n, t++,
	fName = "Table "||Char(t)||".jmp";
	dt = NewTable(fName, NewColumn("Data", Formula(RandomInteger(10))));
	dt &amp;lt;&amp;lt; AddRows(20);
	InsertInto(fList, fName);
	Close(dt, Save("$DESKTOP/"||fName));
);

// Open the tables in the list and add the column
for(t=1, t&amp;lt;=NItems(fList), t++,
	fName = fList[t];
	dt = Open("$DESKTOP/"||fName);
	colVals = {};
	for(r=1, r&amp;lt;=NRow(dt), r++,
		InsertInto(colVals, fName);
	);
	dt &amp;lt;&amp;lt; NewColumn("File Name", Character, Values(colVals));
	DeleteFile("$DESKTOP/"||fName);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:30:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40618#M23777</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-06-19T09:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40709#M23793</link>
      <description>&lt;P&gt;Ian_jmp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your idea works great! Thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP_Learner&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 17:07:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/40709#M23793</guid>
      <dc:creator>JMP_Learner</dc:creator>
      <dc:date>2017-06-19T17:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: new column with initial data values</title>
      <link>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/781978#M96509</link>
      <description>&lt;A href="https://community.jmp.com/t5/Discussions/Initialize-data-very-useful-but-fragile/m-p/780753" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Initialize-data-very-useful-but-fragile/m-p/780753&lt;/A&gt;</description>
      <pubDate>Thu, 15 Aug 2024 18:09:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/new-column-with-initial-data-values/m-p/781978#M96509</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-08-15T18:09:07Z</dc:date>
    </item>
  </channel>
</rss>

