cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

control chart with column switcher

Françoise
Level V

hi,

 

I have an IMR control chart with the column selector on about ten variables for Y axis

all variables do not have the same format for decimals and the same format (fixed decimal, percentage, ...).

I can't get the format I want for each Y variable

 

how to do it with jsl?

 

best regards

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: control chart with column switcher

Here is an example of setting the number of decimals based upon the column format, when the column switcher changes.

txnelson_0-1692261095655.png

Names Default To Here( 1 );
dt = New Table( "Example",
	Add Rows( 20 ),
	New Column( "A",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 2 ),
		Set Values(
			[0.0754692861810327, 0.752831102814525, 0.432255176594481, 0.341968776658177, 0.568129215855151,
			0.660923485411331, 0.105864432407543, 0.915830883430317, 0.493037405889481, 0.848509776871651,
			0.502906230278313, 0.184636627091095, 0.356515710474923, 0.979479612084105, 0.720729062333703,
			0.824798582820222, 0.880037358496338, 0.396357897669077, 0.424773458158597, 0.0499309413135052]
		)
	),
	New Column( "B",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 3 ),
		Set Values(
			[0.88264535064809, 0.856779424706474, 0.922006396111101, 0.225065165199339, 0.0619992383290082,
			0.405686405720189, 0.784316523466259, 0.523665967164561, 0.586588164092973, 0.281117314239964,
			0.283934285165742, 0.65784368221648, 0.944990600459277, 0.967821644386276, 0.798449326306581,
			0.925142117775976, 0.925621940754354, 0.363795479293913, 0.396030477480963, 0.41240519634448]
		)
	)
);
ccb = Control Chart Builder( Variables( Y( :A ) ) );
cs = ccb << Column Switcher( :A, {:A, :B} );
Report( ccb )[axisbox( 2 )] << Format( "Percent", 12, 2 );
cs << set Script(
	theCol = cs << get current;
	theFormat = Char( Column( dt, theCol ) << get format );
	theDec = Word( -1, theFormat, ") " );
	Eval(
		Substitute(
				Expr(
					Report( ccb )[axisbox( 2 )] << Format( "Percent", 12, _dec_ )
				),
			Expr( _dec_ ), Num( theDec )
		)
	);
);

 

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User


Re: control chart with column switcher

Here is an example of setting the number of decimals based upon the column format, when the column switcher changes.

txnelson_0-1692261095655.png

Names Default To Here( 1 );
dt = New Table( "Example",
	Add Rows( 20 ),
	New Column( "A",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 2 ),
		Set Values(
			[0.0754692861810327, 0.752831102814525, 0.432255176594481, 0.341968776658177, 0.568129215855151,
			0.660923485411331, 0.105864432407543, 0.915830883430317, 0.493037405889481, 0.848509776871651,
			0.502906230278313, 0.184636627091095, 0.356515710474923, 0.979479612084105, 0.720729062333703,
			0.824798582820222, 0.880037358496338, 0.396357897669077, 0.424773458158597, 0.0499309413135052]
		)
	),
	New Column( "B",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 3 ),
		Set Values(
			[0.88264535064809, 0.856779424706474, 0.922006396111101, 0.225065165199339, 0.0619992383290082,
			0.405686405720189, 0.784316523466259, 0.523665967164561, 0.586588164092973, 0.281117314239964,
			0.283934285165742, 0.65784368221648, 0.944990600459277, 0.967821644386276, 0.798449326306581,
			0.925142117775976, 0.925621940754354, 0.363795479293913, 0.396030477480963, 0.41240519634448]
		)
	)
);
ccb = Control Chart Builder( Variables( Y( :A ) ) );
cs = ccb << Column Switcher( :A, {:A, :B} );
Report( ccb )[axisbox( 2 )] << Format( "Percent", 12, 2 );
cs << set Script(
	theCol = cs << get current;
	theFormat = Char( Column( dt, theCol ) << get format );
	theDec = Word( -1, theFormat, ") " );
	Eval(
		Substitute(
				Expr(
					Report( ccb )[axisbox( 2 )] << Format( "Percent", 12, _dec_ )
				),
			Expr( _dec_ ), Num( theDec )
		)
	);
);

 

Jim
JerryHunt
Level I


Re: control chart with column switcher

Thank you for the example, I appreciate you.

Françoise
Level V


Re: control chart with column switcher

Hi Jim,

 

It's good !

 

thanks for your answer.

 

I appreciate also.

 

best regards