cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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