Page 1 of 1

Has file lookup using less than or rather than

Posted: Tue Feb 06, 2007 3:12 am
by nibble
I have a hash file containing three key colums, one of the columns is a number column containing 100, 200, 500 etc. (sorted)
The main input column mapped to the hash file contains numbers between 0 and 1000.
I want to be able to map to the correct column in the hash file using less than or grather than.
Let's say input value is 124.
On the mapping column, I change the input value to a string like this:
>124. The correct row found should be the row with 200 in its key number field.
Because data is sorted, the transformer will find the first row with a key value > 124... Is this possible ?

If I use multiple row lookup using a UniVerse stage, can I select one row from several rows by using less than / grater than or other functions ?

Chris.

Posted: Tue Feb 06, 2007 3:17 am
by kumar_s
If you make a search on 'Range lookup' you can get an idea of how to go about this.
One way is you can populate the hash file in such a way that the values are continues, ie., 100 to 200 will point to 200 and 200 to 500 will point 500.
As you say, you can use Universe stage for join query for the range given in condition.

Posted: Tue Feb 06, 2007 3:31 pm
by ray.wurlod
With a UV stage you can specify whatever SQL you need to do your job; for example, if you sort by the lookup key and don't use multi-row return, you would get the highest value that meet your criteria.