<?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 variable as a column name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392205#M64248</link>
    <description>Thank you, that worked!</description>
    <pubDate>Wed, 09 Jun 2021 21:44:10 GMT</pubDate>
    <dc:creator>Lindeman1arr</dc:creator>
    <dc:date>2021-06-09T21:44:10Z</dc:date>
    <item>
      <title>Using a variable as a column name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392133#M64243</link>
      <description>&lt;P&gt;This should be a really easy question, but it has been frustrating me for a couple hours now and I can't figure it out.&amp;nbsp; I have a script that loops through a list of columns and builds various charts for each.&amp;nbsp; It also adds a distribution to the lineup box using this line of code.&lt;/P&gt;&lt;P&gt;This line works perfectly when I type in the column name manually:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lub &amp;lt;&amp;lt; append( Panel Box( "Distribution", db_Data &amp;lt;&amp;lt; Distribution( Continuous Distribution(&amp;nbsp; column( "VF (19)" )) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But this won't work when I try and use a variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;TestName = "VF (19)";
lub &amp;lt;&amp;lt; append( Panel Box( "Distribution", db_Data &amp;lt;&amp;lt; Distribution( Continuous Distribution( column( TestName )) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have tried using&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;as column(TestName)
column( name(TestName))
column( as name(TestName))&lt;BR /&gt;column( as :Name(TestName))&lt;BR /&gt;column( :Name(TestName))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And every other combination I can find on discussions on the internet.&amp;nbsp; But to no avail.&amp;nbsp; Can someone help with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:31:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392133#M64243</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2023-06-10T23:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as a column name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392165#M64244</link>
      <description>&lt;P&gt;There is a function called Column() and also an element in the Distribution Platform called Column().&amp;nbsp; When you are using TestName as a reference, JMP interprets&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( TestName )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as the Column() function and therefore there is not a Column element.&amp;nbsp; Change the syntax to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;TestName = "VF (19)";
lub &amp;lt;&amp;lt; append( Panel Box( "Distribution", db_Data &amp;lt;&amp;lt; Distribution( Continuous Distribution( column( column( TestName ))) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and it will work&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 20:52:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392165#M64244</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-06-09T20:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as a column name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392205#M64248</link>
      <description>Thank you, that worked!</description>
      <pubDate>Wed, 09 Jun 2021 21:44:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/392205#M64248</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2021-06-09T21:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as a column name</title>
      <link>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/394762#M64530</link>
      <description>&lt;P&gt;I tried this solution, and it didn't work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I did:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;strTitle1 = "Process Capability of " || Eval( Eval Expr( Expr( limits[1] ) ) ) || " - " ||
station || " - " || Eval( Eval Expr( Expr( limits[7] ) ) );
strCol = Eval( Eval Expr( Expr( limits[1] ) ) );

dt1 &amp;lt;&amp;lt; New Script(
	strTitle1,
	Distribution(
		Stack( 1 ),
		Continuous Distribution(
			Column( Column( strCol ) ),
			Quantiles( 0 ),
			Horizontal Layout( 1 ),
			Vertical( 0 ),
			Show Counts( 1 ),
			Process Capability(
				Use Column Property Specs,
				Process Capability Analysis(
					Overall Sigma Capability( 0 ),
					Histogram( 1, Show Overall Sigma Density( 0 ) )
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I ended up with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Process Capability of min_detection_probability - XX - XX&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;Distribution(
	Stack( 1 ),
	Continuous Distribution(
		Column( Column( strCol ) ),
		Quantiles( 0 ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Show Counts( 1 ),
		Process Capability(
			Use Column Property Specs,
			Process Capability Analysis(
				Overall Sigma Capability( 0 ),
				Histogram( 1, Show Overall Sigma Density( 0 ) )
			)
		)
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Can anyone tell me where I went wrong please?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 18:04:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-a-variable-as-a-column-name/m-p/394762#M64530</guid>
      <dc:creator>tknowny</dc:creator>
      <dc:date>2021-06-21T18:04:55Z</dc:date>
    </item>
  </channel>
</rss>

