<?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: Trying to write script that will append results of regression analysis to an existing excel spreadsheet in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750199#M93082</link>
    <description>&lt;P&gt;This is what opens after the run.&amp;nbsp; (Curiously, it shows a relict file name (v2n=25....) that my jsl code does NOT use - I've checked and rechecked).&amp;nbsp; In any case, the following code - shown below - is not producing concatenated rows.&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="learning_JSL_0-1714140099453.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63744iECB0FDAD1AACEFEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_0-1714140099453.png" alt="learning_JSL_0-1714140099453.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\testtest2 n=258.xls");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;///ADD APPEND SCRIPT&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Concatenate("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls") ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//SAVE MASTERFILE CONTAINING ROWS (APPENDED) OF ALL RUNS&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dt&amp;lt;&amp;lt; save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be most appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Apr 2024 14:03:01 GMT</pubDate>
    <dc:creator>learning_JSL</dc:creator>
    <dc:date>2024-04-26T14:03:01Z</dc:date>
    <item>
      <title>Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750097#M93071</link>
      <description>&lt;P&gt;Hi - I am trying to write a jsl script that will append the results of a regression analysis to an existing excel file.&amp;nbsp; My current script writes to an excel file but I want to be able to run the script multiple times and append each new result to the existing excel sheet.&amp;nbsp; (Currently I am appending the new result manually, by hand.)&amp;nbsp; &amp;nbsp;See attached script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ps&amp;nbsp; I am using JMP Pro 17&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 12:36:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750097#M93071</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2024-04-26T12:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750119#M93073</link>
      <description>&lt;P&gt;It looks like what you need to do, is that after you have created the new columns in your data table, you need to read in the excel table you want to add the data to, use&amp;nbsp; &amp;nbsp;Tables=&amp;gt;Concatenate&amp;nbsp; to add the new table to the table you want to add the data to, and then save that newly concatenated.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 12:56:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750119#M93073</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-26T12:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750159#M93077</link>
      <description>&lt;P&gt;Thanks Jim.&amp;nbsp; If the script that runs the analysis and adds tables produces a file named X, does X first have to be saved prior to concatenation?&amp;nbsp; &amp;nbsp;And if so, is the table name within my Concatenate function the file that receives the results of all the runs (i.e. Concatenate (masterfile)?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if the above is correct, I would say:&lt;/P&gt;&lt;P&gt;save X&lt;/P&gt;&lt;P&gt;concatenate (masterfile)&lt;/P&gt;&lt;P&gt;save masterfile&lt;/P&gt;&lt;P&gt;re-run script&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I reading this correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 13:34:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750159#M93077</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2024-04-26T13:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750184#M93079</link>
      <description>&lt;P&gt;yes&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 13:40:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750184#M93079</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-26T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750199#M93082</link>
      <description>&lt;P&gt;This is what opens after the run.&amp;nbsp; (Curiously, it shows a relict file name (v2n=25....) that my jsl code does NOT use - I've checked and rechecked).&amp;nbsp; In any case, the following code - shown below - is not producing concatenated rows.&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="learning_JSL_0-1714140099453.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63744iECB0FDAD1AACEFEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="learning_JSL_0-1714140099453.png" alt="learning_JSL_0-1714140099453.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\testtest2 n=258.xls");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;///ADD APPEND SCRIPT&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Concatenate("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls") ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//SAVE MASTERFILE CONTAINING ROWS (APPENDED) OF ALL RUNS&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dt&amp;lt;&amp;lt; save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be most appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 14:03:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750199#M93082</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2024-04-26T14:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750200#M93083</link>
      <description>&lt;P&gt;Try selecting the check box labeled&amp;nbsp; "Append to First Table"&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 14:07:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750200#M93083</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-26T14:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750225#M93086</link>
      <description>&lt;P&gt;Unfortunately, that didn't help.&amp;nbsp; The concatenate script is still not working.&amp;nbsp; (Curious, if the script automates the process, I'm not sure why I would need to click a check box on a popup window each time I run the script.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also (probably not related to the concatenate script not working), for some reason a relict (now deleted file) is being opened at the outset of the run, instead of the file that the script says to run.&amp;nbsp; &amp;nbsp;I can't figure out why that is happening.&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="learning_JSL_0-1714141497049.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63745i4774AC0F0053538B/image-size/large?v=v2&amp;amp;px=999" role="button" title="learning_JSL_0-1714141497049.png" alt="learning_JSL_0-1714141497049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I then run the regression, add some columns based on the results of the run, and then....&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="learning_JSL_1-1714141593621.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63746i411D06B0BD9563D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="learning_JSL_1-1714141593621.png" alt="learning_JSL_1-1714141593621.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2024 14:27:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750225#M93086</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2024-04-26T14:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750278#M93095</link>
      <description>&lt;P&gt;Here is an example script that I hope clears up what you need to do to concatenate new data to a master file&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// Create 2 data tables and save them as excel files
// one will be the master and one will play the role of the new data
dtExample = open("$SAMPLE_DATA/big class.jmp");
theTables =dtExample &amp;lt;&amp;lt; Subset(
	By( :sex ),
	All rows,
	Selected columns only( 0 ),
	columns( :name, :age, :height, :weight )
);
close( dtExample, nosave );
// Change the names of the first table to Master
theTables[1] &amp;lt;&amp;lt; set name("Master");
data table("Master") &amp;lt;&amp;lt; bring window to front;
// Add the new columns to the master, like your master file already
// has all of the columns.  In this example, I will only add 1 column
data table("Master")&amp;lt;&amp;lt; new column("Ratio", set each value(:height/:weight));
// Wait 5 seconds so you can observe the master table
wait(5);
// save and close the Master table as an excel table
close( data table("Master"), save("$TEMP/master.xlsx"));

// Change the name of the second table to New Data
theTables[2] &amp;lt;&amp;lt; set name("New Data");
data table("New Data") &amp;lt;&amp;lt; bring to front;
// wait 5 seconds here too, so you can observe the New Data table
wait(5);
// now save and close the New Data table as an excel table
close( data table("New Data"), save("$TEMP/New Data.xlsx"));

// Now that there are a Master and a New Data table that have been
// created we can now illustrate how to read in some new data,
// add the required new columns, save it, then open the master file,
// and concatenate the new data to the master and then save the updated
// master file

// open the new data table.  I am using the variable dt as the pointer
// to the file, since that is what you are doing in your script
dt = open("$TEMP/New Data.xlsx");
// Add the new columns (in this example, only 1 column) to the data table
// your syntax is
//      new column("ratio", formula(:height/:weight);
// I suggest that you become more precise and point to the specific data table
// by using either
//      dt &amp;lt;&amp;lt; New Column(......);
// or
//      data table("New Data") &amp;lt;&amp;lt; New Column( ...... );
data table("New Data") &amp;lt;&amp;lt; New Column( "Ratio", formula(:height/:weight));

// Now the data can be saved
// use either
//     dt&amp;lt;&amp;lt; save(...........);
// or
//     data table("New Data")&amp;lt;&amp;lt; save(................);
dt &amp;lt;&amp;lt; save("$TEMP\test1 n=22.xlsx");

// now open the master table
dtMaster = open("$TEMP\master.xlsx");
// concatenate the new data table to the master
dtMaster &amp;lt;&amp;lt; concatenate( dt, append to first table(1));

// now save the master
dtMaster &amp;lt;&amp;lt; save("$TEMP\master.xlsx");

// uncomment the below code if you want to close the new data and the master tables
// close( dt, nosave );
// close( dtMaster, nosave );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2024 16:23:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750278#M93095</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-26T16:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to write script that will append results of regression analysis to an existing excel spreadsheet</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750569#M93157</link>
      <description>&lt;P&gt;Excellent - thank you, Jim!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 11:30:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-write-script-that-will-append-results-of-regression/m-p/750569#M93157</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2024-04-29T11:30:09Z</dc:date>
    </item>
  </channel>
</rss>

