lookup with two values

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

lookup with two values

Post 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?.
nagendradsx
Participant
Posts: 1
Joined: Sun Nov 08, 2009 7:40 am
Location: da
Contact:

Post by nagendradsx »

can you triy with rangelook up if you have 8
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post 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:
RAJ
gssr
Participant
Posts: 243
Joined: Fri Jan 09, 2009 12:51 am
Location: India

Post 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"
RAJ
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

Post by dnat »

Try to get the matched constraint that lookup with those range of records
---how to lookup for those ranges.
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

Put lookup condition like:

time(reference)<hr start time and time(referencelink)>hr end time
Srinu Gadipudi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply