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
- :
- Step function

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
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jun 8, 2011 3:15 PM
(834 views)

i=97;

print(i,Step( i, 20, "error1", 95, "M03", 125, "error2", 185, "M06", 215, "error3", 370, "M12", 400, "error4" ));

produces:

97

"error1"

as output in the log.

Shouldn't it produce:

97

"M03"

instead, since 95 is the greatest x in the list that is <= 97?

Can anybody advise what I'm doing wrong?

Thanks.

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jun 9, 2011 7:05 AM
(780 views)

I believe that is just of question of interpretation - kind of like a flexible floor() function with a list:

It is correct - returning:

(95) is the greatest x value in the list that is less than or equal to the x (97) specified as the first argument.

Best,

-Matt

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Jun 9, 2011 7:09 AM
(780 views)

i = 97;

stepi = Match( Step( i, 20, 20, 95, 95, 125, 125 ),

20, "twenty",

95, "ninety five",

125, "hundred twenty five"

);

Show( i, stepi );