Subscribe Bookmark RSS Feed

how to add a new formula with JSL?

TONYMA

Occasional Contributor

Joined:

Feb 14, 2017

all i use the samlpe which named  thickness.JMP to produce a new file  by summary。   but i don not know to how to add one formula  with JSL in summary table。
i am god of yours
1 ACCEPTED SOLUTION

Accepted Solutions
markbailey

Staff

Joined:

Jun 23, 2011

Solution

Your formula involves division. It requires numeric data columns for this compuation. Your result is set up for a new column with the character data type. If that is what you want, then wrap the division inside the Char() function to satisfy the data type.

Learn it once, use it forever!
5 REPLIES
TONYMA

Occasional Contributor

Joined:

Feb 14, 2017

 
i am god of yours
TONYMA

Occasional Contributor

Joined:

Feb 14, 2017

 
i am god of yours
ih

Community Trekker

Joined:

Sep 30, 2016

To create the summary table first and then add a formula column to it, save a reference to the table when you create it:

 

//Save reference to the newly created summary table.
dt = Data Table( "Thickness" ) << Summary( Group( :Bar ), N, Mean( :Thickness 01 ) );

//Send a message to the new table to create the new column.
dt <<  New Column( "New formula column",
	Character,
	Formula( 
		If( :Name( "Mean(Thickness 01)" ) > 0.04,
			"normal",
			"thin"
		)
	)
);
TONYMA

Occasional Contributor

Joined:

Feb 14, 2017

i want to calculate " Thickness 01/N rows ". JSL is below, that is right? dt << New Column( "New formula column", Character, Formula( :Name( "Thickness 01) / :Name( "N rows"));
i am god of yours
markbailey

Staff

Joined:

Jun 23, 2011

Solution

Your formula involves division. It requires numeric data columns for this compuation. Your result is set up for a new column with the character data type. If that is what you want, then wrap the division inside the Char() function to satisfy the data type.

Learn it once, use it forever!