Data Reoccurring Issue

Well that makes this fun.

I added two new tables (JobOper and PORel)
I removed PartOpr
I added more fields
I joined SubShipD to PORel
I joined PORel to PODetail

You will have to add the OpCode part back on the JobOper.OpCode field.
where (JobOper.OpCode >= ‘200’ and JobOper.OpCode <= ‘222’)

I resorted the tables to the order below (yellow number) that lets the Left join be on the correct table.

select 
	[SubShipD].[PONum] as [SubShipD_PONum],
	[SubShipD].[PartNum] as [SubShipD_PartNum],
	[SubShipD].[POLine] as [SubShipD_POLine],
	[SubShipD].[PORelNum] as [SubShipD_PORelNum],
	[JobOper].[ActBurCost] as [JobOper_ActBurCost],
	[JobOper].[ActLabCost] as [JobOper_ActLabCost],
	[JobOper].[DocUnitPrice] as [JobOper_DocUnitPrice],
	[JobOper].[EstUnitCost] as [JobOper_EstUnitCost],
	[JobOper].[OpCode] as [JobOper_OpCode],
	[JobOper].[PartNum] as [JobOper_PartNum],
	[PODetail].[DocUnitCost] as [PODetail_DocUnitCost],
	[Vendor].[VendorID] as [Vendor_VendorID],
	[Vendor].[Name] as [Vendor_Name],
	[JobOper].[OprSeq] as [JobOper_OprSeq],
	[SubShipD].[OprSeq] as [SubShipD_OprSeq]
from Erp.SubShipD as SubShipD
inner join Erp.JobOper as JobOper on 
	SubShipD.Company = JobOper.Company
And
	SubShipD.JobNum = JobOper.JobNum
And
	SubShipD.AssemblySeq = JobOper.AssemblySeq
And
	SubShipD.PartNum = JobOper.PartNum
And
	SubShipD.OprSeq = JobOper.OprSeq

left outer join Erp.PORel as PORel on 
	SubShipD.Company = PORel.Company
And
	SubShipD.PONum = PORel.PONum
And
	SubShipD.POLine = PORel.POLine
And
	SubShipD.PORelNum = PORel.PORelNum

left outer join Erp.PODetail as PODetail on 
	PODetail.Company = PORel.Company
And
	PODetail.PONUM = PORel.PONum
And
	PODetail.POLine = PORel.POLine

left outer join Erp.Vendor as Vendor on 
	PODetail.Company = Vendor.Company
And
	PODetail.VendorNum = Vendor.VendorNum

Hello Ken,

The costs in JobOpr are not any close to the quoted cost. So I think the quote tables need to be added.

Thank you,

Tracy

OK we can get there.

Now add the following tables in this order.
JobHead
QuoteDtl
QuoteOpr

Left join on QuoteDtl and QuoteOpr

I would remove the distinct on the BAQ as well until the end. We want to see why there are duplicates.

Once you have added the table you will get “duplicates” due to the nature of the tables. You will need to add another join from the SubShipD to QuoteOpr on PartNum and Company.

If there are still duplicates show the QuoteOpr OprSeq in the query are the multiple OprSeq per quote on parts that are being contracted out?

QuoteOpr also has a SubContract flag, is that yes?

image

image

The newly added tables are connected themselves but the quote information cannot be shown…
I checked the links in between the tables, they are all good…

Thanks,

Tracy

Do you have the ability to do a webex?

That would suggest that the jobs don’t have a link to the Quote.

Okay, distinct is removed.

yes, there is a subcontract flag in QuoteOpr table.
Also, I would need the quote date from QuoteHead table.Maybe it can be added in between jobhead and quotedtl??

thank you,

Judy

No, I do not have access to Webex…sorry…

We can tackle that in a bit. The JobHead has the QuoteNum and QuoteLine fields. If it is blank then we are going to have a hard time making the jump to the rest of the query.

I have a Skype account. let me get something set up.

Please send me your email at ken.nash(the at symbol)embedtek.net

I have had an assembled BAQ made, i mean the quote part and PO part, but the problems are duplicating, wrong matches… please see the attachment

i know it would be so much more efficient by talking instead of typing, it is not so convenient for me to use either conference meeting or video call in the big office…

TH-TEST5.baq (101.3 KB)

thank you,

We don’t use the quote table, so it is hard for me to troubleshoot the query past the joboper table.
That is why I am asking to do a call, as would be a lot quicker than us going back and forth with me being blind to the data, and you trying something that isn’t working. I am guessing 15 minutes or so.

What you have just sent is not what we were talking through, more of combining the two initial baqs, but with a few changes. That will cause duplicates on the join of the inner queries, which you already are seeing. You need to know the JobNum, JobOpr, AssemblySeq associate to the PODetail. Otherwise how do you know which PONum, Part is the correct one? That is what the role of the SubShipD, it helps to join those tables.

I know I would like to do call; could you do a at 5:00 PM? have to take your off-work time.
My cell phone# is 216-318-7519 as our office phone will be turned off after 5.

thank you very much.

is that CST? I can do that.

Hello Ken,

I have working on the BAQ since yesterday. And I found that the RFQ tables are not a good option as expect RFQItem table, the others actually do not store real information in it or it cannot be put with Quote Tables. i know this sounds weird.

Yesterday, I found that the RCVDTIL table has the POnum and unit cost. The only it has not worked out is the duplicating issue. could you please take a look at this?

Appreciate your help.
TH-TEST10.baq (101.3 KB)

Is the Quote information correct. When we talked you weren’t 100% sure.

Yes, the quote information is correct.

Is this the screen where the quote is created? If so, we need to be in the JobMtl table.

Yes, this is the screen i have.

I find the only reason that the PO#s are duplicating maybe because there is no table which contain both quote# and PO# . If so, the PO#s could be eliminated.

thank you,