<?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: Concat columns and adding to each loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657964#M84730</link>
    <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works on this data sample, but if my data have another columns which is not relate to the columns that i would like to concat, for example only photo and stage column need to concat, but&amp;nbsp; DRY ETCH column not, like the example data 2 at below, how could I fix your code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 06:12:28 GMT</pubDate>
    <dc:creator>SING</dc:creator>
    <dc:date>2023-07-13T06:12:28Z</dc:date>
    <item>
      <title>Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657537#M84683</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If there have a data table like below, how can i using scripts to concat equipmentId and stage_num to new columns with each step?&lt;/P&gt;&lt;P&gt;Thanks.&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="SING_1-1689142700539.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54589i5EDBF4D5ED2DCB47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SING_1-1689142700539.png" alt="SING_1-1689142700539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 06:19:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657537#M84683</guid>
      <dc:creator>SING</dc:creator>
      <dc:date>2023-07-12T06:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657546#M84684</link>
      <description>&lt;P&gt;First loop over your data and create the pairs of interest (if they are always next to each other this might be a bit easier). Then loop over the pairs while creating new columns. If you could provide example of your data it would be easier to provide an example scripts.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 06:26:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657546#M84684</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-12T06:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657552#M84685</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;Here's the data sample.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 06:42:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657552#M84685</guid>
      <dc:creator>SING</dc:creator>
      <dc:date>2023-07-12T06:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657564#M84687</link>
      <description>&lt;P&gt;One example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/example data.jmp");
dt &amp;lt;&amp;lt; Clear Select;
// as all columns are interest to use and they are always in pairs
// we can loop over every other column
col_list = dt &amp;lt;&amp;lt; Get Column Names("String");
first_col_indices = 1::N Items(col_list)::2;

new_col_list = {};
For Each({first_col_idx}, first_col_indices,
	first_col_name = Column(dt, first_col_idx) &amp;lt;&amp;lt; get name;
	new_col_name = Word(1, first_col_name, ":");
	Insert Into(new_col_list, dt &amp;lt;&amp;lt; New Column(new_col_name, Character, Nominal, &amp;lt;&amp;lt; Set Each Value(
		Column(dt, first_col_idx)[Row()] ||"_"||Column(dt, first_col_idx + 1)[Row()]
	)));
);

/*
For Each({new_col, idx}, new_col_list,
	dt &amp;lt;&amp;lt; Move Selected Columns(new_col, After(Column(dt, first_col_indices[idx] + 1 + idx - 1)));
);
*/&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jul 2023 07:33:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657564#M84687</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-12T07:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657964#M84730</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works on this data sample, but if my data have another columns which is not relate to the columns that i would like to concat, for example only photo and stage column need to concat, but&amp;nbsp; DRY ETCH column not, like the example data 2 at below, how could I fix your code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 06:12:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657964#M84730</guid>
      <dc:creator>SING</dc:creator>
      <dc:date>2023-07-13T06:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Concat columns and adding to each loop</title>
      <link>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657972#M84731</link>
      <description>&lt;P&gt;Are the columns always pairs or is it possible that other part of pair is missing? And if it is possible, how should that situation be handled? Also, are columns always in "correct" order?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 07:09:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concat-columns-and-adding-to-each-loop/m-p/657972#M84731</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-13T07:09:37Z</dc:date>
    </item>
  </channel>
</rss>

