cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
neelsrejan
Level III

Format List Box text by value that naturally shows up when using the By clause in JSL

Hi all, 

 

I am trying to make an individual oneway chart based on the value in a given list. I am able to do it in a for loop using where column == value in list and so on. The issue is that when I use a where clause I get this TextBox in the Listbox above the chart that I am unable to change the text of through JSL. I am able to change it when I right click and go into the properties but I want this to happen through code. Any help would be appreciated as this way doesn't show what the data is and can be misleading without me being able to change the text. The correct way happens when I use a generic By clause for the column but want that same look through code. Please look at the examples below.

 

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

types = {"F", "M"};

ow = Oneway(
    Y( :height ),  // Dependent variable
    X( :age ),     // Factor variable
    Where(:sex == types[1])
);

produces:

 

neelsrejan_0-1696908094877.png

I would like this part to say :Sex == "F" so if the graph is in a report that it shows that it has been subsetted by "F" as right now it does not give such information.

 

Using this code:

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

ow = Oneway(
    Y( :height ),  // Dependent variable
    X( :age ),     // Factor variable
    By(:sex)
);

I get:

neelsrejan_1-1696908236239.png

I know the for loop will give me "M" but how can I get the same details with sex=F onto the first one by using a where clause. 

 

Thanks in advance and any help would be appreciated!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Format List Box text by value that naturally shows up when using the By clause in JSL

What needs to be done is to fully expand what is passed to JMP, so that when you pass the Oneway to JMP, there are not expression evaluations that need to be done.

Here is one way to do it:

txnelson_0-1696910099546.png

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

types = {"F", "M"};

Eval(
	Substitute(
			Expr(
				ow =
				Oneway(
					Y( :height ),  // Dependent variable
					X( :age ),     // Factor variable
					Where( :sex == _types_ )
				)
			),
		Expr( _types_ ), types[1]
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Format List Box text by value that naturally shows up when using the By clause in JSL

What needs to be done is to fully expand what is passed to JMP, so that when you pass the Oneway to JMP, there are not expression evaluations that need to be done.

Here is one way to do it:

txnelson_0-1696910099546.png

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

types = {"F", "M"};

Eval(
	Substitute(
			Expr(
				ow =
				Oneway(
					Y( :height ),  // Dependent variable
					X( :age ),     // Factor variable
					Where( :sex == _types_ )
				)
			),
		Expr( _types_ ), types[1]
	)
);
Jim