Yes it can be done.
Â
You have to start out the BAQ with the SaleRep table.
Next link the InvcHead table using only Customer.
then add other tables of your report.
If there is only one rep then FILTER InvcHead where InvcHead.SalesRepList BEGINS SalesRep.SalesRepCode
Â
If you are using more than one rep then use CALC fields for the different SalesRepCodes and then filter it in Crystal.
Â
See query phrase below
If you want to add a calc field to the BAQ for the SalesRepCode then use this formula.
If Num-Entries(InvcHead.SalesRepList, "~~") >= 1 then Entry(1,
InvcHead.SalesRepList, "~~") else ""
Â
Â
for each SalesRep no-lock , each InvcHead where (Â InvcHead.SalesRepList BEGINS SalesRep.SalesRepCode) no-lock , each Customer where (InvcHead.Company = Customer.Company and InvcHead.CustNum = Customer.CustNum) no-lock , each InvcDtl where (InvcHead.Company = InvcDtl.Company and InvcHead.InvoiceNum = InvcDtl.InvoiceNum) no-lock , each ShipTo where (InvcDtl.Company = ShipTo.Company and InvcDtl.CustNum = ShipTo.CustNum and InvcDtl.ShipToNum = ShipTo.ShipToNum) no-lock , each ProdGrup where (InvcDtl.Company = ProdGrup.Company and InvcDtl.ProdCode = ProdGrup.ProdCode) no-lock .
Â
You have to start out the BAQ with the SaleRep table.
Next link the InvcHead table using only Customer.
then add other tables of your report.
If there is only one rep then FILTER InvcHead where InvcHead.SalesRepList BEGINS SalesRep.SalesRepCode
Â
If you are using more than one rep then use CALC fields for the different SalesRepCodes and then filter it in Crystal.
Â
See query phrase below
If you want to add a calc field to the BAQ for the SalesRepCode then use this formula.
If Num-Entries(InvcHead.SalesRepList, "~~") >= 1 then Entry(1,
InvcHead.SalesRepList, "~~") else ""
Â
Â
for each SalesRep no-lock , each InvcHead where (Â InvcHead.SalesRepList BEGINS SalesRep.SalesRepCode) no-lock , each Customer where (InvcHead.Company = Customer.Company and InvcHead.CustNum = Customer.CustNum) no-lock , each InvcDtl where (InvcHead.Company = InvcDtl.Company and InvcHead.InvoiceNum = InvcDtl.InvoiceNum) no-lock , each ShipTo where (InvcDtl.Company = ShipTo.Company and InvcDtl.CustNum = ShipTo.CustNum and InvcDtl.ShipToNum = ShipTo.ShipToNum) no-lock , each ProdGrup where (InvcDtl.Company = ProdGrup.Company and InvcDtl.ProdCode = ProdGrup.ProdCode) no-lock .
--- On Wed, 3/4/09, DD <ddavis4569@...> wrote:
From: DD <ddavis4569@...>
Subject: [Vantage] RE: BAQ Report with Sales Rep Name
To: vantage@yahoogroups.com
Date: Wednesday, March 4, 2009, 4:21 PM
I am trying to create a BAQ report of Invoice Commissions with the Sales Rep Name on the report.
Â
InvcHead.SalesRepLi st has the sales rep code in the 1st entry.
I can do a Calc field to pull the Sales Rep Code from the list but I can not use it to link the SalesRep Table to the InvcHead Table.
If I join the tables with just the company then the BAQ will crash.
Â
Anyone know how to link the InvcHead table to the SalesRep Table in a BAQ?
Â
Thanks
Doug Davis
[Non-text portions of this message have been removed]