Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi LOJ's to look-up table or aliases of that table?

Status
Not open for further replies.

pvirsf

Technical User
Aug 30, 2004
35
US
I am pretty new to CR running CR 9.2. Can you have multiple LOJ's to the same index field in a table used to lookup info to be associated with various other primary tables? e.g. look-up product data for a product.id, where the id is stored in other tables. The relationships might be:
Sale.id = Product.id with LOJ
Opportunity.id = Product.id with LOJ
Demo.id = Product.id with LOJ

or would one have to set-up aliases of Product for each additional look-up, 2 aliases in this example?
 
I use Crystal 8.5 and can't link to one table from multiple tables. What you can do is add table "Product" multiple times with alias name. Link Oppotunity.id to Product.id and link Demo.id to Product_Demo.id where Product_Demo is an alias name for table Product.

MrBill
 
thks bill. Thats what I suspected. It makes managing the different variable names in other parts of the report challenging. One way I thought of is to put a formula in details a, before the looked-up fields are used in details b, that tests for the look-up alias used and assigns the looked up fields from the alias to the standard variables being used subsequently in formulas or printing. Does that sound like a smart way to do it?
 
Hi,
Perhaps you could use the Product_Id table as the first table in the link chain and link it to the other tables that need its info..Depending on your database, that could slow performance down, but would avoid the multiple aliases..( You may have to use a right outer join to handle those cases where no matching ID exists.)
However, if the other tables need to link to each other it could cause a problem.

Haven't tried it, but seems like it should work..
[profile]

 
You can move the alias table values into variables if this would simplify some of your formulas. Since I don't really know what you are doing with your formulas etc. I can't really say what is the best way to go.

Good luck.
MrBill
 
thks for the post, I'll think about that. May create mirror problems because of primary tables LOJ'd to Sale, Opportunity, and Demo. May help perfomance if I could select where Product.var in [x to y], then let it provide records from Sale, Opportunity, and Demo based on Product.id. I'll check into it. Have a great weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top