<?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 Search specific name by IF in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683716#M86932</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have set up a New Column "&lt;STRONG&gt;Pin Name&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;and would like to add a number of PIN&lt;/P&gt;&lt;P&gt;It means if you contain &lt;STRONG&gt;gp_0&lt;/STRONG&gt; in the column "&lt;STRONG&gt;Test Name&lt;/STRONG&gt;" it should be &lt;STRONG&gt;GP_0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;if you have contains&lt;STRONG&gt; gp_1&lt;/STRONG&gt; in test name it should be &lt;STRONG&gt;GP_1 &lt;/STRONG&gt;in&amp;nbsp;Column &lt;STRONG&gt;"Pin Name"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;if you have contains &lt;STRONG&gt;gp_11&lt;/STRONG&gt; in test name it should be &lt;STRONG&gt;GP_11&amp;nbsp;in&amp;nbsp;Column "Pin Name"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I wrote the script&lt;/P&gt;&lt;DIV&gt;Column(dt,"PIN_NAME") &amp;lt;&amp;lt; Formula ( If ( Contains( :TEST_NAME, "gp_0" ), "GP_0",&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_1" ), "GP_1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_10" ), "GP_10",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_11" ), "GP_11",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_12" ), "GP_12" ))))));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;but I see the formula add GP_1 even I have gp_11 in test name.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;so my question is, how I can set exactly name for searching?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dennisbur_0-1696416826951.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57209i2C813F32F75FC2D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dennisbur_0-1696416826951.png" alt="Dennisbur_0-1696416826951.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 11:00:55 GMT</pubDate>
    <dc:creator>Dennisbur</dc:creator>
    <dc:date>2023-10-04T11:00:55Z</dc:date>
    <item>
      <title>Search specific name by IF</title>
      <link>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683716#M86932</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have set up a New Column "&lt;STRONG&gt;Pin Name&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;and would like to add a number of PIN&lt;/P&gt;&lt;P&gt;It means if you contain &lt;STRONG&gt;gp_0&lt;/STRONG&gt; in the column "&lt;STRONG&gt;Test Name&lt;/STRONG&gt;" it should be &lt;STRONG&gt;GP_0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;if you have contains&lt;STRONG&gt; gp_1&lt;/STRONG&gt; in test name it should be &lt;STRONG&gt;GP_1 &lt;/STRONG&gt;in&amp;nbsp;Column &lt;STRONG&gt;"Pin Name"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;if you have contains &lt;STRONG&gt;gp_11&lt;/STRONG&gt; in test name it should be &lt;STRONG&gt;GP_11&amp;nbsp;in&amp;nbsp;Column "Pin Name"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I wrote the script&lt;/P&gt;&lt;DIV&gt;Column(dt,"PIN_NAME") &amp;lt;&amp;lt; Formula ( If ( Contains( :TEST_NAME, "gp_0" ), "GP_0",&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_1" ), "GP_1",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_10" ), "GP_10",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_11" ), "GP_11",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If( Contains( :TEST_NAME, "gp_12" ), "GP_12" ))))));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;but I see the formula add GP_1 even I have gp_11 in test name.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;so my question is, how I can set exactly name for searching?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dennisbur_0-1696416826951.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57209i2C813F32F75FC2D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Dennisbur_0-1696416826951.png" alt="Dennisbur_0-1696416826951.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 11:00:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683716#M86932</guid>
      <dc:creator>Dennisbur</dc:creator>
      <dc:date>2023-10-04T11:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Search specific name by IF</title>
      <link>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683739#M86936</link>
      <description>&lt;P&gt;JMP will end the If() loop as soon as a condition is met.&amp;nbsp; Technically, "gp_11" does contain "gp_1"....&lt;/P&gt;&lt;P&gt;You could rewrite the If() loop backwards, like&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	Contains( :TEST_NAME, "gp_12" ), "GP_12",
	Contains( :TEST_NAME, "gp_11" ), "GP_11",
	Contains( :TEST_NAME, "gp_10" ), "GP_10",
	Contains( :TEST_NAME, "gp_1" ), "GP_1"
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But that's going to get really long and cumbersome, if you have a lot of GPs to check for.&amp;nbsp; Perhaps something like this would work for you.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Uppercase( Regex( :TEST_NAME, "io_(gp_\d+)", "\1", IGNORE CASE ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It look for "io_" followed by "gp_" and any number of digits.&amp;nbsp; "IGNORE CASE" is on so that "GP" will also satisfy the Regex.&amp;nbsp; If that's not the behavior you want, just leave off that part.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 11:49:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683739#M86936</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2023-10-04T11:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search specific name by IF</title>
      <link>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683796#M86941</link>
      <description>&lt;P&gt;I worked this code up and it seems to work, and works pretty fast&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("PIN_NAME", character);

theRows = dt &amp;lt;&amp;lt; get rows where( contains(:TEST_NAME,"_gp_"));

for each( {fndRow,i}, theRows,
	:PIN_NAME[fndRow] = word(1,uppercase(substr(:TEST_NAME[fndRow],contains(:TEST_NAME[fndRow],"_gp_")+1)),"[]")
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2023 13:58:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-specific-name-by-IF/m-p/683796#M86941</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-04T13:58:56Z</dc:date>
    </item>
  </channel>
</rss>

