<?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: Getting formula from column in a pretty format in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/387146#M63739</link>
    <description>The main limitation is that I might have ":" in the name that is not due to the formula.</description>
    <pubDate>Thu, 20 May 2021 09:13:34 GMT</pubDate>
    <dc:creator>FN</dc:creator>
    <dc:date>2021-05-20T09:13:34Z</dc:date>
    <item>
      <title>Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/381975#M63255</link>
      <description>&lt;P&gt;I would like to obtain the formula of each column in a more readable format (also called pretty format).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the example below I will like to obtain "&lt;CODE class=" language-jsl"&gt;height / weight&lt;/CODE&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simply removing ":" will not work as columns can have such character.&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" );
col = New Column( "Ratio" );
col &amp;lt;&amp;lt; Set Formula( :height / :weight );
col &amp;lt;&amp;lt; Eval Formula;
result = col &amp;lt;&amp;lt; Get Formula;
Show( result );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;// result = :height / :weight;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;//&amp;nbsp;desired_result&amp;nbsp;=&amp;nbsp;"height / weight";&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:46:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/381975#M63255</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2023-06-09T19:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382020#M63261</link>
      <description>&lt;P&gt;Here is an example on how to do that&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="formula.PNG" style="width: 208px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/32551i5C420B4B50748495/image-size/large?v=v2&amp;amp;px=999" role="button" title="formula.PNG" alt="formula.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");
dt&amp;lt;&amp;lt; new column("Example", formula(sqrt(:Height/:Age+:Weight*:Height)));

new window("pretty", expr as picture(dt:Example &amp;lt;&amp;lt; get formula));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:08:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382020#M63261</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-05-03T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382021#M63262</link>
      <description>&lt;P&gt;JSL syntax requires colons to refer to columns, but there are other options such as what I show here.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; New Column( "Ratio", Set Formula( ascolumn("height") / ascolumn("weight")));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Not sure if it's more pretty though :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:09:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382021#M63262</guid>
      <dc:creator>Mark_Zwald</dc:creator>
      <dc:date>2021-05-03T20:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382025#M63264</link>
      <description>How would I obtain a string that reads the following in your example?&lt;BR /&gt;"sqrt(Height/Age + Weight*Height))"&lt;BR /&gt;&lt;BR /&gt;Is there any 'expr as formula'?</description>
      <pubDate>Mon, 03 May 2021 20:15:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382025#M63264</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2021-05-03T20:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382053#M63268</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA\big class.jmp");
dt&amp;lt;&amp;lt; new column("Example", formula(sqrt(:Height/:Age+:Weight*:Height)));

charFormula = char(dt:Example &amp;lt;&amp;lt; get formula);
substitute into(charFormula,
	expr(":"), expr(" ")
);&lt;BR /&gt;show(charFormula);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 May 2021 20:43:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/382053#M63268</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-05-03T20:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting formula from column in a pretty format</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/387146#M63739</link>
      <description>The main limitation is that I might have ":" in the name that is not due to the formula.</description>
      <pubDate>Thu, 20 May 2021 09:13:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-formula-from-column-in-a-pretty-format/m-p/387146#M63739</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2021-05-20T09:13:34Z</dc:date>
    </item>
  </channel>
</rss>

