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

- JMP User Community
- :
- Discussions
- :
- Formula editor keeps adding parentheses that change the math

- 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

Apr 9, 2020 10:21 AM
(677 views)

While entering a formula, at a certain point the editor adds parentheses automatically that change the formula. It's repeatable, always when I add the second minus sign in this formula:

A * B * (1- I * I * R) - I * I * R * C

The added parentheses prevent me from entering the correct formula. BOX here means the little box that appears in the editor when I hit the second minus sign:

A * B * ( (1-I * I * R) - BOX )

This would multiply the contents of BOX by A*B which is incorrect. (All variables refer to valid columns.)

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

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

Created:
Apr 9, 2020 10:47 AM
| Last Modified: Apr 9, 2020 10:50 AM
(671 views)
| Posted in reply to message from owg 04-09-2020

There are a couple of basic behaviors to keep in mind when you use the Formula Editor.

- The blue rectangle surrounds the focus for the next action. Use the mouse pointer or arrow keys to ensure that only the part of the current formula is surrounded by the blue rectangle for the next action.
- The act of selecting a data column enters it into the current empty rectangle. Double-clicking a data column replaces what is in the current rectangle.
- The act of selecting a function from the left-most list or clicking a button along the top is to use what is in the rectangle as an argument.

I assume that **A**, **B**, **C**, **I**, and **R** are data column names. To make your formula, follow these steps:

- Select
**A**. - Click Multiply button.
- Select
**B**. - Click Multiply button.
- Press
**1**and**Enter**. - Click Subtract button.
- Select
**I**. - Click Multiply button.
- Select
**I**. - Click Multiply button.
- Select
**R**. - Select everything by clicking inside of the outer most rectangle. The rectangle should include everything so far.
- Click Subtract button.
- Select
**I**. - Click Multiply button.
- Select
**I**. - Click Multiply button.
- Select
**R**. - Click Multiply button.
- Select
**C**.

The result is:

Another way is to copy the expression **:****A * :B * (1- :I * :I * :R) - :I * :I * :R * :C** after inserting the colon (":") in front of the column names, double-click the initial empty blue rectangle in the Formula Editor, paste the expression, and press Enter.

Learn it once, use it forever!

Highlighted

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

I will also add, that at anytime during the construction of the formula that you want to specially clarify what you want, if you double click on the formula, you will enter into the scripting editor, and you can directly type in additions, and/or make corrections to the code that JMP has built.

Jim

4 REPLIES 4

Highlighted

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

Created:
Apr 9, 2020 10:47 AM
| Last Modified: Apr 9, 2020 10:50 AM
(672 views)
| Posted in reply to message from owg 04-09-2020

There are a couple of basic behaviors to keep in mind when you use the Formula Editor.

- The blue rectangle surrounds the focus for the next action. Use the mouse pointer or arrow keys to ensure that only the part of the current formula is surrounded by the blue rectangle for the next action.
- The act of selecting a data column enters it into the current empty rectangle. Double-clicking a data column replaces what is in the current rectangle.
- The act of selecting a function from the left-most list or clicking a button along the top is to use what is in the rectangle as an argument.

I assume that **A**, **B**, **C**, **I**, and **R** are data column names. To make your formula, follow these steps:

- Select
**A**. - Click Multiply button.
- Select
**B**. - Click Multiply button.
- Press
**1**and**Enter**. - Click Subtract button.
- Select
**I**. - Click Multiply button.
- Select
**I**. - Click Multiply button.
- Select
**R**. - Select everything by clicking inside of the outer most rectangle. The rectangle should include everything so far.
- Click Subtract button.
- Select
**I**. - Click Multiply button.
- Select
**I**. - Click Multiply button.
- Select
**R**. - Click Multiply button.
- Select
**C**.

The result is:

Another way is to copy the expression **:****A * :B * (1- :I * :I * :R) - :I * :I * :R * :C** after inserting the colon (":") in front of the column names, double-click the initial empty blue rectangle in the Formula Editor, paste the expression, and press Enter.

Learn it once, use it forever!

Highlighted

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

I will also add, that at anytime during the construction of the formula that you want to specially clarify what you want, if you double click on the formula, you will enter into the scripting editor, and you can directly type in additions, and/or make corrections to the code that JMP has built.

Jim

Highlighted
##

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

Re: Formula editor keeps adding parentheses that change the math

Thanks. Before I started scripting the new box made no sense as it doesn't allow selecting columns by the menu on the right and you have to type their names proceeded by a colon. Now that I know the new box is the scripting editor it makes sense.

Highlighted
##

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

Re: Formula editor keeps adding parentheses that change the math

Thanks. I got two general tips out of your solution. First is how to take advantage of the auto parentheses (i.e. don't use '(' on the keyboard, just enter the first operand). The second is that you can click in the field outside of the largest box, I would never have thought of trying that!

Article Labels

There are no labels assigned to this post.