<?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: Concatenate columns with empty cells in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/390141#M64030</link>
    <description>&lt;P&gt;Hi, here is yet another formula.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Concat Items( Words( :Name || "," || :Age || "," || &lt;SPAN class="lia-emoticons-autosuggestions"&gt;&lt;SPAN class="lia-emoticons-search-term"&gt;:Sex&lt;/SPAN&gt;&lt;/SPAN&gt;, "," ), "_" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jun 2021 16:15:39 GMT</pubDate>
    <dc:creator>brady_brady</dc:creator>
    <dc:date>2021-06-03T16:15:39Z</dc:date>
    <item>
      <title>Concatenate columns with empty cells</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389866#M64003</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a dataset with different columns that have some empty random cells (like the example in the table below). I would like to concatenate the values of the different columns and use the "_" to separate the content of the cells only if the content of the cells is different from empty value (as in column "concat" below). Does anyone have a suggestion on a how to to this operation in a smart way?&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Sex&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Concat&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Mads&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;31&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Mads_31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;M&lt;/TD&gt;&lt;TD&gt;M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;John_25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Julia&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;Julia_19_F&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:30:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389866#M64003</guid>
      <dc:creator>JMP_fan</dc:creator>
      <dc:date>2023-06-10T23:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate columns with empty cells</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389901#M64006</link>
      <description>&lt;P&gt;You should be able to use a simple function in a new column Concat:&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="formula.PNG" style="width: 939px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33195i11D2BA39F70D5F0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="formula.PNG" alt="formula.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 14:42:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389901#M64006</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-06-02T14:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate columns with empty cells</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389902#M64007</link>
      <description>&lt;P&gt;Here is one way of writing the formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colList = {"Column 1", "Column 2", "Column 3"};
x = "";
For( i = 1, i &amp;lt;= N Items( colList ), i++,
	If( As Column( colList[i] ) != "",
		If( x != "", x = x || "_" );
		x = x || Char( As Column( colList[i] ) );
	)
);
Trim( x );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Jun 2021 14:48:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/389902#M64007</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-06-02T14:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate columns with empty cells</title>
      <link>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/390141#M64030</link>
      <description>&lt;P&gt;Hi, here is yet another formula.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Concat Items( Words( :Name || "," || :Age || "," || &lt;SPAN class="lia-emoticons-autosuggestions"&gt;&lt;SPAN class="lia-emoticons-search-term"&gt;:Sex&lt;/SPAN&gt;&lt;/SPAN&gt;, "," ), "_" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 16:15:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Concatenate-columns-with-empty-cells/m-p/390141#M64030</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-06-03T16:15:39Z</dc:date>
    </item>
  </channel>
</rss>

