<?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: JSL: help properly referencing a data table column for Distribution platform in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687784#M87338</link>
    <description>&lt;P&gt;You can use fun and confusing syntax like 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");

col1 = "height";
col2 = "weight";

dist = dt &amp;lt;&amp;lt; Distribution(
	Continuous Distribution(Column(Column(dt, col1)), Quantiles(0)),
	Continuous Distribution(Column(Column(dt, col2)), Quantiles(0))
);	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or 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");

col1 = "height";
col2 = "weight";
Eval(EvalExpr(
	dist = dt &amp;lt;&amp;lt; Distribution(
		Continuous Distribution(Column(Eval(col1)), Quantiles(0)),
		Continuous Distribution(Column(Eval(col2)), Quantiles(0))
	);
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Eval(EvalExpr()) is unnecessary in the above script. I left it there by accident when testing out different options (was playing around with Name Expr(AsColumn())).&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 08:07:19 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-10-17T08:07:19Z</dc:date>
    <item>
      <title>JSL: help properly referencing a data table column for Distribution platform</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687763#M87336</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm noticing that the Distribution platform doesn't seem to accept column references in the same way that Graph Builder does, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have code where I am referencing different columns within a data table using the Column(dtname, number) format. For example, this is a bit of code where I do it with GB and it works just fine:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 500, 350 ),
	Show Control Panel( 0 ),
	Variables(
		X( Column( dt_results, NNxcol ) ),
		Y( Column( dt_results, NNYCol + N Items( NNXList ) ) ),
		Y( Column( dt_results, NNYCol + 1 + N Items( NNXlist ) ), Position( 1 ) ),
		Y( Column( dt_results, NNYCol + 2 + N Items( NNXList ) ) )
	),
	Elements(
		Position( 1, 1 ),
		Points( X, Y( 1 ), Y( 2 ), Legend( 8 ) ),
		Smoother( X, Y( 1 ), Y( 2 ), Legend( 9 ) )
	),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 10 ) ), Smoother( X, Y, Legend( 11 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( NNYList[NNYCol] || " Stats vs. " || NNXList[NNxcol] )}
		),
		Dispatch( {}, "Y title", TextEditBox, {Set Text( NNYList[NNYCol] || " Train &amp;amp; Valid" )} )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; However, when I try to do something similar in the Distribution platform, nothing happens, and I think it's because the Continuous Distribution() call doesn't seem to like referencing a column this way. It seems to like referencing the column as Column(column name).&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Distribution(
	Continuous Distribution( Column( dt_results, NNYCol + NNcolshift ), Quantiles( 0 ) ),
	Continuous Distribution( Column( dt_results, NNYCol + 1 + NNcolshift ), Quantiles( 0 ) ),
	Continuous Distribution( Column( dt_results, NNYCol + 2 + NNcolshift ), Quantiles( 0 ) )
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; I want to use variables when I call the platform because it's more flexible in the code rather than hard-coding in the column name itself. Any idea why the Distribution platform behaves differently or how to correctly reference the column so I get the intended output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts/comments are appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 20:17:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687763#M87336</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-10-16T20:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: help properly referencing a data table column for Distribution platform</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687774#M87337</link>
      <description>&lt;P&gt;You can just send a message to your data table and remove the table reference in the Column() function.&amp;nbsp; As for why it doesn't like the syntax of the script that works with Graph Builder, I don't know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_results &amp;lt;&amp;lt; Distribution(
	Continuous Distribution( Column( NNYCol + NNcolshift ), Quantiles( 0 ) ),
	Continuous Distribution( Column( NNYCol + 1 + NNcolshift ), Quantiles( 0 ) ),
	Continuous Distribution( Column( NNYCol + 2 + NNcolshift ), Quantiles( 0 ) )
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 20:41:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687774#M87337</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2023-10-16T20:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: help properly referencing a data table column for Distribution platform</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687784#M87338</link>
      <description>&lt;P&gt;You can use fun and confusing syntax like 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");

col1 = "height";
col2 = "weight";

dist = dt &amp;lt;&amp;lt; Distribution(
	Continuous Distribution(Column(Column(dt, col1)), Quantiles(0)),
	Continuous Distribution(Column(Column(dt, col2)), Quantiles(0))
);	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or 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");

col1 = "height";
col2 = "weight";
Eval(EvalExpr(
	dist = dt &amp;lt;&amp;lt; Distribution(
		Continuous Distribution(Column(Eval(col1)), Quantiles(0)),
		Continuous Distribution(Column(Eval(col2)), Quantiles(0))
	);
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Eval(EvalExpr()) is unnecessary in the above script. I left it there by accident when testing out different options (was playing around with Name Expr(AsColumn())).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 08:07:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687784#M87338</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-17T08:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: help properly referencing a data table column for Distribution platform</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687785#M87339</link>
      <description>&lt;P&gt;Or just one of these:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

col1 = "height";
col2 = "weight";

Distribution(Continuous Distribution(Column(Eval(col1))));

colList={col1,col2};
Distribution(column(EvalList(colList)));

&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;Further details can be found here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.pega-analytics.co.uk/blog/handling-lists-of-columns/" target="_blank" rel="noopener"&gt;https://www.pega-analytics.co.uk/blog/handling-lists-of-columns/&lt;/A&gt;&amp;nbsp;(thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15435"&gt;@Ressel&lt;/a&gt;&amp;nbsp;:)&lt;/img&gt; and here:&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Updating-column-list-box-using-list-stored-in-variable-not/m-p/687314/highlight/true#M87301" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Updating-column-list-box-using-list-stored-in-variable-not/m-p/687314/highlight/true#M87301&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The confusion arises because (well known)&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Column&lt;/FONT&gt;&amp;nbsp;is used as a name for a &lt;STRONG&gt;named argument &lt;/STRONG&gt;in &lt;FONT face="courier new,courier"&gt;Continuous Distribution .&lt;/FONT&gt;Many Jmp users will assume that it was the &lt;FONT face="courier new,courier"&gt;Column()&lt;/FONT&gt; function and use it accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same for Data Table() in Col List Box :&amp;nbsp;&lt;LI-MESSAGE title="Updating column list box using list stored in variable not working as expected. Is this how it is meant to be?" uid="687126" url="https://community.jmp.com/t5/Discussions/Updating-column-list-box-using-list-stored-in-variable-not/m-p/687126#U687126" 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;</description>
      <pubDate>Tue, 17 Oct 2023 08:16:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687785#M87339</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-17T08:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: help properly referencing a data table column for Distribution platform</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687952#M87361</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks for some quick feedback and help on this. I ended up going with a blend of&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;'s second suggestion. Unfortunately, the suggestion from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47878"&gt;@mmarchandTSI&lt;/a&gt;&amp;nbsp;didn't end up working by itself, the platform still didn't like the variables for the column number within the Column() reference. However, if I then did an Eval() on the number variables within the Column() reference, then it worked out just fine. So, using Column(Eval()), as&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;did, ended up working as intended.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the great suggestions!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:59:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-help-properly-referencing-a-data-table-column-for/m-p/687952#M87361</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-10-17T12:59:40Z</dc:date>
    </item>
  </channel>
</rss>

