I have a main table (MT) and 2 aliases (AL1, AL2) to it. I mapped a table replacement for the main table (MT to ZT). During run time, all - main and 2 alias tables, gets replaced (MT, AL1 and AL2 becomes ZT). Is there any way to prevent replacing the alias tables (MT should become ZT and AL1, AL2 stay as AL1, AL2)? I am aware that Table mapping is just a string replacement during runtime. If anybody has a workaround and share it, it will be helpful.
Possible work-around:
Create a view of your MT table in the database (defined as: SELECT * FROM MT), include this view in your universe and create your aliases AL1 and AL2 based on this view.
As a best practice, you should never use the base table once it has been aliased. In other words, you should have not two but three aliases in your case. I would then suspect that you could to table-mapping on the alias and it would get only the value you provide. Can you try that and report back on the results?
Dave - I tried your suggestion before posting my problem. It did not work. I appreciate your response.
Andreas - I tried your solution using a view. It worked.
-Created an Alias (AMT) for main table (MT) in the database.
-Mapped MT to ZT
-Used AMT for intended (lookup) purposes.
-During run time MT became ZT and AMTs remained AMTs.
Another solution that worked given below (alternative to creating alias in database)
Created a dervied table (DMT - select * from maintable) in the Universe from main table (MT)
Aliased derived table (DMT) as two aliases - ADMT1, ADMT2
Mapped MT to ZT
Used ADMT1 and ADMT2 for intended (lookup) purposes.
During run time MT became ZT. ADMT1 and ADM2 were replaced by sub-query - though not appealing, functionally it was as good as database alias tables.