<?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: accessing current column name in formula for that column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237646#M46926</link>
    <description>&lt;P&gt;the data type of the column in question is numeric and set as such with no changes intended&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to populate the column with a value which is computed from a value contained in the column name itself, more specifically, the numerical value of the 1st Word in the column name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it could be the case that JMP cannot identify to a formula the column in which the formula exists&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if that is the case, this question is a non-starter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 15:28:43 GMT</pubDate>
    <dc:creator>galactus3000</dc:creator>
    <dc:date>2019-12-06T15:28:43Z</dc:date>
    <item>
      <title>accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237601#M46916</link>
      <description>&lt;P&gt;how do I reference the column name of column containing formula in the formula?&lt;/P&gt;&lt;P&gt;for instance, if column name is "&lt;EM&gt;&lt;STRONG&gt;3 bears&lt;/STRONG&gt;&lt;/EM&gt;" i want to fill that column (or any column) with a formula like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="terminal,monaco"&gt;Num(Word(1,current column name()))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;such that the column will be filled with the number 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and upon renaming the column to "&lt;EM&gt;&lt;STRONG&gt;16 dogs&lt;/STRONG&gt;&lt;/EM&gt;" it would fill the column with the number 16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the intended application for this feature is less mundane than this ... the extracted number will be incorporated into a non-simple column formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:01:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237601#M46916</guid>
      <dc:creator>galactus3000</dc:creator>
      <dc:date>2019-12-06T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237635#M46924</link>
      <description>&lt;P&gt;I don't think a column formula will do what you want. You are changing the contents upon which the formula depends and the data type. You have to create a new data column if you want to use a column formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could use a short script to iterate over all the columns or a list of selected columns and then change the attribute and value. The original data column would be transformed or changed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear what you want to do overall, but can your non-simple column formula extract the desired number from the dependent column name?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237635#M46924</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-06T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237646#M46926</link>
      <description>&lt;P&gt;the data type of the column in question is numeric and set as such with no changes intended&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to populate the column with a value which is computed from a value contained in the column name itself, more specifically, the numerical value of the 1st Word in the column name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it could be the case that JMP cannot identify to a formula the column in which the formula exists&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if that is the case, this question is a non-starter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:28:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237646#M46926</guid>
      <dc:creator>galactus3000</dc:creator>
      <dc:date>2019-12-06T15:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237648#M46927</link>
      <description>&lt;P&gt;A JSL script(not a formula) should be able to do what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:37:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237648#M46927</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-12-06T15:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237651#M46929</link>
      <description>&lt;P&gt;I know what you want to do. I am asking if you really need to do it this way. Instead of populating the entire column with the same value to be used in another formula, the final formula could extract the value, too. Eliminate the need for the intermediate value.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:41:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237651#M46929</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-06T15:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237652#M46930</link>
      <description>&lt;P&gt;If each of the columns to be changed is already set to numeric data, then this column formula should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Num( Word( 1, name &amp;lt;&amp;lt; Get Name ) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:43:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237652#M46930</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-06T15:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237660#M46932</link>
      <description>&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just tried entering this/your formula on a column named "43 birds"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token function"&gt;Num&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Word&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; name &lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token messages"&gt; Get Name &lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and instead of filling column with 43, just received this error&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Name Unresolved: name 1 times At rows: 2 Operation: name, name/*###*/&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;in an error box entitled "Column 43 birds Formula Interrupted"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:58:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237660#M46932</guid>
      <dc:creator>galactus3000</dc:creator>
      <dc:date>2019-12-06T15:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237670#M46933</link>
      <description>&lt;P&gt;Assuming you're not changing the position of the Column, you could use it's position.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Num( Word( 1, Column(1) &amp;lt;&amp;lt; Get Name ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;But I'd agree that you probably don't need to have this intermediary step.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 17:20:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237670#M46933</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2019-12-06T17:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237672#M46934</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7154"&gt;@galactus3000&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I agree with others that there is probably a more efficient way of solving whatever problem you have than using a self-referencing formula to extract the numeric part of the column name. That said, I thought it was an interesting challenge! There isn't (so far as I know) a way to self-reference the originating column via jsl (the way we can use Row(), for example), but we can take advantage of the fact that jmp will automatically update references to a column in scripts and formulas when you change a column name. This means we can reference the column itself in an absolute way, and when you change the name and rerun formulas (important) jmp will update all the rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specifically, here's the formula I would use:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-12-06 at 12.17.50 PM.png" style="width: 654px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/20547i6C9671B253F8B16C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-12-06 at 12.17.50 PM.png" alt="Screen Shot 2019-12-06 at 12.17.50 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Num( Word( 1, :Name( "16 dogs" ) &amp;lt;&amp;lt; get name ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and here is what it looks like upon a change:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="update.gif" style="width: 606px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/20548iB0C148AF89896D1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="update.gif" alt="update.gif" /&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;I hope this helps!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 17:21:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237672#M46934</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-12-06T17:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: accessing current column name in formula for that column</title>
      <link>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237676#M46937</link>
      <description>&lt;P&gt;this is perfect!&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 17:39:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/accessing-current-column-name-in-formula-for-that-column/m-p/237676#M46937</guid>
      <dc:creator>galactus3000</dc:creator>
      <dc:date>2019-12-06T17:39:05Z</dc:date>
    </item>
  </channel>
</rss>

