Scripting Guide > Data Tables > Columns > Column Properties
发布日期: 04/13/2021

Column Properties

Tip: JSL choices for properties are the same as those in the Column Properties menu in the Column Info window. The arguments for each property correspond to the settings in the Column Info window. An easy way to learn the syntax is to establish the property that you want in the Column Info window first, and then use Get Property to view the JSL. See “列信息”窗口 in Using JMP for more information about each property.

Data columns have numerous optional metadata attributes that can be set, queried, or cleared using the messages Get Property, Set Property, and Delete Property.

col << Set Property( "propertyName", {argument list} );
col << Get Property( "propertyName" );
col << Delete Property( "propertyName" );

The name of the property in question is always the first argument for Set Property, and what is expected for subsequent arguments depends on which property you set:

Get Property and Delete Property always take a single argument, which is the name of the property.

Get Property returns the property’s settings. Delete Property completely removes the property from the column.

To get a list of all column property names for a column, specify the column and then use Get Properties List.

If you want to set several properties, you need to send several separate Set Property messages. You can stack several messages in a single JSL statement if you want.

col << Set Property( "Axis",{Min(50), Max(180)} )<< Set Property( "Notes", "to get proportions" );

To get a property’s value, send a Get Property message whose argument is the name of the property that you want:

Column("ratio") << Get Property( "axis" ); // return axis settings

To set columns as label columns:

dt << Set Label Columns( col1, col2, col3 );

To clear all label columns:

dt << Set Label Columns();

The same syntax works for Set Scroll Lock Columns, and Scroll Lock.

Setting Column Properties with Variables

When writing JSL to script a column property, it is important to understand that the column is a repository for all column properties. The column stores the column property with the values supplied without evaluation or validation of the supplied arguments. In order to add column properties that contains variables using JSL code, the script must convert any variables to their actual values.

One way to do this is to use expressions. In the following example, the Eval Expr() function evaluates and replaces any variable wrapped in the Expr() function with its value. The outer Eval() function evaluates the entire statement after the replacement has occurred.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// assign desired spec limits

lLimit = 55;
uLimit = 70;
tLimit = 62.5;
 
Eval(
	Eval Expr(
 

// store the limits in the Spec Limits column property

		:height << Set Property(			"Spec Limits",
			{LSL( Expr( lLimit ) ), USL( Expr( uLimit ) ), Target( Expr( tLimit ) ),
			Show Limits( 0 )}
		)
	)
);

Setting and Getting Column Properties

Table 9.4 shows examples for setting and getting popular column properties. See “列信息”窗口 in Using JMP for more information about each property.

Table 9.4 Common Properties for Data Table Columns 

Property

Description

Example Using Arguments

Notes

Stores notes about a column. Is a quoted text string.

col<<Set Property( "Notes", "Extracted from Fisher iris data" );

 

col<<Get Property( "Notes" );

List Check

Range Check

Prescribes the possible values that can be entered in a column.

col<<Set Property( List Check,{"F","M"} );

 

col<<Set Property( "Range Check",LTLT(0, 120) );

 

col<<Get Property( "List Check" );

 

col<<Delete Property( "Range Check" );

Missing Value Codes

Specifies column values that should be treated as missing.

col<<Set Property( "Missing Value Codes", {0, 1} );

Value Labels

Specifies labels to be displayed in place of the values.

col<<Value Labels( {0 = "Male", 1 = "Female"} );

Use Boolean values to turn value labels on or off:

col<<Use Value Labels( 1 );.

Value Order

Specifies the order in which you want the data to appear in reports.

col<<Set Property( "Value Order", {"Spring", "Summer", "Fall", "Winter"} );

Value Colors and Color Gradient

Specifies colors for either categorical or continuous data, respectively.

Specify the color by assigning a JMP number to each value:

col<<Set Property( "Value Colors", {"Female" = 3, "Male" = 5} );

Specify a color theme:

col<<Set Property( "Value Colors", Color Theme( "White to Blue" ) );

If you omit the color theme, JMP uses the color theme preferences.

Specify the gradient and the range and midpoint for Value Gradient:

col<<Set Property( "Color Gradient", {"White to Blue", Range( {18, 60, 25} )} );

Axis

Most platforms use this (if it exists) when constructing axes. Mostly Boolean.

col<<Set Property( "Axis",{Min(50), Max(180), Inc(0), Minor Ticks(10), Show Major Ticks(1), Show Minor Ticks(1), Show Major Grid(0), Show Labels(1), Scale(Linear)} );

Units

Provided for custom uses. Specify the units of measure.

col<<Set Property( "units", "grams" );

 

col<<Get Property( "units" );

Coding

Used for DOE and fitting. List with low and high values.

col<<Set Property( "Coding", {59,172} );

 

col<<Get Property( "Coding" );

Mixture

Used for DOE, fitting, and profiling. Specifies the Mixture column properties in a list.

col<<Set Property( "Mixture", {0.2, 0.8, 1, L PseudoComponent Coding} );

 

col<<Get Property( "Mixture" );

Row Order Levels

Specify to sort levels by their occurrence in the data instead of by value.

col<<Set Property( "Row Order Levels", 1 );

Spec Limits

Used for capability analysis and variability charts.

col<<Set Property( "Spec Limits", {LSL(-1), USL(1), Target(0)} );

 

col<<Get Property( "Spec Limits" );

Control Limits

Used for control charts.

col<<Set Property( "Control Limits", {XBar(Avg(44), LCL(29), UCL(69))} );

 

col<<Get Property( "Control Limits" );

Response Limits

Set in DOE and used in desirability profiling.

col<<Set Property( "Response Limits", {Goal("Match Target"), Lower(1,1), Middle(2,2), Upper(3,3)} );

 

col<<Get Property("Response Limits");

Choices for Goal are Maximize, Match Target, Minimize, None. Other arguments take numeric value and desirability arguments.

Design Role

Used for DOE. Specify a single role.

col<<Set Property( "Design Role", "Covariate" );

 

col<<Get Property( "Design Role" );

Choices for role are Continuous, Discrete Numeric, Categorical, Blocking, Covariate, Mixture, Constant, Uncontrolled, Random Block, Signal, and Noise.

Factor Changes

Sets the difficulty of changing a factor (Easy, Hard, or Very Hard).

col<<Set Property( "Factor Changes", Hard) ;

 

col<<Get Property( "Factor Changes" );

Sigma

Used for control charts. Specify known sigma value.

col<<Set Property( "Sigma",1.332 );

 

col<<Get Property( "Sigma" );

Each type of chart uses a different sigma calculation.

Distribution

Set the distribution type to fit to the column.

col<<Set Property( "Distribution", Distribution( GLog ) );

 

col<<Get Property( "Distribution" );

Time Frequency

Set the type of time frequency.

col<<Set Property( "Time Frequency", Time Frequency( "Annual" ) );

 

col<<Get Property( "Time Frequency" );

Map Role

Set how the column is used to connect map shape data with name data. Specify the role and other information as necessary.

col<<Set Property( "Map Role", Map Role( Shape Name Use( "filepath to data table", "column name" ) ) );

 

col<<Get Property( "Map Role" );

Supercategories

Groups specific categories into one category. Supported only in the Categorical platform.

col<<Set Property( "Supercategories", {Group( "Genders", {"F", "M"} )} );

 

col<<Get Property( "Supercategories" );

Multiple Response

Specifies the character that separates the responses within a cell.

col<<Set Property( "Multiple Response", Multiple Response( Separator( "." ) ) );

 

col<<Get Property( "Multiple Response" ) );

Note: We recommend assigning the Multiple Response modeling type if the delimiter is a comma. Then you don’t have to specify the delimiter in the column property. See 多重响应 in Using JMP.

Profit Matrix

Assigns weights that define a decision model.

Specify a list that contains the weights in a matrix and categories in another list. In the matrix, each row contains weights that reflect the profit for predicting the category indicated by the column of the matrix.

Caution: The matrix argument is the transpose of the profit matrix as displayed in the Column Properties window.

col<<Set Property( "Profit Matrix", {[5 -1, -1 4, -2 -2], {"F", "M", "Undecided"}} );

 

col<<Get Property( "Profit Matrix" );

Expression Role

Applies to columns that contain expressions. Specifies whether the expression should be interpreted as a Picture, a Matrix, or an Expression.

col<<Set Property( "Expression Role", Expression Role( "Picture", MaxSize( 640, 480 ), StretchToMaxSize( 1 ), PreserveAspectRatio( 1 ), Frame( 0 ) )

[Custom property]

Provided for custom uses. Corresponds to Column Properties > Other in the Column Info window.

The first argument is a name for the custom property, and the second argument is an expression.

col<<Set Property( "Date recorded",12Dec1999 );

 

long date( col<<Get Property( "Date recorded") );

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).