turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- JSL: What to use for new columns, Formula or Set Each Value? Pros and Cons?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 12, 2018 12:27 PM
(401 views)

Hi All,

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

5 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 12, 2018 1:27 PM
(391 views)

@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

Uday

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 13, 2018 6:01 AM
(356 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 13, 2018 6:21 AM
(354 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 13, 2018 7:16 AM
(345 views)

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 14, 2018 6:34 AM
(326 views)

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!