<?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 Code a new column by referencing text in second column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749413#M92986</link>
    <description>&lt;P&gt;How would I code a new column to fill each cell with a specific text based on the text in a second column? I have a "well" column with A1-A100. I need to create a second column with Treatment "A", for wells A1-A10, "B" for wells A11-A20, etc.&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 15:00:41 GMT</pubDate>
    <dc:creator>Mcc99</dc:creator>
    <dc:date>2024-04-24T15:00:41Z</dc:date>
    <item>
      <title>How to Code a new column by referencing text in second column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749413#M92986</link>
      <description>&lt;P&gt;How would I code a new column to fill each cell with a specific text based on the text in a second column? I have a "well" column with A1-A100. I need to create a second column with Treatment "A", for wells A1-A10, "B" for wells A11-A20, etc.&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 15:00:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749413#M92986</guid>
      <dc:creator>Mcc99</dc:creator>
      <dc:date>2024-04-24T15:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Code a new column by referencing text in second column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749431#M92989</link>
      <description>&lt;P&gt;You could use Recode platform&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1713971564000.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63646i74E3B5784FFB2DB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1713971564000.png" alt="jthi_1-1713971564000.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1713971571651.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63647i416388A553135B38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1713971571651.png" alt="jthi_2-1713971571651.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/recode-data-in-a-column.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/18.0/#page/jmp/recode-data-in-a-column.shtml&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 15:13:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749431#M92989</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-24T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Code a new column by referencing text in second column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749432#M92990</link>
      <description>&lt;P&gt;Is there a way to do it by chunks/groups in the recode platform though? Doing it by hand for 100+ samples and multiple datasets would take quite a bit of time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 15:17:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749432#M92990</guid>
      <dc:creator>Mcc99</dc:creator>
      <dc:date>2024-04-24T15:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Code a new column by referencing text in second column?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749435#M92991</link>
      <description>&lt;P&gt;Have you tried it? Recode platform will provide you with a script, such as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ocal({dt, col1},
	dt = Data Table("Untitled");
	dt &amp;lt;&amp;lt; Begin Data Update;
	col1 = dt &amp;lt;&amp;lt; New Column(dt:Column 1);
	col1 &amp;lt;&amp;lt; Set Name("Column 1 2");
	dt &amp;lt;&amp;lt; Move Selected Columns({col1}, after(dt:Column 1));
	For Each Row(
		dt,
		col1[] = Map Value(
			dt:Column 1,
			{"A10", "A1", "A2", "A1", "A3", "A1"},
			Unmatched(dt:Column 1)
		)
	);
	dt &amp;lt;&amp;lt; End Data Update;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can then modify that as needed and maybe use something like Workflow builder to make it work with different tables. Or you can script it (Get Data Table List() and For Each are good starting points for this).&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 15:21:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Code-a-new-column-by-referencing-text-in-second-column/m-p/749435#M92991</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-24T15:21:36Z</dc:date>
    </item>
  </channel>
</rss>

