<?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: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/812933#M99383</link>
    <description>&lt;P&gt;Are there some specific values you wish to evaluate but not all in your vc script?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 10:05:50 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-11-14T10:05:50Z</dc:date>
    <item>
      <title>Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/812923#M99382</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a bit confused as to why the table script does not dynamically consider the variable set in the main script. As such the figures are getting standard values rather than dynamic selections based on the for loop's run. Any help would be appreciated. Below is the table script I am referring to in case that it's not commonly called the table script.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-14 013952.png" style="width: 172px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70141i957F379F2C2B2A9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-11-14 013952.png" alt="Screenshot 2024-11-14 013952.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please take a look at the main JSL script on the left in which the highlighted code works dynamically. When the "vc script" is saved to the data table, the script opens up to the right side of the screenshot. It seems like the first value that "weights" and "counts" encounters is set for all each loop of the for loop that its embedded in. Is there a way to make this dynamic? I have only read posts about making columns strings or a formula but I don't think that fits this case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-11-14 013723.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70142i86CF5AAC7ABF64DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-11-14 013723.png" alt="Screenshot 2024-11-14 013723.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated to alter the main jsl code such that the saved script does not hard code these values. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 09:50:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/812923#M99382</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2024-11-14T09:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/812933#M99383</link>
      <description>&lt;P&gt;Are there some specific values you wish to evaluate but not all in your vc script?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 10:05:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/812933#M99383</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-14T10:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813157#M99422</link>
      <description>&lt;P&gt;From the top left, I create a subsetted data table "vc depo summary subset" that per each for loop subsets by a variable in this case depo but for the sake of an example: depo = {"A", "B", "C"}. In the jsl script on the left, subsetting by A gives weights = [50, 50, 50, 50, 50] and counts = [16, 20, 19, 20, 20] and subsetting by B or C give different weights and counts. The script on the left works properly. But when I open the same script that is saved to the data table, it defaults weights/counts to the values of A instead of leaving the variable (as it is on the left) which carries the correct weights/counts for B and C respectively. I am unsure how to keep it as a variable rather than seeing the hard coded values on the right.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 22:00:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813157#M99422</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2024-11-14T22:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813207#M99430</link>
      <description>&lt;P&gt;If I understand correctly, you want to prevent the evaluation of some of the variables. One option to do this is to use multiple Expr().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you didn't share the script, I will try to use very simple example which hopefully demonstrates what you can do. Compare the script, table script and script which is inside frame box&lt;CODE class=" language-jsl"&gt;
&lt;/CODE&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");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height)),
	Elements(Points(X, Y, Legend(3)))
);


script = EvalExpr(
	vals = [55, 60, 70];
	Eval(EvalExpr(
		Current Report()[FrameBox(1)] &amp;lt;&amp;lt; Add Graphics Script(
			Local({myvals = Expr(Expr(Expr(vals)))},
				Pen Size(1);
				Line Style(1);
				For(i = 1, i &amp;lt;= N Items(Expr(Expr(Expr(vals)))), i++,
					H Line(Expr(Expr(Expr(vals))));
				);				
			);
		);
	))
);

Eval(EvalExpr(
	dt &amp;lt;&amp;lt; New Script("Test", Expr(Name Expr(script)));
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1731648619087.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70169i78A697C9F6A90384/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1731648619087.png" alt="jthi_1-1731648619087.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="jthi_2-1731648631946.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70170i73C439723C25644E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1731648631946.png" alt="jthi_2-1731648631946.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 05:31:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813207#M99430</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-15T05:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813467#M99480</link>
      <description>&lt;P&gt;Thanks Jarmo, that worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason we have to triple encase the variable with three Expr() functions instead of just 1?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:14:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813467#M99480</guid>
      <dc:creator>neelsrejan</dc:creator>
      <dc:date>2024-11-16T03:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813503#M99488</link>
      <description>&lt;P&gt;Yes as this is just how expression evaluation on JMP works (&lt;A href="https://www.jmp.com/support/help/en/18.0/#page/jmp/advanced-expressions-macros-and-lists.shtml#ww339382" target="_blank" rel="noopener"&gt; Scripting Guide &amp;gt; Programming Methods &amp;gt; Advanced Expressions, Macros, and Lists&lt;/A&gt; "Quoting and Unquoting Expressions").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you two have EvalExpr when building the expression which will evaluate two of them AND you wish to leave one extra for the table script so it is kept as Expr instead of being evaluated (so we need three in total). There are other ways of building things like this, but it is good to learn how adding more Expr() can sometimes be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think for example this should result in similar script without needing triple Expr()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;script = Substitute(
	Expr(
		vals = [55, 60, 70];
		Eval(
			Eval Expr(
				Current Report()[FrameBox(1)] &amp;lt;&amp;lt; Add Graphics Script(
					Local({myvals = _valsexpr_},
						Pen Size(1);
						Line Style(1);
						For(i = 1, i &amp;lt;= N Items(_valsexpr_), i++,
							H Line(_valsexpr_)
						);
					)
				)
			)
		);
	),
	Expr(_valsexpr_), Name Expr(Expr(vals))
);&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;</description>
      <pubDate>Sat, 16 Nov 2024 16:45:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813503#M99488</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-16T16:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data Table Script not dynamically not updating to use new value in saved script but works from the main jsl script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813577#M99502</link>
      <description>&lt;P&gt;Why not just&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;script = Expr(
	vals = [55, 60, 70];
	Eval(EvalExpr(
		Current Report()[FrameBox(1)] &amp;lt;&amp;lt; Add Graphics Script(
			Local({myvals = Expr(vals)},
				Pen Size(1);
				Line Style(1);
				For(i = 1, i &amp;lt;= N Items(Expr(vals)), i++,
					H Line(Expr(vals));
				);				
			);
		);
	))
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2024 11:49:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Table-Script-not-dynamically-not-updating-to-use-new-value/m-p/813577#M99502</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-11-17T11:49:33Z</dc:date>
    </item>
  </channel>
</rss>

