Page 1 of 1

Specifying "Between" / "Range" rule in I

Posted: Mon Aug 05, 2013 8:47 pm
by Maximus_Jack
Hi
how to specify in the rule definition to find range operation for a data source?
for example if i want to find whether a column "column_a" has values in the range between "1 to 9"

i tried( column_a >=1 and column_a < 10 )
and column_a matches_regex '[1- 9]'

both are not working, can somebody please help me ?

thanks
MJ

Posted: Tue Aug 06, 2013 2:08 am
by ray.wurlod
What does "not working" mean here? Depending on the data type, both of the expressions you provided are valid.

Posted: Tue Aug 06, 2013 8:48 am
by Maximus_Jack
hi ray, thanks for responding, the problem is, i'm trying to translate the below query into a rule, but i'm getting different row counts

query
=====
select count(1)
from table1
where col1 is null
and col4 = 'orange'
and column_a between 1 and 9
and col2 = "apple"

Data rule
======
if ( trim(col1)= ''
and col4 = 'orange'
and (column_a >= 1 and column_a <=9)
)
then
col2 = 'apple'

where i'm going wrong here, note: column_a is integer

Posted: Tue Aug 06, 2013 4:29 pm
by ray.wurlod
Try using an EXISTS test on col1

Code: Select all

(NOT EXISTS col1) AND col4 = "orange" AND column_a >= 1 AND column_a <= 9 AND col2 = "apple"