<?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 how to reference a Transform Column? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/676114#M86286</link>
    <description>&lt;P&gt;When I generate a Transform Column by sending &lt;STRONG&gt;Transform Column&lt;/STRONG&gt; to a &lt;EM&gt;data table&lt;/EM&gt;, I get the a reference to the Column as a return value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I generate a Transform Column by sending &lt;STRONG&gt;Transform Column&lt;/STRONG&gt; to a GraphBuilder Object, I get a refernce to a Graph Builder as a return value - no reference to the column :(&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So asking this "Column" col2 for it's name doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where can I find more information about referencing transform columns?&lt;BR /&gt;e.g. how to get a solid reference to the column (something like :col2).&lt;BR /&gt;&lt;BR /&gt;How good that one doesn't have to reference the column by a symbol. Seems to be OK to use the column name - even OK without quotation marks (!?)&lt;BR /&gt;&lt;BR /&gt;&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" );
gb = dt &amp;lt;&amp;lt; Graph Builder();

col1 = dt &amp;lt;&amp;lt; Transform Column ("col1Name", Formula(1/:height));
col2 = gb &amp;lt;&amp;lt; Transform Column ("col2Name", Formula(1/:height));

Show(Name Expr(col1));
Show(Name Expr(col2));

gb &amp;lt;&amp;lt; Variables(X(:height), Y (col1));


// doesnt work :(
gb &amp;lt;&amp;lt; Variables(X(:height), Y (col2)); 

gb &amp;lt;&amp;lt; Variables(X(:height), Y ("col2Name")); //works

gb &amp;lt;&amp;lt; Variables(X(:height), Y (col2Name));  // works (!?)


Show(col1 &amp;lt;&amp;lt; get name());
Show(col2 &amp;lt;&amp;lt; get name());

Show(Column(dt, "col1Name"));
Try(Show(Column(dt, "col2Name")), "dt doesn't know the column");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 08:51:55 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-10-04T08:51:55Z</dc:date>
    <item>
      <title>how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/676114#M86286</link>
      <description>&lt;P&gt;When I generate a Transform Column by sending &lt;STRONG&gt;Transform Column&lt;/STRONG&gt; to a &lt;EM&gt;data table&lt;/EM&gt;, I get the a reference to the Column as a return value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I generate a Transform Column by sending &lt;STRONG&gt;Transform Column&lt;/STRONG&gt; to a GraphBuilder Object, I get a refernce to a Graph Builder as a return value - no reference to the column :(&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So asking this "Column" col2 for it's name doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where can I find more information about referencing transform columns?&lt;BR /&gt;e.g. how to get a solid reference to the column (something like :col2).&lt;BR /&gt;&lt;BR /&gt;How good that one doesn't have to reference the column by a symbol. Seems to be OK to use the column name - even OK without quotation marks (!?)&lt;BR /&gt;&lt;BR /&gt;&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" );
gb = dt &amp;lt;&amp;lt; Graph Builder();

col1 = dt &amp;lt;&amp;lt; Transform Column ("col1Name", Formula(1/:height));
col2 = gb &amp;lt;&amp;lt; Transform Column ("col2Name", Formula(1/:height));

Show(Name Expr(col1));
Show(Name Expr(col2));

gb &amp;lt;&amp;lt; Variables(X(:height), Y (col1));


// doesnt work :(
gb &amp;lt;&amp;lt; Variables(X(:height), Y (col2)); 

gb &amp;lt;&amp;lt; Variables(X(:height), Y ("col2Name")); //works

gb &amp;lt;&amp;lt; Variables(X(:height), Y (col2Name));  // works (!?)


Show(col1 &amp;lt;&amp;lt; get name());
Show(col2 &amp;lt;&amp;lt; get name());

Show(Column(dt, "col1Name"));
Try(Show(Column(dt, "col2Name")), "dt doesn't know the column");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 08:51:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/676114#M86286</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-04T08:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/690779#M87671</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Jmp Support: TS-00056243&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;you cannot reference a transform column created in the platform context.&amp;nbsp; This means you cannot remove it nor replace it.&amp;nbsp; If you want to have a reference to a transform column, you must create the column in the data table context.&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if you want to change or rename a transform column (in a platform), you have to do it via the GUI - not via JSL.&lt;/P&gt;&lt;P&gt;(# &lt;LI-MESSAGE title="What is not possible via JSL?" uid="690547" url="https://community.jmp.com/t5/Discussions/What-is-not-possible-via-JSL/m-p/690547#U690547" 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;Wish added:&lt;BR /&gt;&lt;LI-MESSAGE title="improvements for Transform Column" uid="684044" url="https://community.jmp.com/t5/JMP-Wish-List/improvements-for-Transform-Column/m-p/684044#U684044" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea 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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:06:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/690779#M87671</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-26T09:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691026#M87697</link>
      <description>&lt;P&gt;In the meantime ...&lt;BR /&gt;the only solution seems to be to generate the transform column &lt;STRONG&gt;with table scope&lt;/STRONG&gt;&amp;nbsp;, to replace it every time the selection in the local data filter is changed - and to put it back into the Plot every time it gets kicked out.&lt;BR /&gt;So it's more like &lt;FONT face="courier new,courier"&gt;Set each value()&lt;/FONT&gt; than &lt;FONT face="courier new,courier"&gt;Formula().&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand: it works - just in case you need a plot with a Transform column formula which "automatically" adjusts to changes of the Local Data Filter&lt;BR /&gt;&lt;BR /&gt;To illustrate the idea, I generated a GraphBuilder plot which counts the selected M &amp;amp; F.&lt;/P&gt;&lt;P&gt;Imagine how powerful this approach can be ...&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" );

colName = "count_"||Char(Random Integer(100000));

Eval(Eval Expr(gb = dt &amp;lt;&amp;lt; Graph Builder(
Transform Column(
		Expr(colName),
		"Table Scope", // essential because otherwise the replace(1) won't work
		Formula( Col Number( 1,:sex )  )
	),
		Variables( X( :sex ), Y( Expr(colName) ) ),
	Elements( Bar( X, Y ) ),
	Local Data Filter(Add Filter(columns( :sex, :name )))
)));

ldf = (Current Report()["Local Data Filter"] &amp;lt;&amp;lt; get scriptable object);

myRowsOld=[];
fch = Function( {x},
	myRows = ldf &amp;lt;&amp;lt; Get Filtered Rows;
	If( not(nrows(myRows)==nrows(myRowsOld))| not(asList(myRows) == asList(myRowsOld)),
		myRowsOld = myRows;	
		Eval(
			Substitute(
					Expr(
						dt &amp;lt;&amp;lt; Transform Column(
							_colName_,
							//"Table Scope", // gb doesn't understand replace(1) -&amp;gt; we have to talk to the table -&amp;gt; no Table Scope needed
							Formula(
								Col Number( 1, :sex, Contains( _myRows_, Row() ) &amp;gt; 0 )
							),
							Replace( 1 )
						)
					),
				Expr( _myRows_ ), myRows, Expr(_colName_), colName
			)
		);
		gb &amp;lt;&amp;lt; add variable({ Column(colName), Role("Y") }); //replacing the transform column removes it automatically from the graph
		dt &amp;lt;&amp;lt; Show Transforms();
	);
);

current report() &amp;lt;&amp;lt; on close(dt &amp;lt;&amp;lt; delete column(colname));

rs = ldf &amp;lt;&amp;lt; Make Filter Change Handler( fch );

dt &amp;lt;&amp;lt; Show Transforms();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 10:28:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691026#M87697</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-28T10:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691035#M87699</link>
      <description>&lt;P&gt;Benefit of this approach compared to generating a Formula column:&lt;BR /&gt;- The Transform column is just temporary, it won't be saved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;comparable:&lt;BR /&gt;- with the need to generate the transform column with table scope, it is also visible from other platforms&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;worse:&lt;/P&gt;&lt;P&gt;- the code got quite lengthy compared to the approach with a real formula column:&amp;nbsp;&lt;LI-MESSAGE title="Re: Transform Column: Bug with excluded rows" uid="676802" url="https://community.jmp.com/t5/Discussions/Transform-Column-Bug-with-excluded-rows/m-p/676802#U676802" 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;For a real formula column, it's enough to update the input list and then the formula will re-evaluate.&lt;BR /&gt;With the transform column it's like deleting the column and generating it again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For Transform columns, one can use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; reset transform()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to refresh the values.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;but surprisingly, the report doesn't notice the update and shows the old values - even after removing and adding the variable:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698351999960.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58022i317F6D0BC9CFBBC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698351999960.png" alt="hogi_0-1698351999960.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;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// transform column with table scope
global:a = 2;
dt &amp;lt;&amp;lt; Transform Column(
	"sqrt[height]",
	Formula( global:a * Sqrt( :height ) ),
	Replace(1);
);
Show( :"sqrt[height]"n[1] );

gb = Graph Builder(
	Variables( X( :height ), Y( :"sqrt[height]"n ) )
);

global:a = 30;

// clear the cache
:"sqrt[height]"n &amp;lt;&amp;lt; Reset Transform();

// new values
Show( :"sqrt[height]"n[1] );
wait(2);

// try to update the GraphBuilder
gb &amp;lt;&amp;lt; remove variable(2);
wait(2);

// unfortunately, still the old values !?!?!
gb  &amp;lt;&amp;lt; add variable({:"sqrt[height]"n, Role("Y")});

// a new GraphBuilder starts with updated values !
gbnew = Graph Builder(
	Variables( X( :height ), Y( :"sqrt[height]"n ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A newly generated graph builder report (&lt;FONT face="courier new,courier"&gt;gbnew&lt;/FONT&gt;) shows the new values.&lt;BR /&gt;-&amp;gt; Seems that the first graph builder uses some stored values which are not refreshed when the Transform Column gets refreshed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 09:15:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691035#M87699</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-29T09:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691608#M87735</link>
      <description>&lt;P&gt;Does this count as a solution?&lt;BR /&gt;hm ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jmp support [TS-00056243] is very clear:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;The short answer is there is not a way to have the transform column change with a change to the Local Data Filter&lt;BR /&gt;[one of us] has been working with others in tech support and development on the issue, and no solution is available.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 09:16:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/691608#M87735</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-29T09:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to reference a Transform Column?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/824681#M100440</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;not a way to have the transform column change with a change to the Local Data Filter&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;not yet ...&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2024 16:43:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-reference-a-Transform-Column/m-p/824681#M100440</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-28T16:43:33Z</dc:date>
    </item>
  </channel>
</rss>

