Page 1 of 1

lookup with two values

Posted: Sun Dec 27, 2009 10:48 pm
by dnat
Hi,

I have to lookup a hour dimension table and get the sequence id for the same

For ex, i have the time like this

01:10

And in the dim table, i have values like this

Seq_i|hr start time|hr end time
1111|01:00|01:59

So i need to get the value 1111 since my input 01:10 is in between hr start time and hr end time. Can you suggest how to do this?.

Posted: Mon Dec 28, 2009 12:11 am
by nagendradsx
can you triy with rangelook up if you have 8

Posted: Mon Dec 28, 2009 12:50 am
by gssr
Hope this wil work,
1.Convert the start and end time to Int datatype (i.e., 1.00-->60 and 1.59 --> 119)
Similarly convert the same in your source file.

2. Try to get the matched constraint that lookup with those range of records
:idea:

Posted: Mon Dec 28, 2009 12:54 am
by gssr
gssr wrote:Hope this wil work,
1.Convert the start and end time to Int datatype (i.e., 1.00-->60 and 1.59 --> 119)
:idea:
Use the function " Minutes FromTime"

Posted: Mon Dec 28, 2009 5:28 am
by dnat
Try to get the matched constraint that lookup with those range of records
---how to lookup for those ranges.

Posted: Mon Dec 28, 2009 6:09 am
by srinivas.g
Put lookup condition like:

time(reference)<hr start time and time(referencelink)>hr end time

Posted: Mon Dec 28, 2009 7:58 am
by chulett
I would build the lookup using truncated values since all that matters is the hour value. Then no 'range' lookup would be required.