<?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: Script to transpose data in an existing data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/29009#M19245</link>
    <description>yours is a better solution if you have the ":Tag" column for the matching of column names</description>
    <pubDate>Wed, 09 Nov 2016 14:37:10 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2016-11-09T14:37:10Z</dc:date>
    <item>
      <title>Script to transpose data in an existing data table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/28890#M19221</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I like to find a script to transpose data. And this data should be inserted at the last row of an existing file. Following how I transpose the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Table&lt;STRONG&gt;(&lt;/STRONG&gt; "pisnapshot Abfrage AL2" &lt;STRONG&gt;)&lt;/STRONG&gt; &amp;lt;&amp;lt; &lt;STRONG&gt;Transpose&lt;/STRONG&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns&lt;STRONG&gt;(&lt;/STRONG&gt; :value &lt;STRONG&gt;)&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transpose selected rows only&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;STRONG&gt;1&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Output Table&lt;STRONG&gt;(&lt;/STRONG&gt; "AL2 Snapshot Transpose" &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;Data Table&lt;STRONG&gt;(&lt;/STRONG&gt; "pisnapshot Abfrage AL2" &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that JMP copies the data every time a new Data Table. How is it possible to copy it into an existing File (File is open)?&lt;/P&gt;&lt;P&gt;I got the idea to select the transposed row ("AL2 Snapshot Transpose") and to copy it into my target file. But I was not able to find a command to copy the Row Values.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 11:21:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/28890#M19221</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2016-11-08T11:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script to transpose data in an existing data table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/28894#M19224</link>
      <description>&lt;P&gt;I think the script below is a simplier solution to what you stated you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

// Get the selected rows
selRows = dt &amp;lt;&amp;lt; get selected rows;

If( N Rows( selRows ) &amp;gt; 0, 
// Add the row to place the data into
	dt &amp;lt;&amp;lt; Add Rows( 1 );

// Go from column to column and move the selected data to the new row
	For( i = 1, i &amp;lt;= N Cols( dt ), i++,
		Column( dt, i )[N Rows( dt )] = Column( dt, N Col( dt ) )[selRows[i]]
	);

// Delete the last column
	dt &amp;lt;&amp;lt; delete columns( Column( dt, N Cols( dt ) ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2016 14:16:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/28894#M19224</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2016-11-08T14:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script to transpose data in an existing data table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/29007#M19243</link>
      <description>&lt;P&gt;Thank you for the fast response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile I tried something different. Therefore I used the function “concentrate”:&lt;/P&gt;&lt;PRE&gt;//transponse table
Data Table( "pisnapshot Abfrage AL2" ) &amp;lt;&amp;lt; Transpose(
	columns( :value ),
	Transpose selected rows only( 1 ),
	Label( :tag ),
	Output Table( "AL2 Snapshot Transpose" ));

//add Table "AL2 Snapshot Transpose" to exsiting table "AL2 Snapshot"
Data Table( "AL2 Snapshot" ) &amp;lt;&amp;lt; Concatenate(Data Table( "AL2 Snapshot Transpose" ),Append to first table);
//close table with “no save”
Close(Data Table( "AL2 Snapshot Transpose" ), No Save);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it works perfectly. But I will try your solution .&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 14:25:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/29007#M19243</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2016-11-09T14:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script to transpose data in an existing data table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/29009#M19245</link>
      <description>yours is a better solution if you have the ":Tag" column for the matching of column names</description>
      <pubDate>Wed, 09 Nov 2016 14:37:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-transpose-data-in-an-existing-data-table/m-p/29009#M19245</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2016-11-09T14:37:10Z</dc:date>
    </item>
  </channel>
</rss>

