<?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: Using a string variable inside a graph builder script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-a-string-variable-inside-a-graph-builder-script/m-p/741157#M92216</link>
    <description>&lt;P&gt;You need to evaluate the trim0 before submitting the code to JMP.&amp;nbsp; The below modifications to your script should do what you need.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Eval Expr(
		dt &amp;lt;&amp;lt; New Script(
			"maps",
			Graph Builder(
				Size( 550, 647 ),
				Graph Spacing( 5 ),
				Variables(
					X( :X ),
					Y( :Y ),
					Group Y( :Name( "Tambient (degC)" ) ),
					Wrap( :LotWafer ),
					Color( Column( Expr( Trim0 ) ) )
				),
				Elements( Points( X, Y, Legend( 3 ) ) ),
				Local Data Filter(
					Add Filter(
						columns( :LotWafer, :Name( "Tambient (degC)" ) ),
						Where( :Name( "Tambient (degC)" ) == 25 ),
						Display( :LotWafer, Size( 224, 105 ), List Display )
					)
				),
				SendToReport(
					Dispatch(
						{},
						"X",
						ScaleBox,
						{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
					),
					Dispatch(
						{},
						"Y",
						ScaleBox,
						{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
					)
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Mar 2024 21:55:34 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-03-29T21:55:34Z</dc:date>
    <item>
      <title>Using a string variable inside a graph builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-string-variable-inside-a-graph-builder-script/m-p/741117#M92215</link>
      <description>&lt;P&gt;Early in my JMP script, I define a string variable like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Trim0 = "trim_lvl_a";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is a column in my data table by the name of trim_lvl_a.&amp;nbsp; Later in the script, I create a Graph Builder script like this:&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;dt &amp;lt;&amp;lt; New Script(
       "maps",
Graph Builder(
	Size( 550, 647 ),
	Graph Spacing( 5 ),
	Variables(
		X( :X ),
		Y( :Y ),
		Group Y( :Name( "Tambient (degC)" ) ),
		Wrap( :LotWafer ),
		Color( Column(Trim0) )
	),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	Local Data Filter(
		Add Filter(
			columns( :LotWafer, :Name( "Tambient (degC)" ) ),
			Where( :Name( "Tambient (degC)" ) == 25 ),
			Display( :LotWafer, Size( 224, 105 ), List Display )
		)
	),
	SendToReport(
		Dispatch(
			{},
			"X",
			ScaleBox,
			{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ),
			Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch(
			{},
			"Y",
			ScaleBox,
			{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ),
			Label Row( Show Major Grid( 1 ) )}
		)
	)
);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is where I try to use the Trim0 string constant in the Color part of the graph builder.&amp;nbsp; Once my JMP script executes and the graph builder script called "maps" is saved to my data table dt, then when I click on the "maps" script in dt, it fails to execute and bring up the graph.&amp;nbsp; How can I use my string variable Trim0 within this graph builder to refer to the desired column in my data table?&amp;nbsp; I do not want to have to hard-wire the colulmn name trim_lvl_a into the Color part of the graph builder script.&amp;nbsp; Thanks.&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 21:46:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-string-variable-inside-a-graph-builder-script/m-p/741117#M92215</guid>
      <dc:creator>fbm73</dc:creator>
      <dc:date>2024-03-29T21:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using a string variable inside a graph builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-string-variable-inside-a-graph-builder-script/m-p/741157#M92216</link>
      <description>&lt;P&gt;You need to evaluate the trim0 before submitting the code to JMP.&amp;nbsp; The below modifications to your script should do what you need.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Eval Expr(
		dt &amp;lt;&amp;lt; New Script(
			"maps",
			Graph Builder(
				Size( 550, 647 ),
				Graph Spacing( 5 ),
				Variables(
					X( :X ),
					Y( :Y ),
					Group Y( :Name( "Tambient (degC)" ) ),
					Wrap( :LotWafer ),
					Color( Column( Expr( Trim0 ) ) )
				),
				Elements( Points( X, Y, Legend( 3 ) ) ),
				Local Data Filter(
					Add Filter(
						columns( :LotWafer, :Name( "Tambient (degC)" ) ),
						Where( :Name( "Tambient (degC)" ) == 25 ),
						Display( :LotWafer, Size( 224, 105 ), List Display )
					)
				),
				SendToReport(
					Dispatch(
						{},
						"X",
						ScaleBox,
						{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
					),
					Dispatch(
						{},
						"Y",
						ScaleBox,
						{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
					)
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Mar 2024 21:55:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-string-variable-inside-a-graph-builder-script/m-p/741157#M92216</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-03-29T21:55:34Z</dc:date>
    </item>
  </channel>
</rss>

