cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
owg
owg
Level III

Formula editor keeps adding parentheses that change the math

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

Re: Formula editor keeps adding parentheses that change the math

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:

 

  1. Select A.
  2. Click Multiply button.
  3. Select B.
  4. Click Multiply button.
  5. Press 1 and Enter.
  6. Click Subtract button.
  7. Select I.
  8. Click Multiply button.
  9. Select I.
  10. Click Multiply button.
  11. Select R.
  12. Select everything by clicking inside of the outer most rectangle. The rectangle should include everything so far.
  13. Click Subtract button.
  14. Select I.
  15. Click Multiply button.
  16. Select I.
  17. Click Multiply button.
  18. Select R.
  19. Click Multiply button.
  20. Select C.

The result is:

 

Capture.JPG

 

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.

View solution in original post

txnelson
Super User

Re: Formula editor keeps adding parentheses that change the math

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

View solution in original post

4 REPLIES 4

Re: Formula editor keeps adding parentheses that change the math

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:

 

  1. Select A.
  2. Click Multiply button.
  3. Select B.
  4. Click Multiply button.
  5. Press 1 and Enter.
  6. Click Subtract button.
  7. Select I.
  8. Click Multiply button.
  9. Select I.
  10. Click Multiply button.
  11. Select R.
  12. Select everything by clicking inside of the outer most rectangle. The rectangle should include everything so far.
  13. Click Subtract button.
  14. Select I.
  15. Click Multiply button.
  16. Select I.
  17. Click Multiply button.
  18. Select R.
  19. Click Multiply button.
  20. Select C.

The result is:

 

Capture.JPG

 

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.

txnelson
Super User

Re: Formula editor keeps adding parentheses that change the math

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
owg
owg
Level III

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.
owg
owg
Level III

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!