<?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 concatenate rows in a given column to a string in JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-concatenate-rows-in-a-given-column-to-a-string-in-JSL/m-p/548277#M76515</link>
    <description>&lt;P&gt;Use Concat Items after you have the list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

x = {"a", "b", "c", "d"};

my_string = "'" || Concat Items(x, "','") ||"'";

Write(my_string); // 'a','b','c','d'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2022 16:59:56 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-09-22T16:59:56Z</dc:date>
    <item>
      <title>How to concatenate rows in a given column to a string in JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-concatenate-rows-in-a-given-column-to-a-string-in-JSL/m-p/548263#M76514</link>
      <description>&lt;P&gt;If I have a datatable &lt;EM&gt;dt&lt;/EM&gt; with one column &lt;EM&gt;col1&lt;/EM&gt; and several rows containing characters e.g.&amp;nbsp;&lt;EM&gt;a, b, c, d i.e. o&lt;/EM&gt;ne character per row.&amp;nbsp;How do I get a string of the form myString = 'a',&lt;SPAN&gt;'b', 'c', 'd' ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = Associative Array( dt:"col1" ) &amp;lt;&amp;lt; Get Keys;&amp;nbsp;show&amp;nbsp;(x);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it gives me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = {"a", "b", "c", "d"};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;whereas I would like to get a string&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myString = 'a', 'b', 'c', 'd'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to use further in my next line of code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any directions would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:54:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-concatenate-rows-in-a-given-column-to-a-string-in-JSL/m-p/548263#M76514</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-10T23:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to concatenate rows in a given column to a string in JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-concatenate-rows-in-a-given-column-to-a-string-in-JSL/m-p/548277#M76515</link>
      <description>&lt;P&gt;Use Concat Items after you have the list&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

x = {"a", "b", "c", "d"};

my_string = "'" || Concat Items(x, "','") ||"'";

Write(my_string); // 'a','b','c','d'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 16:59:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-concatenate-rows-in-a-given-column-to-a-string-in-JSL/m-p/548277#M76515</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-22T16:59:56Z</dc:date>
    </item>
  </channel>
</rss>

