<?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: Selecting a row from a string column if it contains a certain word in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765968#M94586</link>
    <description>&lt;P&gt;If you want to script it, you can do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = data table( "your datatable name" );
dt &amp;lt;&amp;lt; new column( "Value 3", Character );
for each row(
	dt:"Value 3"n = Char( If( Contains( :"Value 2"n, "ul/s" ) != 0, :Value 2, "" ) ); 
	dt:"Value 2"n = Char( If( Contains( :"Value 3"n, "ul/s" ) != 0, "", :Value 2 ) ); 
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Just substitute your actual table name in the first line.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you're trying to deal with mixed units and just want them to be comparable, you could try creating a new column with a formula like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Num( Regex( :Value 2, "[0-9]+" ) ) * 
If( Contains( :Value 2, "ul/s" ) != 0, 60 / 1000, 1 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That creates a column where the ul/s data is converted to ml/min by extracting the numerical value (using Regex) then applying a conversion factor depending on the string in the cell. The resulting column is all in ml/min&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 14:58:39 GMT</pubDate>
    <dc:creator>matth1</dc:creator>
    <dc:date>2024-06-14T14:58:39Z</dc:date>
    <item>
      <title>Selecting a row from a string column if it contains a certain word</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765950#M94581</link>
      <description>&lt;P&gt;I have a set of data called value 2 that has been entered as a character with the units at the end. Some of them are entered as ml/min and some as ul/s, and I'd like to separate the ones that are in ul/s into a new column entirely. What function should I use to select the rows that contain a certain subset of a string (I was going to select the ones that contain "ul/s" to enter them into a new column and then delete them from the value 2 column). I thought the "contain" function would do what I want but it doesn't seem to work so far.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="S_Boilermaker_0-1718373028548.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65223iB84B4573238BC25B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="S_Boilermaker_0-1718373028548.png" alt="S_Boilermaker_0-1718373028548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 13:54:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765950#M94581</guid>
      <dc:creator>S_Boilermaker</dc:creator>
      <dc:date>2024-06-14T13:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a row from a string column if it contains a certain word</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765965#M94583</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table () &amp;lt;&amp;lt; Select where (contains (:Value 2, "ul/s"))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This would be a way to do this using the contains() function. Another way to do this would be to use the Cols...Utilities...Text to Columns to separate the Value 2 column into multiple columns.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:41:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765965#M94583</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2024-06-14T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a row from a string column if it contains a certain word</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765968#M94586</link>
      <description>&lt;P&gt;If you want to script it, you can do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = data table( "your datatable name" );
dt &amp;lt;&amp;lt; new column( "Value 3", Character );
for each row(
	dt:"Value 3"n = Char( If( Contains( :"Value 2"n, "ul/s" ) != 0, :Value 2, "" ) ); 
	dt:"Value 2"n = Char( If( Contains( :"Value 3"n, "ul/s" ) != 0, "", :Value 2 ) ); 
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Just substitute your actual table name in the first line.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if you're trying to deal with mixed units and just want them to be comparable, you could try creating a new column with a formula like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Num( Regex( :Value 2, "[0-9]+" ) ) * 
If( Contains( :Value 2, "ul/s" ) != 0, 60 / 1000, 1 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That creates a column where the ul/s data is converted to ml/min by extracting the numerical value (using Regex) then applying a conversion factor depending on the string in the cell. The resulting column is all in ml/min&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:58:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-a-row-from-a-string-column-if-it-contains-a-certain/m-p/765968#M94586</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2024-06-14T14:58:39Z</dc:date>
    </item>
  </channel>
</rss>

