cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

How to Use a Variable for Custom Value Order in JMP Scripting?

Hi everyone,

I'm trying to set a custom value order in a column using JSL. Here's the code that works when I hardcode the list:

 

TestTable:Origin << Set Property(
"Value Order",
{Custom Order({"EU", "IND", "US", "JPN", "AU"}), Common Order(0)}
);

 

However, when I try to pass the list as a variable, it doesn't work:

countriesOrder = {"EU", "IND", "US", "JPN", "AU"};
TestTable:Origin << Set Property(
"Value Order",
{Custom Order(countriesOrder), Common Order(0)}
);

 

My goal is to read the country order from an Excel file and use that list dynamically. But I can't find documentation on what Custom Order() accepts—whether it can take a variable or only a literal list.

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to Use a Variable for Custom Value Order in JMP Scripting?

A variable within a JMP list will not be evaluated unless forced.  Try this

countriesOrder = {"EU", "IND", "US", "JPN", "AU"};
Eval(
	Eval Expr(
		TestTable:Origin << Set Property(
			"Value Order",
			{Custom Order( Expr( countriesOrder ) ), Common Order( 0 )}
		)
	)
);
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: How to Use a Variable for Custom Value Order in JMP Scripting?

A variable within a JMP list will not be evaluated unless forced.  Try this

countriesOrder = {"EU", "IND", "US", "JPN", "AU"};
Eval(
	Eval Expr(
		TestTable:Origin << Set Property(
			"Value Order",
			{Custom Order( Expr( countriesOrder ) ), Common Order( 0 )}
		)
	)
);
Jim

Recommended Articles