Showing posts with label logic. Show all posts
Showing posts with label logic. Show all posts

Monday, March 12, 2012

Lookup table

I have a situation where I need to use the following logic. If an item is non-stocking at LOC1, the system checks LOC4 first to see if it is stocking at that location, LOC2 second, LOC3 third, etc. If no stocking LOC is found, the records remain unmodified.

Stocking LOC (in order of precedence)
Non-Stocking LOC 1 2 3 4 5

LOC1 LOC4 LOC2 LOC3 LOC5
LOC2 LOC4 LOC1 LOC2 LOC5
LOC3 LOC5 LOC4 LOC1 LOC2
LOC4 LOC1 LOC3 LOC2 LOC5
LOC5 LOC3 LOC4 LOC1 LOC2
LOC6 LOC4 LOC2 LOC1 LOC5 LOC3
Right now we have a whole series of IF statements to work through this logic. When we add a location, a lot of code needs to be changed. Is there a way to build this into a table and be able to do the lookup more effectively, and that would make it easier to add a location?

Thanks in advance.I'd propose a more normalized table with 3 fields:
Non_stocking_loc, stocking_loc, precedence

Given a non-stocking loc, it's easy to retrieve all stocking locs for it, ordered by precedence.

Lookup bug (altering caching breaks joins)

There is a bug in the Lookup components, that changing the caching mode breaks the join logic.This is even documented!
AFAICT, if you want the full join logic (where it matches on null values as well), you simply must use full caching everywhere, and install more memory as needed. :(
Does anyone know if this will be fixed with the next version, or in the release?

This is not a bug, as it is by design. If you would like to see a change in functionality please file a design change request in betaplace (or let me know if you can not and I will file one on your behalf.

Thanks,|||"Enabling memory caching breaks joins" seems to me like an annoying bug that is likely to bite newbies, even if they call it a "feature".
I cannot get into betaplace (I went around in circles with it for a while, trying to click on invisible buttons, and posting to the Microsoft SSIS beta newsgroups asking for help, and I never got any success).
If you could post it as a bug (or, um, "feature" that is likely to cause grief to users), that would be great.