Fixed value in a lookup
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
Fixed value in a lookup
Is there any way of doing a lookup with a fixed value? I have a data set of price information, and I want to look up the "Buy" price and then the "Sell" price, but I can't specify "Buy" in one lookup link and "Sell" in another.
Would the "right" way to handle this be to split the look up data stream into two Lookup stages with filter conditions controlling which type of price goes into which Lookup stage?
Would the "right" way to handle this be to split the look up data stream into two Lookup stages with filter conditions controlling which type of price goes into which Lookup stage?
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm not sure what you're saying. Surely you're using something like "item number" as the lookup key, so one lookup could return buy price and another lookup could return sell price from the same source data? Of course, two copies of the reference data will be needed in memory as soon as you have two lookups. But each only needs two columns - one has item number and buy price, the other has item number and sell price.
Is this a sparse lookup, perchance?
Is this a sparse lookup, perchance?
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.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
Look up data looks like this:
Stream data has Date, Time, and I want to get the Buy price and Sell price for that hour. So I want to do one look up on Date, Time, "Buy" and one look up on Date, Time, "Sell". I've done it by splitting my look up data into two streams, one for "Buy" and one for "Sell", with each stream going to a different Lookup Stage.
Code: Select all
Date Time Type Price
2010-10-01 00:00 Buy 1.00
2010-10-01 00:00 Sell 1.10
2010-10-01 01:00 Buy 2.00
2010-10-01 01:00 Sell 2.20
2010-10-01 02:00 Buy 3.00
2010-10-01 02:00 Sell 3.30
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
I did that early on, but now I always put each lookup in a separate stage, so I can separate out the reject links and get clearer error messages.nitkuar wrote:You can also use only one Lookup stage with two reference links, having BUY data in one link and SELL in another.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: