Part Number string issue in BAQ

Hello everybody,

I need a report that shows me the following:

  1. Part Number
  2. Part Description
  3. Lead Time
  4. Vendor Part Number
  5. Vendor Name

I’m using 4 tables.
table criteria set on just 1 table as seen in screenshot:

my query returns 28 additional rows. These ‘additional rows’ all have the same issue.
it SHOULD return 7679 rows but instead is returning 7707 rows.

I CANNOT figure out how to fix this. Can someone please offer your expertise help?

we have a Part Number that = 11566
and we have a Supplier Part Number that = 00011566

For some reason it’s crossing the two.

In the image below,

the image directly below where I’ve highlighted Supplier Part Number, this is correct:

when I search by Part Number it shows me BOTH but this is not correct.

Thank You!!!

Here’s my Query Phrase:
select
[Part].[PartNum] as [Part_PartNum],
[Part].[PartDescription] as [Part_PartDescription],
[PartPlant].[LeadTime] as [PartPlant_LeadTime],
[VendPart].[VenPartNum] as [VendPart_VenPartNum],
[Vendor].[Name] as [Vendor_Name]

from Erp.PartPlant as [PartPlant]
inner join Erp.Part as [Part] on
PartPlant.Company = Part.Company
and PartPlant.PartNum = Part.PartNum
left outer join Erp.VendPart as [VendPart] on
Part.Company = VendPart.Company
and Part.PartNum = VendPart.PartNum
full outer join Erp.Vendor as [Vendor] on
VendPart.Company = Vendor.Company
and VendPart.VendorNum = Vendor.VendorNum
where (PartPlant.SourceType = ‘P’
and PartPlant.Plant = ‘MfgSys’)

Try changing your join to the Vendor table to a left-outer.

thank you however left outer join returns the same results :slightly_frowning_face:

VendPart can have multiple records for the same part # which could account for you returning more rows that you are expecting.

How many records do you return if you remove the vendor tables completely?

2 Likes

I removed the two vendor tables and the BAQ returns 7679 rows.

when I add the vendor tables back in, the BAQ returns 7707 rows.

Thank you.

This indicates you have multiple entries for the same part in VendPart. This is normal, as supplier pricing can change over time, as well as the possibility of having multiple supplier part numbers point to a singular part in your system.

You would want to determine if there are any reliable criteria you can place on your VendPart table to return the singular record for each part number you want to reference and display the supplier part.

2 Likes

Maybe join PartPlant direct to VendPart? Company, PartNum, VendNum (edited, didn’t need Plant for this)


4 Likes

Still trying to figure this out. Probably reaching out to Epicor rep for help with this one.

Try this
BAQForExport_PartVendorList.baq (25.7 KB)

Screenshot…
image

2 Likes

If you row count goes up, then there is either a bad join or you have some duplicate records in the new table. In this case, I think your joins are solid, so it must be multiple records in the VendPart and/or Vendor table.

Do you have multiple Sites? Does the VendPart table have multiple references for the same PartNum?

2 Likes

yeah we have multiple sites. I’ve hidden 1. that is not the issue.

it looks like I have seven rows with this exact same issue.

here’s a different part number.

from looking at this, it appears OUR part number = 11570
the supplier PN = 00011570

it should know Part 11570 is different from supplier Part which is 00011570
but its mixing the two.

In this example the correct PN is 11570 and the supplier PN is 00011570

1 Like

Made one edit - I left out VendPartNum in the original - see if this helps
BAQForExport_PartVendorList.baq (25.8 KB)

Here’s the psuedocode:

/*
 * Disclaimer!!!
 * This is not a real query being executed, but a simplified version for general vision.
 * Executing it with any other tool may produce a different result.
 */
 
select 
	[PartPlant].[Company] as [PartPlant_Company],
	[PartPlant].[Plant] as [PartPlant_Plant],
	[PartPlant].[PartNum] as [PartPlant_PartNum],
	[Part].[PartDescription] as [Part_PartDescription],
	[Part].[IUM] as [Part_IUM],
	[Part].[PUM] as [Part_PUM],
	[Vendor].[VendorID] as [Vendor_VendorID],
	[Vendor].[Name] as [Vendor_Name],
	[VendPart].[VenPartNum] as [VendPart_VenPartNum],
	[PartPlant].[LeadTime] as [PartPlant_LeadTime]
from Erp.PartPlant as PartPlant
inner join Erp.VendPart as VendPart on 
	PartPlant.Company = VendPart.Company
	and PartPlant.PartNum = VendPart.PartNum
	and PartPlant.VendorNum = VendPart.VendorNum
inner join Erp.Part as Part on 
	VendPart.Company = Part.Company
	and VendPart.PartNum = Part.PartNum
inner join Erp.Vendor as Vendor on 
	VendPart.Company = Vendor.Company
	and VendPart.VendorNum = Vendor.VendorNum
order by PartPlant.Company, PartPlant.Plant, PartPlant.PartNum
1 Like

Those are two distinct records. I wouldn’t get too hung up on what the filter you are using there is doing. That looks like the filter was based on a “contains” rather than an “equal”. Your joins don’t work in that same fashion.

On the surface, it looks like one of your users accidentally put this part in two different ways. You have defined BOITH 11570 and 00011570 in your Part Master and I would guess only one of those is supposed to exist. Granted, this is a bug asumption, but with both the part number and description being so similar, that’s my wager.

2 Likes

If it “Matched” This would be populated. It’s not. So it’s not matching those two part numbers. You have a left join, which means it will be empty if there is no match.

1 Like

Not knowing the exact relationship of your data so it could have an impact, I would try to construct the BAQ as follows with the existing filters. My sequence of tables would be Part, Part Plant, Vendor, and Vendor Part Number with an Inner Join between Part and Part Plant then use an Outer Join for the other two Relationships.

1 Like

Trying this now. Thank U so much! I’m going to set some table criteria to remove duplicate rows. Stay tuned. I will continue to update until resolved.

Thank you all for your support! Much appreciated.

Party|20pxx20px

1 Like

How would I do this exactly?

‘determine if there are any reliable criteria you can place on your VendPart table to return the singular record for each part number you want to reference and display the supplier part.’

Thanks

You have to know your data. Look at the tables and see what’s there.

Yes! I agree with this. I think this could be the issue. Investigating now.

The BAQ I uploaded has no outer joins…it’s a straight one-to-one so probably shouldn’t have any dups. If PartPlant’s Company/PartNum/VendorNum find a hit in VendPart on the same fields, you should be good.

Unless I bolluxed up the BAQ which is entirely possible.