cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Lindeman1arr
Level II

Using a variable as a column name

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.  I have a script that loops through a list of columns and builds various charts for each.  It also adds a distribution to the lineup box using this line of code.

This line works perfectly when I type in the column name manually:

lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution(  column( "VF (19)" )) ) ) );

But this won't work when I try and use a variable:

TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( TestName )) ) ) );

I have tried using 

as column(TestName)
column( name(TestName))
column( as name(TestName))
column( as :Name(TestName))
column( :Name(TestName))

And every other combination I can find on discussions on the internet.  But to no avail.  Can someone help with this?

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Using a variable as a column name

There is a function called Column() and also an element in the Distribution Platform called Column().  When you are using TestName as a reference, JMP interprets 

Column( TestName )

as the Column() function and therefore there is not a Column element.  Change the syntax to

TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( column( TestName ))) ) ) );

and it will work

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Using a variable as a column name

There is a function called Column() and also an element in the Distribution Platform called Column().  When you are using TestName as a reference, JMP interprets 

Column( TestName )

as the Column() function and therefore there is not a Column element.  Change the syntax to

TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( column( TestName ))) ) ) );

and it will work

Jim
Lindeman1arr
Level II

Re: Using a variable as a column name

Thank you, that worked!
tknowny
Level I

Re: Using a variable as a column name

I tried this solution, and it didn't work for me.

 

What I did:

 

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 << 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 ) )
				)
			)
		)
	)
);

 

What I ended up with:

 

Process Capability of min_detection_probability - XX - XX

 

 

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 ) )
			)
		)
	)
)

Can anyone tell me where I went wrong please?