- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Using a variable as a column name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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?