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
- :
- Help! Conditional Statements containing Missing Va...

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

Sep 22, 2014 8:17 AM
(2085 views)

I am trying to create a column that labels a pair of points

as falling into category “I”, “II”, “III”, or “IV”. The pair of points is

based off of two columns, and some cells have missing values. I am

certain my code is logically correct. Can anyone help me find a working solution?

Below are several of my JSL attempts:

For Each Row(Assign(:Quadrant_Running = If(Is

Missing(:Running_Y), Continue(), Is Missing(:Running_X), Continue(), If(:Running_Y

>= 3 & :Running_X >= 3, "I", If(:Running_Y > 3 &

:Running_X < 3, "II", If(:Running_Y < 3 & :Running_X <

3, "III", "IV"))))))

For Each Row(Assign(:Quadrant_Running = If(Is

Missing(:Running_Y), Continue(), Is Missing(:Running_X), Continue(), :Running_Y

>= 3 & :Running_X >= 3, "I", :Running_Y > 3 &

:Running_X < 3, "II", :Running_Y < 3 & :Running_X <

3, "III", "IV"))

I have also attempted using a conditional “Or” : If(Is

Missing(:Running_Y)|Is Missing(:Running_X), Continue())

And also: If(Is Missing(:Running_Y|:Running_X),

Continue()).

Thanks for any assistance!!!

1 ACCEPTED SOLUTION

Accepted Solutions

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

Sep 23, 2014 11:21 AM
(3798 views)

Solution

Actually, I think the **Continue()** from your original script is OK -- you just need to remove the **Assign()**.

Also, your second attempt (without the **Assign()**) is more compact:

For Each Row(

:Quadrant_Running = If(

Is Missing( :Running_Y ), Continue(),

Is Missing( :Running_X ), Continue(),

:Running_Y >= 3 & :Running_X >= 3, "I",

:Running_Y > 3 & :Running_X < 3, "II",

:Running_Y < 3 & :Running_X < 3, "III",

"IV"

)

)

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

3 REPLIES

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

Sep 23, 2014 11:14 AM
(1899 views)

Does this script do what you're looking for? I just removed the **Assign()** function and changed the **Continu****e()**'s to empty strings (""), so that Quadrant_Running will be a missing string when one or both of your X/Y columns is missing.

For Each Row(

:Quadrant_Running = If(

Is Missing( :Running_Y ), "",

Is Missing( :Running_X ), "",

If( :Running_Y >= 3 & :Running_X >= 3,

"I",

If( :Running_Y > 3 & :Running_X < 3,

"II",

If( :Running_Y < 3 & :Running_X < 3,

"III",

"IV"

)

)

)

)

)

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

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

Sep 23, 2014 11:21 AM
(3799 views)

Actually, I think the **Continue()** from your original script is OK -- you just need to remove the **Assign()**.

Also, your second attempt (without the **Assign()**) is more compact:

For Each Row(

:Quadrant_Running = If(

Is Missing( :Running_Y ), Continue(),

Is Missing( :Running_X ), Continue(),

:Running_Y >= 3 & :Running_X >= 3, "I",

:Running_Y > 3 & :Running_X < 3, "II",

:Running_Y < 3 & :Running_X < 3, "III",

"IV"

)

)

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

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

Oct 20, 2014 6:08 AM
(1899 views)

Thanks for your help guys!

The assign statement was more compact, and I ended up able to use the Continue() statement.

The issue was the settings on my column, I had not changed them to character values when I originally created the column. Doing so allowed the formula to run!