cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
minion
Level II

column switcher linked multiple platform

dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );

clear log();

colnames = dt << getcolumnnames(numeric,string);
colnames = Filter Each({name}, colnames, !Is Missing(Regex(lowercase(name), "^(process).*")));

print(colnames[1]);

New Window("reacher",
	H List Box(
		V List Box (
			dist = dt << Distribution(Continuous Distribution(Column(column(dt, colnames[1])),Process Capability( 0 )),Histograms Only),
			biv = Bivariate( Y(column(dt, colnames[1])), X(column(dt, colnames[1])) )
		),
		cs = dt << Column Switcher(:Process 1, colnames),
//		cs = dt << Column Switcher(colnames[1], colnames),
	)
);
cs << Link Platform( dist );
cs << Link Platform( biv );

Trying to script column switcher for arbitrary table.

 

Code above works.

 

However, when line16 is commented and line17 uncommented, column switcher does not work

 

Please help 

1 REPLY 1
jthi
Super User

Re: column switcher linked multiple platform

You might have to evaluate the colnames[1] in correct format to column switcher. Here is one option

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Process Measurements.jmp");

colnames = dt << getcolumnnames(numeric, string);
colnames = Filter Each({name}, colnames, !Is Missing(Regex(Lowercase(name), "^(process).*")));

Eval(EvalExpr(
	nw = New Window("reacher",
		H List Box(
			V List Box(
				dist = dt << Distribution(
					Continuous Distribution(Column(Eval(colnames[1])), Process Capability(0)),
					Histograms Only
				),
				biv = Bivariate(Y(Eval(colnames[1])), X(Eval(colnames[1])))
			),
			cs = dt << Column Switcher(Expr(NameExpr(AsColumn(dt, colnames[1]))), colnames)
		)
	);	
));

cs << Link Platform(dist);
cs << Link Platform(biv);
-Jarmo