<?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: Blocks of data - reorganization in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488305#M73178</link>
    <description>&lt;P&gt;Here is a simple script that works on your sample data.&amp;nbsp; It should give you a good start on a way to approach your big table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; New Column( "Col A_2" );
dt &amp;lt;&amp;lt; go to( :Col A_2 );
dt &amp;lt;&amp;lt; move Selected Columns( After( :Col A ) );

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If( :Col A[i] &amp;gt; 1,
		holdRow = i
	);
	If( :Col A[i] &amp;lt;= 1,
		:Col A_2[holdRow] = :Col A[i];
		:Col A[i] = .;
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 May 2022 02:39:08 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-05-19T02:39:08Z</dc:date>
    <item>
      <title>Blocks of data - reorganization</title>
      <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488259#M73169</link>
      <description>&lt;P&gt;Hello!&amp;nbsp; I have "blocks" of data, where multiple rows correspond to one data point. Within this block, I have a column where some values are stacked. I wish for these values to be in a single row.&lt;BR /&gt;&lt;BR /&gt;By scripting, how do I&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Save the value &amp;lt;= 1 in Col A&lt;/LI&gt;&lt;LI&gt;Create new column, Col A_2&lt;/LI&gt;&lt;LI&gt;Insert saved data from step 1&lt;/LI&gt;&lt;LI&gt;Repeat with all blocks.&amp;nbsp; Blocks are illustrated below by: Row A,B; Row C,D; Row E,F&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The distance between the value &amp;gt; 1 and &amp;lt;=1 can vary anywhere from right next to each other to a lot of data, but the data always seems to be value &amp;gt; 1, n amount of rows, value &amp;lt;= 1.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-05-18 153217.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/42529i19109FBF1808E05A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-05-18 153217.png" alt="Screenshot 2022-05-18 153217.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I truly value your help! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:48:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488259#M73169</guid>
      <dc:creator>StarfruitBob</dc:creator>
      <dc:date>2023-06-10T23:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Blocks of data - reorganization</title>
      <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488305#M73178</link>
      <description>&lt;P&gt;Here is a simple script that works on your sample data.&amp;nbsp; It should give you a good start on a way to approach your big table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; New Column( "Col A_2" );
dt &amp;lt;&amp;lt; go to( :Col A_2 );
dt &amp;lt;&amp;lt; move Selected Columns( After( :Col A ) );

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If( :Col A[i] &amp;gt; 1,
		holdRow = i
	);
	If( :Col A[i] &amp;lt;= 1,
		:Col A_2[holdRow] = :Col A[i];
		:Col A[i] = .;
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2022 02:39:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488305#M73178</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-05-19T02:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Blocks of data - reorganization</title>
      <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488550#M73208</link>
      <description>&lt;P&gt;Thank you so much, txnelson! This works!&lt;BR /&gt;&lt;BR /&gt;Question, what does holdRow do?&amp;nbsp; I've searched the scripting guide for v14 &amp;amp; 16 and didn't find it.&lt;BR /&gt;&lt;BR /&gt;I've also figured out how to delete the row that data was coped from and all of the rows in between the &amp;gt;1 value and &amp;lt;= 1 value, so this data looks much better!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 17:00:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488550#M73208</guid>
      <dc:creator>StarfruitBob</dc:creator>
      <dc:date>2022-05-19T17:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Blocks of data - reorganization</title>
      <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488695#M73219</link>
      <description>&lt;P&gt;holdRow is just the name I gave to a JMP scaler variable that holds the last row where the value of Col A was greater than 1.&amp;nbsp; The name holdRow could be any name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 20:16:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488695#M73219</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-05-19T20:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Blocks of data - reorganization</title>
      <link>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488697#M73220</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 20:55:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Blocks-of-data-reorganization/m-p/488697#M73220</guid>
      <dc:creator>StarfruitBob</dc:creator>
      <dc:date>2022-05-19T20:55:35Z</dc:date>
    </item>
  </channel>
</rss>

