Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Highlighted
kiza
Level II

Using Select Where in a script

Hello, I already looked around but couldn't find how to do this.

 

This is what I am trying to do

 

Data Table( "Untitled" ) << select where (contains(:column 1, "5_lbe/?")); 

Basically I have a bunch of data like this: 5_lbe12333, 5_lbe88837 (just to give an example) etc So it would be great if i could do it like in SQL with a SELECT LIKE statement but i cannot seem to find something similar in JMP

 

Any ideas?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
XanGregg
Staff

Re: Using Select Where in a script

You can use Starts With() instead of Contains() for that particular example. For more general matching, you can use JMP regex or pattern match functions.

View solution in original post

4 REPLIES 4
Highlighted
XanGregg
Staff

Re: Using Select Where in a script

You can use Starts With() instead of Contains() for that particular example. For more general matching, you can use JMP regex or pattern match functions.

View solution in original post

Highlighted
kiza
Level II

Re: Using Select Where in a script

Got it, thanks =)

Highlighted
mhalwi
Level III

Re: Using Select Where in a script

Hi Guys

need your help to comment on my script below. it is not working properly where im trying to do the data filter for the value with the correct test name only. im using Select Where and Contain/Start with method but only the numeric data is filtered and the filter for test name is not working.

Please help to comment. Your help is greatly appreciated!

f = Current Data Table() << Data Filter(
Location( {300, 196} ),
Mode( Show( 1 ), Include( 1 ) ),
Add Filter(
columns( :NUMERIC_RESULT, :TEST_NAME ),
Where( :NUMERIC_RESULT >= 5000 & :NUMERIC_RESULT <= 13000 ),
Select Where( Contains (:TEST_NAME, "ABC_0019" ),
Display( :NUMERIC_RESULT ),
Display( :TEST_NAME, Size( 204, 38 ), List Display )
),
)
)
Highlighted
ms
Super User ms
Super User

Re: Using Select Where in a script

Contains() would also work here, but unlike SELECT LIKE you cannot use wildcards.

The code

 

Data Table( "Untitled" ) << select where (contains(:column 1, "5_lbe"));
would not only select all rows that start with "5_lbe" but also rows with "5_lbe" at any position within the string. Starts With() is more specific.
Article Labels

    There are no labels assigned to this post.