<?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 how to use contains for mutiple charators selection and subset ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780345#M96232</link>
    <description>&lt;P&gt;I wrote a script for the following purpose:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;for "chart" column, i want select all items which contains mutiple charators like：" Trace width","Trace thickness","insulator thickness" , actually i have more to be selected, but in jsl which i worte just take 3 charators. I take 6 rows to take them one by one, and subset them to 3 new tables. that is a a little complex, any ideas to set only one row script like OR() or ORMZ(), i tried, but failed. the script works, but seems to stupid.-_-!!!&lt;/LI&gt;&lt;LI&gt;second question, in the subset rows, i have set output talbe("TT"), means i want to name the new subset talbe, but actually the new table name is not change, how i can write the script for it ?&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
IM = Open("$DESKTOP/sample table.jmp" );
IM &amp;lt;&amp;lt;select where(contains (:Chart,"Trace thickness"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("TT"));

IM &amp;lt;&amp;lt;select where(contains (:Chart,"Trace width"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("TW"));

IM &amp;lt;&amp;lt;select where(contains (:Chart,"Insulator thicknes"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("InT"));

Data Table( "Subset of sample table" ) &amp;lt;&amp;lt; Concatenate(
	Data Table( "Subset of sample table 2" ),
	Data Table( "Subset of sample table 3" ),
	Output Table( "IMP table" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Aug 2024 18:11:53 GMT</pubDate>
    <dc:creator>Sean_ShCn0</dc:creator>
    <dc:date>2024-08-08T18:11:53Z</dc:date>
    <item>
      <title>how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780345#M96232</link>
      <description>&lt;P&gt;I wrote a script for the following purpose:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;for "chart" column, i want select all items which contains mutiple charators like：" Trace width","Trace thickness","insulator thickness" , actually i have more to be selected, but in jsl which i worte just take 3 charators. I take 6 rows to take them one by one, and subset them to 3 new tables. that is a a little complex, any ideas to set only one row script like OR() or ORMZ(), i tried, but failed. the script works, but seems to stupid.-_-!!!&lt;/LI&gt;&lt;LI&gt;second question, in the subset rows, i have set output talbe("TT"), means i want to name the new subset talbe, but actually the new table name is not change, how i can write the script for it ?&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
IM = Open("$DESKTOP/sample table.jmp" );
IM &amp;lt;&amp;lt;select where(contains (:Chart,"Trace thickness"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("TT"));

IM &amp;lt;&amp;lt;select where(contains (:Chart,"Trace width"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("TW"));

IM &amp;lt;&amp;lt;select where(contains (:Chart,"Insulator thicknes"));
dt=IM&amp;lt;&amp;lt;subset(Rows(IMP),selected rows(0),output table ("InT"));

Data Table( "Subset of sample table" ) &amp;lt;&amp;lt; Concatenate(
	Data Table( "Subset of sample table 2" ),
	Data Table( "Subset of sample table 3" ),
	Output Table( "IMP table" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2024 18:11:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780345#M96232</guid>
      <dc:creator>Sean_ShCn0</dc:creator>
      <dc:date>2024-08-08T18:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780356#M96234</link>
      <description>&lt;P&gt;You could use Or and multiple contains statements, Substitute to replace those strings and check for length or use Regex. Here are examples for substitute and regex (substitute is most likely faster)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/sample table.jmp");
dt &amp;lt;&amp;lt; select where(Length(:Chart) &amp;gt; Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));
// dt &amp;lt;&amp;lt; select where(!Is Missing(Regex(:Chart, "Trace thickness|Trace width|Insulator thicknes")));

dt_subset = dt &amp;lt;&amp;lt; Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 18:19:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780356#M96234</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-08-08T18:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780361#M96236</link>
      <description>&lt;P&gt;it works, and with high effience. thanks very much!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 18:25:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780361#M96236</guid>
      <dc:creator>Sean_ShCn0</dc:creator>
      <dc:date>2024-08-08T18:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780364#M96237</link>
      <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have further question on Recode, i want recode by chart , filter all the charater when there are "Trace thickness" characters in name, i need recode them to new name "TT"&lt;/P&gt;&lt;P&gt;i have a script but same qustion ,it is not good. Could you also help to check if have better solution for it ? Thanks a lot!&amp;nbsp; &amp;nbsp;KRs Sean&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open( "$DESKTOP/sample table.jmp" );
dt &amp;lt;&amp;lt; select where(Length(:Chart) &amp;gt; Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));


dt_subset = dt &amp;lt;&amp;lt; Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));

// Recode column: Category
dt = Data Table( "Subset" );
dt &amp;lt;&amp;lt; Begin Data Update;
col1 = dt &amp;lt;&amp;lt; New Column( dt:Chart );
col1 &amp;lt;&amp;lt; Set Name( "Category" );
dt &amp;lt;&amp;lt; Move Selected Columns( {col1}, after( dt:Chart ) );
dt &amp;lt;&amp;lt; Recode Column(
	dt:Chart,
	{Map Value(
		_rcOrig,
		{"B 1B 110um Trace thickness", "TT", "B 2B 18um Trace thickness", "TT",
		"B 2F 15um Trace thickness", "TT", "B 2F 24um Trace thickness,DE D", "TT",
		"B 2F 32um Trace thickness,SE6", "TT", "B 3B 90um Trace thickness", "TT",
		"B 3F 90um Trace thickness", "TT", "B 4B 18um Trace thickness", "TT",
		"B 4F 13um Trace thickness,DE B", "TT", "B 4F 15um Trace thickness", "TT",
		"B 4F 18um Trace thickness,DE B", "TT", "B 4F 24um Trace thickness,DE C",
		"TT", "B 4F 30um Trace thickness,DE C", "TT",
		"B 4F 32um Trace thickness,SE6", "TT", "B 4F 35.5um Trace thickness,SE6",
		"TT", "B 4F 41um Trace thickness,SE2", "TT",
		"B 4F 44.5um Trace thickness,SE2", "TT", "B 5B 90um Trace thickness", "TT",
		"B 5F 90um Trace thickness", "TT", "B 6B 18um Trace thickness", "TT",
		"B 6F 13.5um Trace thickness,SE5", "TT", "B 6F 14um Trace thickness", "TT",
		"B 6F 15um Trace thickness,SE2 L2", "TT", "B 6F 15um Trace thickness,SE5",
		"TT", "B 6F 17um Trace thickness,SE4", "TT", "B 6F 18.5um Trace thickness",
		"TT", "B 6F 20um Trace thickness,SE3", "TT", "B 6F 20um Trace thickness,SE4",
		"TT", "B 6F 41um Trace thickness,SE2 L1", "TT",
		"B 6F 44.5um Trace thickness,SE2 L1", "TT", "B 7B 85um Trace thickness",
		"TT", "B 7F 14um Trace thickness", "TT", "B 8B 18um Trace thickness", "TT",
		"B 8F 14um Trace thickness", "TT", "B 8F 18um Trace thickness,SE1", "TT",
		"B 8F 28.5um Trace thickness,DE A", "TT", "B 8F 30.5um Trace thickness,SE5",
		"TT", "B 9B 90um Trace thickness", "TT", "B 9F 14um Trace thickness", "TT"},
		Unmatched( _rcNow )
	)},
	Update Properties( 1 ),
	Target Column( col1 )
);
dt &amp;lt;&amp;lt; End Data Update;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 18:37:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780364#M96237</guid>
      <dc:creator>Sean_ShCn0</dc:creator>
      <dc:date>2024-08-08T18:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780379#M96238</link>
      <description>&lt;P&gt;You can use the Replace String in Recode&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1723142986444.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66982i1A771A50EE524945/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1723142986444.png" alt="jthi_1-1723142986444.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="jthi_0-1723142823838.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66981i914828BA1A46805A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1723142823838.png" alt="jthi_0-1723142823838.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And in this case it seems to be able to even create working&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Local({dt, col1},
	dt = Data Table("Subset");
	dt &amp;lt;&amp;lt; Begin Data Update;
	col1 = dt &amp;lt;&amp;lt; New Column(dt:Chart);
	col1 &amp;lt;&amp;lt; Set Name("Chart 2");
	dt &amp;lt;&amp;lt; Move Selected Columns({col1}, after(dt:Chart));
	For Each Row(
		dt,
		col1[] = If(Contains(dt:Chart, "Trace thickness"),
			"TT",
			dt:Chart
		)
	);
	dt &amp;lt;&amp;lt; End Data Update;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can slightly modify it if you wish to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open( "$DOWNLOADS/sample table.jmp" );
dt &amp;lt;&amp;lt; select where(Length(:Chart) &amp;gt; Length(Substitute(:Chart, {"Trace thickness", "Trace width", "Insulator thicknes"}, {"", "", ""})));


dt_subset = dt &amp;lt;&amp;lt; Subset(Selected Rows, Selected Columns Only(0), Output Table("Subset"));

dt_subset &amp;lt;&amp;lt; Begin Data Update;
For Each Row(
	dt_subset,
	:Chart = If(Contains(dt:Chart, "Trace thickness"),
		"TT",
		dt:Chart
	)
);
dt_subset &amp;lt;&amp;lt; End Data Update;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2024 18:50:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780379#M96238</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-08-08T18:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to use contains for mutiple charators selection and subset ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780492#M96259</link>
      <description>&lt;P&gt;Thanks, Jarmo, thanks a lot. It works and help me to generate ideas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KR&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 09:02:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-use-contains-for-mutiple-charators-selection-and-subset/m-p/780492#M96259</guid>
      <dc:creator>Sean_ShCn0</dc:creator>
      <dc:date>2024-08-09T09:02:14Z</dc:date>
    </item>
  </channel>
</rss>

