<?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: I want to use a value in a numeric column to create a reference to the same column number in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905269#M106373</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/53914"&gt;@SpannerHead&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The normal addition of the value of i doesn't naturally apply in this case.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A very common issue:&lt;BR /&gt;a variable defined outside of the &lt;EM&gt;&lt;STRONG&gt;new column&lt;/STRONG&gt;&lt;/EM&gt; message - and used inside the &lt;EM&gt;&lt;STRONG&gt;new column&lt;/STRONG&gt;&lt;/EM&gt; message:&lt;/P&gt;
&lt;P&gt;-&amp;gt;&amp;nbsp;&lt;LI-MESSAGE title="Expression Handling in JMP: Tips and Trapdoors" uid="747728" url="https://community.jmp.com/t5/Discussions/Expression-Handling-in-JMP-Tips-and-Trapdoors/m-p/747728#U747728" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution: look up the variable and use the stored value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For each  ({i}, 1::5,
Eval(Eval Expr(New Column( "col_"||char(i),
	Character,
	Formula( Try( Char( Column( Expr(i) )[Row()] ) ) )
))));
	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;more robust:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For each  ({i}, 1::5,
Eval(Eval Expr(New Column( "col_"||char(i),
	Character,
	Formula( Try( Char( Expr(Name Expr(As Column( i )) )) ) )
))));&lt;/CODE&gt;&lt;/PRE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the first day I saw it in one of &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;'s posts, I admired the Name Expr(As Column(col)) and used it wherever I could.&lt;/P&gt;
&lt;P&gt;With the learning from&amp;nbsp;&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Using-numeric-objects-in-a-column-equation/m-p/903966/highlight/true#M106273" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Using-numeric-objects-in-a-column-equation/m-p/903966/highlight/true#M106273&lt;/A&gt; , I am really happy that this approach has helped me avoid many pitfalls.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;As Column(col)&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;Column(col)&lt;/FONT&gt; in a column formula? Too fragile!&lt;/P&gt;</description>
    <pubDate>Wed, 01 Oct 2025 07:50:29 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2025-10-01T07:50:29Z</dc:date>
    <item>
      <title>I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905189#M106366</link>
      <description>&lt;P&gt;I generated a column with integers that I now want to use to reference values in columns of the same number.&amp;nbsp; Column 9 contains the number indicating which column should be referenced by a formula in Column 10.&amp;nbsp; Below are several things that don't work.&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="SpannerHead_0-1759261892873.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83985i04142D28DEACAED7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_0-1759261892873.png" alt="SpannerHead_0-1759261892873.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="SpannerHead_1-1759261922186.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83986iB8A48FA9E361E887/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_1-1759261922186.png" alt="SpannerHead_1-1759261922186.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="SpannerHead_2-1759261949338.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83987i208275CC246C446A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_2-1759261949338.png" alt="SpannerHead_2-1759261949338.png" /&gt;&lt;/span&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>Tue, 30 Sep 2025 19:53:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905189#M106366</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-09-30T19:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905202#M106367</link>
      <description>&lt;P&gt;Which error message is displayed when you hover over the code with the red underline?&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;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "Column 9",
	Numeric,
	Set Values( [1, 2, 3, 4, 5] )
);

New Column( "Column 10",
	Expression,
	Formula( Try( Column( :Column 9 ) ) )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;no error:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_3-1759265404323.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83991i7F5E0D7067DEF8D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1759265404323.png" alt="hogi_3-1759265404323.png" /&gt;&lt;/span&gt;&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="hogi_1-1759264810963.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83989iC03504E00F9E12D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1759264810963.png" alt="hogi_1-1759264810963.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you don't want to retrieve the columns - but the &lt;U&gt;value&lt;/U&gt; stored in the columns,&amp;nbsp; use &lt;FONT face="courier new,courier"&gt;As column()&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;column():&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="robust column reference" uid="903135" url="https://community.jmp.com/t5/Discussions/robust-column-reference/m-p/903135#U903135" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... or add a row index to &lt;FONT face="courier new,courier"&gt;Column():&lt;BR /&gt;&amp;nbsp; Column(col)[row()]&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;or&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Column(col)[]&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "Column 10b",
	Character,
	Formula( Try( Char( Column( :Column 9 )[Row()] ) ) )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1759265089546.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83990iEE00F49708D4CA1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1759265089546.png" alt="hogi_2-1759265089546.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Besides that,&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;please ensure that the calculated value matches the modelling type of the column.&lt;BR /&gt;Columns 1 to 5 contain numbers and characters. This is why I added &lt;FONT face="courier new,courier"&gt;Char().&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;Column(.)&lt;/FONT&gt; will fail and the column formula will terminate. So please check if there are missing indices in &lt;FONT face="courier new,courier"&gt;Column 9&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 30 Sep 2025 20:59:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905202#M106367</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-09-30T20:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905205#M106368</link>
      <description>&lt;P&gt;hogi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks but those just give me the value already in Column 9, I want to look up the value of a different column as enumerated in Column 9 if that makes sense?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 20:52:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905205#M106368</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-09-30T20:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905207#M106369</link>
      <description>&lt;P&gt;combining both approaches, let's retrieve the columns in the first step - and the values in the second step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "column",
	Expression,
	Formula( Try( Column( Row() ), . ) ),
);
New Column( "value",
	Character,
	Formula( Try( Char( :column[Row()][Row()] ), "" ) ),
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;why&amp;nbsp;&lt;CODE class=" language-jsl"&gt;:column[Row()][Row()]?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;:column&lt;/FONT&gt; is column #9,&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;:column[row()]&lt;/FONT&gt; is the entry in the specific row &lt;U&gt;of this column&lt;/U&gt;, e.g. &lt;FONT face="courier new,courier"&gt;Column ("sex")&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;and&amp;nbsp;&lt;FONT face="courier new,courier"&gt;:column[row()][row()]&lt;/FONT&gt; is&amp;nbsp; the entry in the specific row of e.g. &lt;FONT face="courier new,courier"&gt;Column ("sex")&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1759266391575.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/83993i3CB837F34BD7A5D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1759266391575.png" alt="hogi_0-1759266391575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 21:09:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905207#M106369</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-09-30T21:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905212#M106370</link>
      <description>&lt;P&gt;hogi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great addition!&amp;nbsp; No good deed and all that.............&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I now need to iteratively operate on every column relative to the maximum value stored in Column 9.&amp;nbsp; The normal addition of the value of i doesn't naturally apply in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear symbols();

lim = Col Max(Column(8));

For (i=1, i&amp;lt;=lim, i++,

New Column( "Column 10b",
	Character,
	Formula( Try( Char( Column( :Column 9 )[Row()] ) ) )
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Sep 2025 22:09:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905212#M106370</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-09-30T22:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a value in a numeric column to create a reference to the same column number</title>
      <link>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905269#M106373</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/53914"&gt;@SpannerHead&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The normal addition of the value of i doesn't naturally apply in this case.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A very common issue:&lt;BR /&gt;a variable defined outside of the &lt;EM&gt;&lt;STRONG&gt;new column&lt;/STRONG&gt;&lt;/EM&gt; message - and used inside the &lt;EM&gt;&lt;STRONG&gt;new column&lt;/STRONG&gt;&lt;/EM&gt; message:&lt;/P&gt;
&lt;P&gt;-&amp;gt;&amp;nbsp;&lt;LI-MESSAGE title="Expression Handling in JMP: Tips and Trapdoors" uid="747728" url="https://community.jmp.com/t5/Discussions/Expression-Handling-in-JMP-Tips-and-Trapdoors/m-p/747728#U747728" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution: look up the variable and use the stored value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For each  ({i}, 1::5,
Eval(Eval Expr(New Column( "col_"||char(i),
	Character,
	Formula( Try( Char( Column( Expr(i) )[Row()] ) ) )
))));
	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;more robust:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For each  ({i}, 1::5,
Eval(Eval Expr(New Column( "col_"||char(i),
	Character,
	Formula( Try( Char( Expr(Name Expr(As Column( i )) )) ) )
))));&lt;/CODE&gt;&lt;/PRE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the first day I saw it in one of &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;'s posts, I admired the Name Expr(As Column(col)) and used it wherever I could.&lt;/P&gt;
&lt;P&gt;With the learning from&amp;nbsp;&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Using-numeric-objects-in-a-column-equation/m-p/903966/highlight/true#M106273" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Using-numeric-objects-in-a-column-equation/m-p/903966/highlight/true#M106273&lt;/A&gt; , I am really happy that this approach has helped me avoid many pitfalls.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;As Column(col)&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;Column(col)&lt;/FONT&gt; in a column formula? Too fragile!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Oct 2025 07:50:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/I-want-to-use-a-value-in-a-numeric-column-to-create-a-reference/m-p/905269#M106373</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-10-01T07:50:29Z</dc:date>
    </item>
  </channel>
</rss>

