cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
GgGgGg2024
Level I

How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

 


// Change column info: Gender
Data Table("Untitled 448"):Column 2 << Data Type(Character) << Set Modeling Type("Nominal") <<
Set Name("Gender");
 
 
// Change column name: Column 1 → STudents
Data Table("Untitled 448"):Column 1 << Set Name("STudents");
 
 
// New column: Column 3
Data Table("Untitled 448") << New Column("Column 3", Numeric, "Continuous", Format("Best", 12));
 
 
// Change column name: Column 3 → Age
Data Table("Untitled 448"):Column 3 << Set Name("Age");
5 REPLIES 5
jthi
Super User

Re: How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

What is the end goal? You might be able to achieve this by using conditional data filter.

-Jarmo
GgGgGg2024
Level I

Re: How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

end goal is to make a graph based on the users requirement. 

The user should be able to tell the system if he wants a graph with the data of number of male or number of female and select which age group.

 

Basically, can you write a script for conditional data filter where the user is free to select the parameters to move to the next step.

 

Thanks in advance

jthi
Super User

Re: How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

Names Default To Here(1); 

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

gb = dt << Graph Builder(
	Size(525, 454),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11))),
	Local Data Filter(
		Conditional,
		Add Filter(
			columns(:sex, :age),
			Where(:sex == "F"),
			Where(:age == {13, 14, 15}),
			Display(:age, N Items(6))
		)
	)
);

jthi_0-1705493330841.png

 

 

-Jarmo
GgGgGg2024
Level I

Re: How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

Thanks for the solution. How can I make this interactive? Can I add pop ups to select only which country or only which material data I want?

 

New SQL Query(QueryName("Data"), Select, From(Table("Data", Schema("products"), Alias("t1")))) << Run;

// Delete selected rows
Data Table("Data") << Select Where(!(:country == "Tokyo")) << Delete Rows;

// Delete selected rows
Data Table("Data") << Select Where(!(:product == "Shoes")) << Delete Rows;

// Change row ID area display width
Data Table("Data") << Set Row ID Width(91);

// Split data table
// → Data Table( "Untitled 473" )
Data Table("Data") << Split(
	Split By(:material),
	Split(:cost),
	Group(:country),
	Output Table("finalfile.jmp"),
	Remaining Columns(Drop All),
	Sort by Column Property
);
jthi
Super User

Re: How do I make my script user interactive? The user has to select meta data in every step in order to get the final graph stats. Eg) First pop up should be 'Male' or 'Female' and so on

Still not really knowing what you are doing, so I would still suggest using data filters, but maybe data filter instead of local data filter

Names Default To Here(1); 

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

df = dt << Data Filter(
	Conditional,
	Add Filter(
		columns(:sex, :age),
		Where(:sex == "F"),
		Where(:age == {13, 14, 15}),
		Display(:age, N Items(6))
	)
);

 

You could also build customized UI but how to build it, depends a lot on your data and what it is used for.

-Jarmo