cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar

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 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