<?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: SPLIT from tall to wide: how to group the resulting columns dynamically? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/396208#M64691</link>
    <description>&lt;P&gt;Here is a simple script that creates a new group of columns that begin with the characters "NPN"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1624666509566.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33803iBF7DF12C8416D62B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1624666509566.png" alt="txnelson_0-1624666509566.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNamesList = dt &amp;lt;&amp;lt; get column names(string, continuous);

NPNList = {};

for(i=1,i&amp;lt;=nitems(colNamesList),i++,
	If(contains(colNamesList[i],"NPN")==1,
		insert into(NpNList,colNamesList[i])
	)
);
dt &amp;lt;&amp;lt; group columns("NPNGroup", NPNList);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jun 2021 00:15:52 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-06-26T00:15:52Z</dc:date>
    <item>
      <title>SPLIT from tall to wide: how to group the resulting columns dynamically?</title>
      <link>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/396139#M64685</link>
      <description>&lt;P&gt;So I've got a large dt that I'm splitting from TALL to WIDE. This results in a huge qty of columns, all with the header format = "Step#_Parameter_Function".&lt;/P&gt;&lt;P&gt;The amount of these columns vary and are never predictable and set, nor are the step #'s or names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would i be able to then group these columns by Step#? Some sort of loop to scan through the long list of columns, pick out the first Step# and then assign it to a group labeled that "Step#"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; Split(
       Split By( :recipe_step_id, :parameter_name, :aggregate_function ),
       Split( :value ),
       Group( :recipe, :equipment_id, :chamber_id, :wafer_scribe, :wafer_process_start_time ),
       Output Table( "Wide" ),
       Remaining Columns( Drop All ),
       Sort by Column Property
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aliegner1_0-1624651417165.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33800i34ECA36838637CCB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aliegner1_0-1624651417165.png" alt="aliegner1_0-1624651417165.png" /&gt;&lt;/span&gt;&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="aliegner1_1-1624651446037.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33801iDC236A959139CF75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aliegner1_1-1624651446037.png" alt="aliegner1_1-1624651446037.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:50:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/396139#M64685</guid>
      <dc:creator>aliegner1</dc:creator>
      <dc:date>2023-06-09T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT from tall to wide: how to group the resulting columns dynamically?</title>
      <link>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/396208#M64691</link>
      <description>&lt;P&gt;Here is a simple script that creates a new group of columns that begin with the characters "NPN"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1624666509566.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33803iBF7DF12C8416D62B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1624666509566.png" alt="txnelson_0-1624666509566.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNamesList = dt &amp;lt;&amp;lt; get column names(string, continuous);

NPNList = {};

for(i=1,i&amp;lt;=nitems(colNamesList),i++,
	If(contains(colNamesList[i],"NPN")==1,
		insert into(NpNList,colNamesList[i])
	)
);
dt &amp;lt;&amp;lt; group columns("NPNGroup", NPNList);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 00:15:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/396208#M64691</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-06-26T00:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT from tall to wide: how to group the resulting columns dynamically?</title>
      <link>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/397305#M64797</link>
      <description>&lt;P&gt;amazing. One final question. Is it possible to feed it a list of Character String Groups to run through, looking for those columns that match, then putting them in their respective groups?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;like a list of:&lt;/P&gt;&lt;P&gt;columns that start with "AAA", "BBB","CCC",etc&lt;/P&gt;&lt;P&gt;and then put them in groups labeled AAA, BBB, CCC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to error skip if there are no columns matching BBB?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 21:34:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/397305#M64797</guid>
      <dc:creator>aliegner1</dc:creator>
      <dc:date>2021-06-30T21:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: SPLIT from tall to wide: how to group the resulting columns dynamically?</title>
      <link>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/397322#M64803</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Please take the time to read the Scripting Guide found in the JMP Documentation Library under the Help pull down menu.&amp;nbsp; It will give you the language structures you can use to solve problems such as the one you currently asked about.&lt;/LI&gt;
&lt;LI&gt;Below is a simple example script that creates groups of columns it finds.&amp;nbsp; Please note, intentionally, there are no columns that begin with XYZ, even though the script checks for it&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
// Open Data Table: semiconductor capability.jmp
// → Data Table( "semiconductor capability" )
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

colNameList = dt &amp;lt;&amp;lt; get column names( string );

NPNList = {};
PNPList = {};
XYZList = {};

// Find matching column names
For( i = 1, i &amp;lt;= N Items( colNameList ), i++,
	If(
		Left( colNameList[i], 3 ) == "NPN",
			Insert Into( NPNList, colNameList[i] ),
		Left( colNameList[i], 3 ) == "PNP",
			Insert Into( PNPList, colNameList[i] ),
		Left( colNameList[i], 3 ) == "XYZ",
			Insert Into( XYZList, colNameList[i] )
	)
);

// If groups of columns are found, creat JMP groupings
If( N Items( NPNList ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; select columns( NPNList );
	dt &amp;lt;&amp;lt; group columns();
);
If( N Items( PNPList ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; select columns( PNPList );
	dt &amp;lt;&amp;lt; group columns();
);
If( N Items( XYZList ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; select columns( XYZList );
	dt &amp;lt;&amp;lt; group columns();
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jul 2021 00:31:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SPLIT-from-tall-to-wide-how-to-group-the-resulting-columns/m-p/397322#M64803</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-07-01T00:31:16Z</dc:date>
    </item>
  </channel>
</rss>

