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
Specifying "Between" / "Range" rule in I
-
- Premium Member
- Posts: 139
- Joined: Fri Apr 11, 2008 1:02 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 139
- Joined: Fri Apr 11, 2008 1:02 pm
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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"
Last edited by ray.wurlod on Tue Aug 06, 2013 4:31 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.