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
- :
- JSL: What to use for new columns, Formula or Set Each Value? Pros and Cons?

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

Highlighted
##

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

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

Sep 12, 2018 12:27 PM
(4246 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 5

Highlighted
##

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

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

Created:
Sep 12, 2018 1:27 PM
| Last Modified: Sep 12, 2018 1:29 PM
(4236 views)
| Posted in reply to message from ram 09-12-2018

@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

Highlighted
##

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

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

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

Highlighted
##

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

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

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

Highlighted
##

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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Highlighted
##

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

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

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!

Article Labels

There are no labels assigned to this post.