cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

How to use JSL to select a specific item in the filter

Hi all,

I would like to ask how to use JSL to select a specific item in the filter when the local data filter already exists, such as first selecting :age == "12" and then selecting :age == "13" next time,thanks (JMP17)

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to use JSL to select a specific item in the filter

Sending Where message to data filter is one option. Scripting Index has example on how to use it

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(Add(Filter Columns(:Region, :Lead)));
Wait(1);
obj << (Filter Column(:Lead) << Where(:Lead >= .4 & :Lead <= 1.4));

jthi_0-1767682076370.png

 

-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User

Re: How to use JSL to select a specific item in the filter

Sending Where message to data filter is one option. Scripting Index has example on how to use it

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(Add(Filter Columns(:Region, :Lead)));
Wait(1);
obj << (Filter Column(:Lead) << Where(:Lead >= .4 & :Lead <= 1.4));

jthi_0-1767682076370.png

 

-Jarmo

Re: How to use JSL to select a specific item in the filter

Sorry, I forgot to add one condition — it was in the Graph Builder and I just tried it out, but it doesn't seem to have taken effect.

jthi
Super User

Re: How to use JSL to select a specific item in the filter

What does your script look like? Do you have reference to the local data filter?

-Jarmo

Re: How to use JSL to select a specific item in the filter

dt = Open( "$SAMPLE_DATA/Cities.jmp" );
graph = dt << Graph Builder(
	Size( 528, 455 ),
	Show Control Panel( 0 ),
	Variables( X( :POP ), Y( :CO ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 5 ) ) ),
);

graph << Local Data Filter(
	Add Filter( columns( :Region ), Display( :Region, N Items( 6 ) ) )
);

//It seems that writing it this way doesn't work, obj << (Filter Column(:Region) << Where(:Region == "C"));

It is hoped that the selection of filters can be separated for independent operation.

jthi
Super User

Re: How to use JSL to select a specific item in the filter

Names Default To Here(1);


dt = Open("$SAMPLE_DATA/Cities.jmp");
graph = dt << Graph Builder(
	Size(528, 455),
	Show Control Panel(0),
	Variables(X(:POP), Y(:CO)),
	Elements(Points(X, Y, Legend(3)), Smoother(X, Y, Legend(5)))
);

ldf = graph << Local Data Filter(Add Filter(columns(:Region), Display(:Region, N Items(6))));

ldf << (Filter Column(:Region) << Where(:Region == "C"));
-Jarmo

Re: How to use JSL to select a specific item in the filter

hhh, I was so careless. Thank you for your patient answers.

Recommended Articles