Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
vitali_pom
Level I

where() clause with Contains() in Data Filter

Hi,

When I try to do the following, I get an exception:


dt1 << Data Filter(


  add Filter(


  columns(:MyCol),


  Where( contains(:MyCol, "A12") > 0)


  ),


  mode(show(1))


) << invert row selection;



And I get the following exception:


The WHERE clause has not been correctly specified. in access or evaluation of 'Greater'



How to accomplish what the code tries to do properly?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
vitali_pom
Level I

Re: where() clause with Contains() in Data Filter

Figured it out:

I guess the problem is that Data Filter Doesn't understand anything but explicit comparison (==) between columns and strings, just like it's GUI.

What I found as the solution is selecting the rows with Select Where().

View solution in original post

2 REPLIES 2
Highlighted
vitali_pom
Level I

Re: where() clause with Contains() in Data Filter

Figured it out:

I guess the problem is that Data Filter Doesn't understand anything but explicit comparison (==) between columns and strings, just like it's GUI.

What I found as the solution is selecting the rows with Select Where().

View solution in original post

Highlighted
mhalwi
Level III

Re: where() clause with Contains() in Data Filter

Hi Vitali,

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 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!

df = 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 )
),
)
)
Article Labels

    There are no labels assigned to this post.