Page 1 of 2

Lookup not matching

Posted: Mon Jan 26, 2009 11:16 am
by satya99
I have a source Hashed file

ex:

No1(key) No2 no3

100~8~T 205
100~9~T 305 405

I need to perform a look up against the same hashed file.

So i created a new hashed file from the source and split the key into


Noa(Key) Nob(Key) Noc(Key) No2 no3

100 8 T 205
100 9 T 305 405


Now i am performing a lookup.

when ever there is a match on 100~8~T then i need to have the same value 205 in 100~9~T(no3) so that my output should look like

ex:

No1(key) No2 no3

100~8~T 205
100~9~T 305 205(Changed from 405 to 205)

Any advice

Thanks in advance

** Note: Subject changed to be more descriptive - Content Editor**

Posted: Mon Jan 26, 2009 1:30 pm
by ray.wurlod
Do the lookup. If it is not found, make no change. If it is found, make the change.

Posted: Mon Jan 26, 2009 2:26 pm
by satya99
When i find a match on 100~8~T then i need to use value in no2 column i.e 205 and drop it in no3 column of 100~9~t(cross reference)


No1(key) No2 no3

100~8~T 205
100~9~T 305 405

Noa(Key) Nob(Key) Noc(Key) No2 no3

100 8 T 205
100 9 T 305 405

o/p

No1(key) No2 no3

100~8~T 205
100~9~T 305 205(Changed from 405 to 205)

Posted: Tue Jan 27, 2009 3:19 am
by ray.wurlod
Yeah. I understood that and provided the solution.

Code: Select all

If RefLink.NOTFOUND Then InputLink.TheValue Else RefLink.TheValue

Posted: Tue Jan 27, 2009 8:47 am
by satya99
Here is the output

No1(key) No2 no3

100~8~T 205 205(changed from '' to 205 aswell) this should not happen
100~9~T 305 205(Changed from 405 to 205)

Posted: Tue Jan 27, 2009 5:24 pm
by ray.wurlod
Post your actual derivation expressions.

Posted: Wed Jan 28, 2009 8:57 am
by satya99
IF lkp.NOTFOUND THEN scr.no ELSE lkp.no

I created the look up from the source, am i supposed to do that?

Posted: Wed Jan 28, 2009 7:23 pm
by ray.wurlod
In your original question you stated that you had already created the hashed file so I took it as given.

Posted: Thu Jan 29, 2009 8:09 am
by satya99
Well i created hashed file from source and doing a look up, but i am not getting the expected result.

Posted: Thu Jan 29, 2009 8:26 am
by chulett
Then it seems you're not populating your keys properly for the lookup. And that can include something as simple as trimming trailing spaces in your incoming values.

Posted: Thu Jan 29, 2009 8:58 am
by kandyshandy
Satya, Can you explain your requirements with more than 2 rows with different values for the key?

Posted: Thu Jan 29, 2009 9:15 am
by chulett
Yes, can you please provide examples of what you get from the lookup (the unexpected result) and examples of what your "expected result" would be in that case. Also, "View Data" on your hashed file and ensure that it looks like you've built it properly - as expected. Click inside the key values in the browser to ensure there's nothing tripping you up like trailing spaces there rather than in your incoming data.

Posted: Thu Jan 29, 2009 9:56 am
by satya99
Source is hashed file.

ex:

No1(key) No2 no3

combination 1

100~8~T 205
100~9~T 305 405

combination 2

200~7~T 101
200~9~T 201 202

This is how the output should loook like:

combination 1

100~8~T 205
100~9~T 305 205 (cross ref)


combination 2

200~7~T 101
200~9~T 201 101 (cross ref)

Posted: Thu Jan 29, 2009 10:31 am
by kandyshandy
Satya, To be more precise...

Your source hash file (1 file) contains data like this

100~8~T 205
100~9~T 305 405
200~7~T 101
200~9~T 201 202

And you want output like shown below in one target file?

100~8~T 205
100~9~T 305 205
200~7~T 101
200~9~T 201 101

So you are using the first part (100 or 200) to differentiate the combination?

Posted: Thu Jan 29, 2009 12:24 pm
by satya99
yes,