BookmarkSubscribeRSS Feed

Using Select Where in a script

kiza

Community Trekker

Joined:

May 8, 2012

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
XanGregg

Staff

Joined:

Jun 23, 2011

Solution

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.

4 REPLIES
XanGregg

Staff

Joined:

Jun 23, 2011

Solution

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.

kiza

Community Trekker

Joined:

May 8, 2012

Got it, thanks =)

mhalwi

Occasional Contributor

Joined:

Dec 12, 2017

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 )
),
)
)
ms

Super User

Joined:

Jun 23, 2011

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.