<?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: Looping on Variability Chart - problem with referencing a list member instead of using its value explicitly in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Looping-on-Variability-Chart-problem-with-referencing-a-list/m-p/580744#M78766</link>
    <description>&lt;P&gt;I think the chart is being drawn before JMP tries to evaluate what tester[i] actually is, and once it does the Variability chart platform doesn't know anything about the script window that launched it.&amp;nbsp; You can avoid this by telling JMP to evaluate the expression before launching the platform, as described in&amp;nbsp;&lt;LI-MESSAGE title="Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute." uid="48998" url="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/m-p/48998#U48998" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp" );

cols = dt &amp;lt;&amp;lt; get column references;
cols = cols[1]

for each({c, i}, cols, 
	Eval( Eval Expr(
		Variability Chart(
			Y( Expr( c ) ),
			Model( "Crossed" ),
			X( :Operator, :"part#"n ),
			Analysis Type( "Choose best analysis (EMS REML or Bayesian)" ),
			Variability Analysis(
				Expr( cols[i] ), /* PROBLEM HAPPENS ON THIS LINE*/
				MSA Metadata( tester[i] ( Lower Tolerance( LTU[i] ), Upper Tolerance( UTU[i] ), Tolerance Range( UTU[i]-LTU[i] ) ) ),
				Gauge RR( 6 ),
				"Gauge R&amp;amp;R Report"n( 1 )
			)
		)
	) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Dec 2022 22:16:14 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2022-12-12T22:16:14Z</dc:date>
    <item>
      <title>Looping on Variability Chart - problem with referencing a list member instead of using its value explicitly</title>
      <link>https://community.jmp.com/t5/Discussions/Looping-on-Variability-Chart-problem-with-referencing-a-list/m-p/579437#M78665</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am looping on the Variability Chart to analyze different parameters, each represented by a column. The column names are stored in a list. Here is the code snippet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tetser = {a list of 100 column names in string format};&lt;BR /&gt;For( i = 1, i &amp;lt;= 100 , i++, 
	Variability Chart(
		Y( tester[i]),
		Model( "Crossed" ),
		X( :Operators, :Parts ),
		Analysis Type( "Choose best analysis (EMS REML or Bayesian)" ),
		Variability Analysis(
			tester[i], &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;/* PROBLEM HAPPENS ON THIS LINE*/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;
			MSA Metadata( tester[i] ( Lower Tolerance( LTU[i] ), Upper Tolerance( UTU[i] ), Tolerance Range( UTU[i]-LTU[i] ) ) ),
			Gauge RR( 6 ),
			"Gauge R&amp;amp;R Report"n( 1 )
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;The problem is:&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;when I run the code I get this error which is because I am using tetser[i] as the column name inside the Variability Analysis(...) function. If I change it to the column name's string (instead of referencing it by indexing) it works fine. I am showing the line where I believe the error occurs there in the code above. Could you help me with the solution or direct me to the Help file?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LoglinearRange8_1-1670601473384.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/48095iE73908F605DC4607/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LoglinearRange8_1-1670601473384.png" alt="LoglinearRange8_1-1670601473384.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:04:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Looping-on-Variability-Chart-problem-with-referencing-a-list/m-p/579437#M78665</guid>
      <dc:creator>LoglinearRange8</dc:creator>
      <dc:date>2023-06-09T16:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Looping on Variability Chart - problem with referencing a list member instead of using its value explicitly</title>
      <link>https://community.jmp.com/t5/Discussions/Looping-on-Variability-Chart-problem-with-referencing-a-list/m-p/580744#M78766</link>
      <description>&lt;P&gt;I think the chart is being drawn before JMP tries to evaluate what tester[i] actually is, and once it does the Variability chart platform doesn't know anything about the script window that launched it.&amp;nbsp; You can avoid this by telling JMP to evaluate the expression before launching the platform, as described in&amp;nbsp;&lt;LI-MESSAGE title="Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute." uid="48998" url="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/m-p/48998#U48998" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp" );

cols = dt &amp;lt;&amp;lt; get column references;
cols = cols[1]

for each({c, i}, cols, 
	Eval( Eval Expr(
		Variability Chart(
			Y( Expr( c ) ),
			Model( "Crossed" ),
			X( :Operator, :"part#"n ),
			Analysis Type( "Choose best analysis (EMS REML or Bayesian)" ),
			Variability Analysis(
				Expr( cols[i] ), /* PROBLEM HAPPENS ON THIS LINE*/
				MSA Metadata( tester[i] ( Lower Tolerance( LTU[i] ), Upper Tolerance( UTU[i] ), Tolerance Range( UTU[i]-LTU[i] ) ) ),
				Gauge RR( 6 ),
				"Gauge R&amp;amp;R Report"n( 1 )
			)
		)
	) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Dec 2022 22:16:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Looping-on-Variability-Chart-problem-with-referencing-a-list/m-p/580744#M78766</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-12-12T22:16:14Z</dc:date>
    </item>
  </channel>
</rss>

