Production Units Good vs Rejected

Hi Guys, trying to extratc information about number of part produced per month and also how many were rejected. Raised the BAQ below but somehow number dont look convincing, which are the best tables to get this information?

select
[LaborDtl].[Company] as [LaborDtl_Company],
[FiscalPer].[FiscalYear] as [FiscalPer_FiscalYear],
[FiscalPer].[FiscalPeriod] as [FiscalPer_FiscalPeriod],
(SUM(LaborDtl.LaborQty)) as [Calculated_ProductionQty],
(SUM(LaborDtl.ScrapQty+LaborDtl.DiscrepQty)) as [Calculated_ScrapQty],
((
CASE
WHEN SUM(LaborDtl.LaborQty) = 0 THEN 0
ELSE
((SUM(LaborDtl.LaborQty) - SUM(LaborDtl.ScrapQty + LaborDtl.DiscrepQty))
* 100.0
/ SUM(LaborDtl.LaborQty))
END
)) as [Calculated_YieldPct]

from Erp.LaborDtl as [LaborDtl]
inner join Erp.JobHead as [JobHead] on
LaborDtl.Company = JobHead.Company
and LaborDtl.JobNum = JobHead.JobNum
inner join Erp.FiscalPer as [FiscalPer] on
LaborDtl.Company = FiscalPer.Company
and LaborDtl.PayrollDate >= FiscalPer.StartDate
and LaborDtl.PayrollDate <= FiscalPer.EndDate
and ( FiscalPer.FiscalYear = 2026 )
where (LaborDtl.LaborQty > 0
and LaborDtl.ActiveTrans = 0
and LaborDtl.LaborType = ‘P’)
group by
[LaborDtl].[Company],
[FiscalPer].[FiscalYear],
[FiscalPer].[FiscalPeriod]

LaborDtl.DiscrepQty isn’t intended to indicate bad quantity, this is just quantity flagged as non-conforming and the NCF process determines if the part is out of spec or not. You would have to include your NCF results here.

ScrapQty is indeed intended to represent quantity that is in fact bad. I think in essence you are bypassing the NCF process and going directly to Failed because reason.

ok so you suggest i include the Non ConFormance Table ? which fields do i pick

Yes the NonConf table will contain any relevant related job fields. The FailedQty field is meant to indicate any quantity that failed inspection.