<?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: Creating a column with concatenated values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697034#M88223</link>
    <description>&lt;P&gt;Sorry for the confusion.&lt;BR /&gt;The new column suppose to look like that:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;STI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&amp;lt;PL&amp;lt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Sat, 11 Nov 2023 15:28:10 GMT</pubDate>
    <dc:creator>Stas</dc:creator>
    <dc:date>2023-11-11T15:28:10Z</dc:date>
    <item>
      <title>Creating a column with concatenated values</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/696995#M88220</link>
      <description>&lt;P&gt;Hey all,&amp;nbsp;&lt;BR /&gt;I'm trying to create new column which will include to rows/values. The first one is a variable and the second one is a concatenated expression of two variables.&lt;/P&gt;&lt;P&gt;No matter what I tried, I get an empty cell in the concatenated value. Can you please advise?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of what I tried:&lt;/P&gt;&lt;P&gt;stiop=10; stiPLL=20; stiPHL=30;&lt;BR /&gt;STIarg={char(stiop),char(stiPLL) ||"&amp;lt;PL&amp;lt;"|| char(stiPHL)};&lt;/P&gt;&lt;P&gt;Operations&amp;lt;&amp;lt;&lt;BR /&gt;New Column( "STI", "nominal", Set Values( STIarg ) );&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 08:48:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/696995#M88220</guid>
      <dc:creator>Stas</dc:creator>
      <dc:date>2023-11-11T08:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a column with concatenated values</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697020#M88221</link>
      <description>&lt;P&gt;I am confused.&amp;nbsp; Can you please provide an example of what you expect your new column will look like?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Nov 2023 12:33:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697020#M88221</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-11T12:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a column with concatenated values</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697034#M88223</link>
      <description>&lt;P&gt;Sorry for the confusion.&lt;BR /&gt;The new column suppose to look like that:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;STI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20&amp;lt;PL&amp;lt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 11 Nov 2023 15:28:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697034#M88223</guid>
      <dc:creator>Stas</dc:creator>
      <dc:date>2023-11-11T15:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a column with concatenated values</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697036#M88224</link>
      <description>&lt;P&gt;The action of JMP is to loop one row at a time through the data table when running a Formula() or Set Each Value().And by default, it will only be outputting to the current row.&amp;nbsp; There are different ways to solve your issue, but this is the way I would do it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1699718550434.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58573i6473B65A84C7E912/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1699718550434.png" alt="txnelson_0-1699718550434.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Operations = Open( "$SAMPLE_DATA/Big Class.jmp" );

stiop = 10;
stiPLL = 20;
stiPHL = 30;
STIarg = {Char( stiop ), Char( stiPLL ) || "&amp;lt;PL&amp;lt;" || Char( stiPHL )};

Operations &amp;lt;&amp;lt; New Column( "STI",
	character,
	Set each Value(
		If( Mod( Row(), 2 ) != 0,
			:STI = Eval( STIarg[1] ),
			:STI = Eval( STIarg[2] )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or if you want it to only have the 2 rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1699719368604.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58574iD1E9BAD8DB13FE6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1699719368604.png" alt="txnelson_0-1699719368604.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Operations = Open( "$SAMPLE_DATA/Big Class.jmp" );

stiop = 10;
stiPLL = 20;
stiPHL = 30;
STIarg = {};
Insert into(STIarg, char(stiop));
Insert into(STIarg,Char( stiPLL ) || "&amp;lt;PL&amp;lt;" || Char( stiPHL ) );

Operations &amp;lt;&amp;lt; New Column( "STI",
	character, set values(STIarg));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Nov 2023 16:16:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697036#M88224</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-11T16:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a column with concatenated values</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697196#M88266</link>
      <description>&lt;P&gt;As an alternative, you could use &lt;FONT face="courier new,courier"&gt;EvalList&lt;/FONT&gt; to evaluate the list entries&amp;nbsp;&lt;STRONG&gt;before&lt;/STRONG&gt; they get used via &lt;FONT face="courier new,courier"&gt;Set Values&lt;/FONT&gt;..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please also note that you have to specify the data type: &lt;FONT face="courier new,courier"&gt;Character&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For numeric columns, even for ones with modeling type: &lt;FONT face="courier new,courier"&gt;Nominal&lt;/FONT&gt;&amp;nbsp;the value will be casted -&amp;gt; &lt;FONT face="courier new,courier"&gt;Numeric:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"10" will survive as 10, but the second value will get lost.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;stiop=10; stiPLL=20; stiPHL=30;
STIarg=EvalList({char(stiop),char(stiPLL) ||"&amp;lt;PL&amp;lt;"|| char(stiPHL)});

New Column( "STI",Character, Set Values( STIarg ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Nov 2023 14:40:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-column-with-concatenated-values/m-p/697196#M88266</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-11-12T14:40:21Z</dc:date>
    </item>
  </channel>
</rss>

