BookmarkSubscribeSubscribe to RSS Feed

JSL: What to use for new columns, Formula or Set Each Value? Pros and Cons?

Highlighted
ram

Community Trekker

Joined:

Jun 5, 2017

Hi All,

Can anyone highlight what are the differences between using "Formula" and "Set Each Value"? What are the pros and cons?

5 REPLIES
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

@ram,
           If you use the test script I put together below, you will be able to realize starting at a = 6, that set each value is more efficient . 

a = 7; // Varied from 2 to 7 

dt = New Table(); 

dt << Begin Data Update; 
 
dt << Add Rows(10^a);

t1 = Tick Seconds(); 

dt << New Column("Test",Numeric,Continuous,Formula(5));

t2 = Tick Seconds();  

dt << End Data Update; 

Print(t2-t1);

t3 = Tick Seconds(); 

dt << New Column("Test",Numeric,Continuous,<< Set Each Value(a));

t4 = Tick Seconds(); 

Print(t4-t3);

  However, it is important to note that Set Each Value can only achieve one objective unlike Formula which is much more versatile. So I don't know the exact objective of performing this comparison, but this is one way to look at it

Best
Uday
ram

Community Trekker

Joined:

Jun 5, 2017

I was basically looking for functionality comparison between set each value vs formula function

txnelson

Super User

Joined:

Jun 22, 2012

Set Each Value places the value specified into each cell for the column it is pointed at.

The Formula element is a dynamic element, that allows for the specifying of a script of any complexity desired.  Additionally, a formula will be rerun anytime that components within the provided script(column values) are changed.

Jim
ram

Community Trekker

Joined:

Jun 5, 2017

but if you delete formula property, then based on your statement both should be same. but i guess there are more intrinsic differences.

markbailey

Staff

Joined:

Jun 23, 2011

I concur with Jim.

 

As an interactive JMP user, my only way to compute values when making a new column is to use a formula. As a scripter, I have a choice between using a formula or using myriad other means of populating the new column. I never use a formula in a script unless the values must update due to dependencies that might change after the script has run.

 

The decision is as simple as that IMO. But I would never tell someone else to follow my way.

Learn it once, use it forever!