Page 1 of 1

Key Expression

Posted: Fri Jun 22, 2007 1:37 am
by cosec
Hi,

I have two Keys in My Lookup Table. I Load My input data only by checking the first column in the lookup table. The value of the other column is used for calculations. It is highligted in red...how can i correct this ?

Posted: Fri Jun 22, 2007 2:03 am
by JoshGeorge
If you don't want to use the second column in the lookup table, then uncheck key option for that column. Isn't it that easy? That will get rid of your "highlighted in red" problem. Plus you can retrieve the second column as an output incase of a successful look up and use for your calculations further.

Posted: Fri Jun 22, 2007 2:04 am
by singhald
Hi Buddy,

you can only make thouse column key which you are using to lookup(mapping). just make your red column to not-key column in table definition. thats all.

it will not show that coloumn in red.

Deepak

Re: Key Expression

Posted: Fri Jun 22, 2007 2:35 am
by cosec
unfortunately it's not that straight forward....I have tried it that way...but when I uncheck it the Hash File does not get updated.
cosec wrote:Hi,

I have two Keys in My Lookup Table. I Load My input data only by checking the first column in the lookup table. The value of the other column is used for calculations. It is highligted in red...how can i correct this ?

Posted: Fri Jun 22, 2007 2:54 am
by shiva459
Based on your reply,I'm assuming your lookup data is in the hashed file. You cannot change the keys in hashed file. If you have defined two columns as key columns while loading you have to use the same columns as keys while reading. Else, you will get incorrect data.

Other option will be to load data into a table without constraints and have non-unique index defined on the lookup column.

Posted: Fri Jun 22, 2007 3:20 am
by cosec
Hi Shiva,
I need to change the value of the incoming second key based on the look up....and havent figured it out yet...trying different scenarios
shiva459 wrote:Based on your reply,I'm assuming your lookup data is in the hashed file. You cannot change the keys in hashed file. If you have defined two columns as key columns while loading you have to use the same columns as keys while reading. Else, you will get incorrect data.

Other option will be to load data into a table without constraints and have non-unique index defined on the lookup column.

Posted: Fri Jun 22, 2007 8:25 am
by ray.wurlod
The second key is red because the GUI doesn't permit doing this. Even so, it will compile and run successfully if the key expression is syntactically valid. Right click and choose Validate Expression.

Posted: Mon Jun 25, 2007 7:27 am
by cosec
Well the syntax is all fine....but the thing is I dont want the second key to be validated just want it passed to the output....


ray.wurlod wrote:The second key is red because the GUI doesn't permit doing this. Even so, it will compile and run successfully if the key expression is syntactically valid. Right click and choose Validate Expressio ...

Posted: Mon Jun 25, 2007 7:51 am
by chulett
Then you'll need to use a UV stage over the top of the Hashed File. Hashed files require all Key fields to be use. All.