<?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: How to use Select Where () with Contains () to find partial matches in data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710241#M89410</link>
    <description>&lt;P&gt;Here's what I do when looking for partial matches.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "TestRegex", Add Rows( 8 ),
	New Column( "TestCol", Character, "Nominal",
		Set Values(
			{"Current_I20_Stage2", "xyz", "Capacitance_DIFF_corner_Stage1", "lmnop",
			"aaa", "Voltage_CIB_Stage3", "Voltage_CIB_Stage3",
			"Resistance_FURR__side_Stage3"}
		)
	)
);

myList  = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};
for (i = 1, i &amp;lt;= nitems(mylist), i++,
	match_rows = dt &amp;lt;&amp;lt; get rows where(! is missing(regex(as column(dt, "TestCol"), 
				mylist[i], "\0", ignorecase)));
	print(match_rows);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Dec 2023 20:07:13 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2023-12-18T20:07:13Z</dc:date>
    <item>
      <title>How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710143#M89397</link>
      <description>&lt;P&gt;I have a list&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myList  = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and a data table with one of columns called Parameter with some row entries as&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current_I20_Stage2
Voltage_CIB_Stage3
Capacitance_DIFF_corner_Stage1
Resistance_FURR__side_Stage3&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Using &lt;EM&gt;myList&lt;/EM&gt; with &lt;EM&gt;Contains()&lt;/EM&gt; to extract the full parameters names from the data table into a list. How to do this via JSL?&lt;/P&gt;&lt;P&gt;For a start, the following is not selecting anything in my data table. Where am I going wrong?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt&amp;lt;&amp;lt; select where(Contains(mylist, As column (Parameter)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 17:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710143#M89397</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-12-18T17:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710153#M89399</link>
      <description>&lt;P&gt;Try adding empty square brackets after the closing parenthesis of your function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt&amp;lt;&amp;lt; select where(Contains(mylist, As column (Parameter)[]));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2023 17:34:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710153#M89399</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-12-18T17:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710160#M89400</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp; Done, I do not get any errors but it does not select anything in the data table.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 13:47:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710160#M89400</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2024-01-03T13:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710165#M89401</link>
      <description>&lt;P&gt;You need full matches when using contains with a list. You could use Word() to make your data table values be in same format as your list and then use contains (also convert the list to list of strings)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(6),
	Compress File When Saved(1),
	New Column("param",
		Character,
		"Nominal",
		Set Values(
			{"Current_I20_Stage2", "Voltage_CIB_Stage3", "Capacitance_DIFF_corner_Stage1",
			"Resistance_FURR__side_Stage3", "a", "b"}
		)
	)
);

my_list = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};

rows = dt &amp;lt;&amp;lt; Get Rows Where(Contains(my_list, Word([1 2], :param, "_") || "_"));
vals = dt[rows, "param"];&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>Mon, 18 Dec 2023 17:58:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710165#M89401</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-18T17:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710241#M89410</link>
      <description>&lt;P&gt;Here's what I do when looking for partial matches.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "TestRegex", Add Rows( 8 ),
	New Column( "TestCol", Character, "Nominal",
		Set Values(
			{"Current_I20_Stage2", "xyz", "Capacitance_DIFF_corner_Stage1", "lmnop",
			"aaa", "Voltage_CIB_Stage3", "Voltage_CIB_Stage3",
			"Resistance_FURR__side_Stage3"}
		)
	)
);

myList  = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};
for (i = 1, i &amp;lt;= nitems(mylist), i++,
	match_rows = dt &amp;lt;&amp;lt; get rows where(! is missing(regex(as column(dt, "TestCol"), 
				mylist[i], "\0", ignorecase)));
	print(match_rows);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2023 20:07:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710241#M89410</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2023-12-18T20:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710381#M89432</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;This works but does not seem to honour hidden and excluded rows in the data table &lt;EM&gt;dt&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to exclude some rows based on another column in my data table as in JSL below. Perhaps this could be done within &lt;EM&gt;Get Rows Where ()&lt;/EM&gt;?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
clear log ();
dt = New Table("Untitled 2",
	Add Rows(6),
	Compress File When Saved(1),
	New Column("param",
		Character,
		"Nominal",
		Set Values(
			{"Current_I20_Stage2", "Voltage_CIB_Stage3", "Capacitance_DIFF_corner_Stage1",
			"Resistance_FURR__side_Stage3", "a", "b"}
		)
	),
	New Column("Group",
		Character,
		"Nominal",
		Set Values(
			{"A", "B", "C",	"D", "E", "F"}
		)
	),
);

ToHideAndExcludeList   =  {"A", "D", "F"}; 
dt &amp;lt;&amp;lt; Select Where( Contains(ToHideAndExcludeList, :Group) );
sr = dt &amp;lt;&amp;lt; Invert Row Selection;
sr &amp;lt;&amp;lt; Hide and Exclude;

my_list = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};

rows = dt &amp;lt;&amp;lt; Get Rows Where(Contains(my_list, Word([1 2], :param, "_") || "_"));
vals = dt[rows, "param"];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 13:00:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710381#M89432</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-12-19T13:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710403#M89434</link>
      <description>&lt;P&gt;You could include the Row State as another condition.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 14:20:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710403#M89434</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-12-19T14:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710438#M89436</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;Thanks. Do you mean use Row State with Contains? Could I please have an example?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 15:36:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710438#M89436</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-12-19T15:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710441#M89437</link>
      <description>&lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Clear Log();
dt = New Table( "Untitled 2",
	Add Rows( 6 ),
	Compress File When Saved( 1 ),
	New Column( "param",
		Character,
		"Nominal",
		Set Values( {"Current_I20_Stage2", "Voltage_CIB_Stage3", "Capacitance_DIFF_corner_Stage1", "Resistance_FURR__side_Stage3", "a", "b"} )
	),
	New Column( "Group", Character, "Nominal", Set Values( {"A", "B", "C", "D", "E", "F"} ) ),

);
ToHideAndExcludeList = {"A", "D", "F"};
dt &amp;lt;&amp;lt; Select Where( Contains( ToHideAndExcludeList, :Group ) );
sr = dt &amp;lt;&amp;lt; Invert Row Selection;
sr &amp;lt;&amp;lt; Hide and Exclude;
my_list = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};
exrows = dt &amp;lt;&amp;lt; Get Excluded Rows;
rows = dt &amp;lt;&amp;lt; Get Rows Where( All( Contains( my_list, Word( [1 2], :param, "_" ) || "_" ), Contains( exrows, Row() ) == 0 ) );
vals = dt[rows, "param"];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2023 15:52:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710441#M89437</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2023-12-19T15:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710449#M89438</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt;&amp;nbsp;Many thanks. This works, but I would have preferred an approach where one could filter by row state ( as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;suggested)&amp;nbsp; under &lt;EM&gt;Contains ()&lt;/EM&gt;. This would avoid any data table manipulation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 16:20:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710449#M89438</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-12-19T16:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710450#M89439</link>
      <description>&lt;P&gt;You could use !Excluded() and !Hidden() but Contains() seems to be doing some funny stuff in this case, so you have to manage around that, All() seems to work in this case&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
Clear Log();
dt = New Table("Untitled 2",
	Add Rows(6),
	Compress File When Saved(1),
	New Column("param",
		Character,
		"Nominal",
		Set Values(
			{"Current_I20_Stage2", "Voltage_CIB_Stage3", "Capacitance_DIFF_corner_Stage1",
			"Resistance_FURR__side_Stage3", "a", "b"}
		)
	),
	New Column("Group", Character, "Nominal", Set Values({"A", "B", "C", "D", "E", "F"})),

);

ToHideAndExcludeList = {"A", "D", "F"};
dt &amp;lt;&amp;lt; Select Where(Contains(ToHideAndExcludeList, :Group));
sr = dt &amp;lt;&amp;lt; Invert Row Selection;
sr &amp;lt;&amp;lt; Hide and Exclude;
dt &amp;lt;&amp;lt; Clear Select;

my_list = {"Current_I20_", "Voltage_CIB_", "Capacitance_DIFF_", "Resistance_FURR_"};

rows = dt &amp;lt;&amp;lt; Get Rows Where(All(Contains(my_list, Word([1 2], :param, "_") || "_")) &amp;amp; !Excluded() &amp;amp; !Hidden());
vals = dt[rows, "param"];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Or some eval expr&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rows = dt &amp;lt;&amp;lt; Get Rows Where(Eval(EvalExpr((Contains(my_list, Expr(Word([1 2], :param, "_") || "_"))))) &amp;amp; !Excluded() &amp;amp; !Hidden());
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2023 16:41:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710450#M89439</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-19T16:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Select Where () with Contains () to find partial matches in data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710458#M89441</link>
      <description>&lt;P&gt;Yes, combine multiple conditions with And() to match strings for rows that are not currently hidden or excluded. There is a complete explanation and plenty of examples &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/row-states.shtml" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:47:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-use-Select-Where-with-Contains-to-find-partial-matches-in/m-p/710458#M89441</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-12-19T17:47:29Z</dc:date>
    </item>
  </channel>
</rss>

