BookmarkSubscribeRSS Feed

where() clause with Contains() in Data Filter

vitali_pom

Community Trekker

Joined:

Jul 10, 2014

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
vitali_pom

Community Trekker

Joined:

Jul 10, 2014

Solution

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().

2 REPLIES
vitali_pom

Community Trekker

Joined:

Jul 10, 2014

Solution

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().

mhalwi

Occasional Contributor

Joined:

Dec 12, 2017

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