Hi,
this is the continuity from here:
https://www.accessforums.net/showthread.php?t=67142
there I am trying to create the best efficient relational database model.
Here i would like to find out the solution for lookup within the fact table.
I have summary table with IDs(not Uniques!) and a lot of attributes like: name and surname, sending date, employeeID, DocumentID,Client_Nr_FK etc.
and additionally i have second table filled manually by administrator - this is a lookup table or dictionary table you can call it like that.
ID (the same as in Fact Table), director, area and e-mail. ID is a field which should match with ID field in Summary Table.
And know i need a macro or query or something like that which will be checking all rows in my Fact table which are macthing with my lookup table values.
Example:
Fact Table:
UniqueID , ID , Name_And_Surname , Area , Sending Date, EmployeeID, DocumentID, Client_Nr_FK
1, 1001, Pawel X , Wroclaw, 2017-07-25 , 5 , 2 , 1
2, 1001, Pawel X , Wroclaw, EMPTY HERE, 5 , 2 , 1
LookUp table:
UniqueID, Director, Area, E-mail
1001, Michal Z, Poznań, a@interia.pl
1001, Michal Z, Warsaw , b@interia.pl
1001, Michal Y, Wroclaw, c@interia.pl
Area is a text value unfortunately, i could not force business to change it.
But it doesnt matter for now, i have to have clear idea in my mind how to solve this difficult technical problem.
So my macro should:
1. Check all rows if Sendind Date is empty (so only UniqueID = 2 in example above because Sending date is empty here)
2. If yes should be sending email (reminder) for specific criteria:
- find in lookup table exact machting ID
- check the area for found ID -if it is the same as in Fact Table --> send for given email
So here e-mail should be send for E-mail c@interia.pl because Area and ID is the same as in Fact table...
Every hint from you guys here will be most welcome,
Best Wishes,
Jacek Antek