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
- :
- unable to eval a formula in a table

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

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

unable to eval a formula in a table

Feb 24, 2019 6:25 AM
(1970 views)

Hi all ,

I am trying to eval a expression in a formula but it seems to have error, can someone help me ?

My formula is below:

```
dtmaster << New Column("_SBL",
Numeric,
Formula(
(Match( :Selected_Sigma,
"Flag_3Sigma",Eval expr(((column(8)- column(6)) / 3) * 3 + column(6)),
"Flag_4Sigma",Eval expr( ((column(8)- column(6)) / 3) * 4 + column(6)),
"Flag_5Sigma",Eval expr(((column(8)- column(6)) / 3) * 5 + column(6)),
"Flag_6Sigma",Eval expr(((column(8)- column(6)) / 3) * 6 + column(6))
)))
,
Format( "Percent", 12, 2 )
)
```

6 REPLIES 6

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

Re: unable to eval a formula in a table

@kuannygoh ,

May I ask why you are trying to using eval function ? What are you actually trying to achieve ?

If you absolutely want to use the Eval Expr, kindly take a look at the scripting index ecample shown below:

Best

Uday

Uday

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

Re: unable to eval a formula in a table

yes, try removing the EvalExpr. It isn't needed and is causing at least part of the problem you are seeing.

Craige

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

Re: unable to eval a formula in a table

Hi I tried removed, but it still shows error. I am trying to match the column of selected sigma with formula.

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

Re: unable to eval a formula in a table

I am trying to match the column of selected sigma with formula.

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

Re: unable to eval a formula in a table

Hi, the error shown is as attached in image

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

Re: unable to eval a formula in a table

```
dt = Open( "$sample_data/big class.jmp" );
dt << New Column( "H_OR_W",
Numeric,
Formula(
(Match( :sex,
"F", height, // height
"M",
Column( 5 )[] // weight
))
),
Format( "Percent", 12, 2 )
);
```

if you use an explicit column name, like height, above, then JMP knows to index with the current row. If you use the column function to specify the column, you still need to index into the column. You can use the empty subscript shown above to tell JMP to use the current row. See the weight example above.

Craige