I have a BAQ that is working perfectly in classic and Kinetic. I created the dashboard in Classic first, just because I am still more accustomed to classic to ensure it could be done first, but when I create it in application studio, I do not get any data.
The purpose of this BAQ was to pull into a report showing the tooling we need to order. BUT we are trying to pull anything we can into a dashboard instead of a report. On the Classic Dashboard, I had filtered it to only show if Calculated_POCal is > 0, displaying all tooling that was below the threshold between on hand and on order.
Hoping someone can see an issue with my BAQ and let me know where I went wrong?
/*
* 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 distinct
[Part].[PartNum] as [Part_PartNum],
[Part].[PartDescription] as [Part_PartDescription],
[PartWhse].[MinimumQty] as [PartWhse_MinimumQty],
[PartWhse].[MaximumQty] as [PartWhse_MaximumQty],
[PartWhse].[WarehouseCode] as [PartWhse_WarehouseCode],
[PartWhse].[OnHandQty] as [PartWhse_OnHandQty],
[PODetail].[OpenLine] as [PODetail_OpenLine],
((case when PODetail.OpenLine = 1 then sum(PODetail.OrderQty) else 0 end)) as [Calculated_SumOrders],
(ISNULL(sum(RcvDtl.OurQty), 0)) as [Calculated_SumRec],
((case
when (PartWhse.MaximumQty >= 1) and (PartWhse.OnHandQty = 0) OR (PartWhse.OnHandQty + SumRec <= PartWhse.MinimumQty) and (PODetail.OpenLine = 0) then 1
when (PartWhse.MinimumQty > '0') and PartWhse.OnHandQty <= PartWhse.MinimumQty then 1
when (PartWhse.MaximumQty > '0') and PartWhse.OnHandQty <= PartWhse.MinimumQty then 1
else 0
end)) as [Calculated_IdentOrder],
[PORel].[WarehouseCode] as [PORel_WarehouseCode],
((case
when identOrder = 1 and PartWhse.warehouseCode = PORel.WarehouseCode then 1
else 0
end)) as [Calculated_POCal],
(case
when (IdentOrder = 1 and POCal = 1 and SumRec >= '1') then (PartWhse.MaximumQty - (PartWhse.OnHandQty + SumOrders - SumRec))
when (IdentOrder = 1 and POCal = 1 and SumRec = 0) then (PartWhse.MaximumQty - (PartWhse.OnHandQty + SumOrders))
when (IdentOrder = 1 and POCal = 0 and PODetail.OpenLine = 1) then (PartWhse.MaximumQty - (PartWhse.OnHandQty + SumOrders - SumRec ))
when (IdentOrder = 1 and POCal = 0) then (PartWhse.MaximumQty - PartWhse.OnHandQty)
end) as [Calculated_CalRep],
((case when CalRep > 1 then 1 else 0 end)) as [Calculated_CalRep2]
from Erp.Part as [Part]
inner join Erp.PartWhse as [PartWhse] on
Part.Company = PartWhse.Company
and Part.PartNum = PartWhse.PartNum
and ( (PartWhse.WarehouseCode = 'P1Tool'
or PartWhse.WarehouseCode = 'P3Tool'
or PartWhse.WarehouseCode = 'P5Tool'
or PartWhse.WarehouseCode = 'EM2' ) )
left outer join Erp.PODetail as [PODetail] on
Part.Company = PODetail.Company
and Part.PartNum = PODetail.PartNum
and ( (PODetail.OpenLine = 1 ) )
left outer join Erp.PORel as [PORel] on
PODetail.Company = PORel.Company
and PODetail.PONUM = PORel.PONum
and PODetail.POLine = PORel.POLine
and ( PORel.OpenRelease = True )
left outer join Erp.RcvDtl as [RcvDtl] on
PORel.Company = RcvDtl.Company
and PORel.PONum = RcvDtl.PONum
and PORel.POLine = RcvDtl.POLine
and PORel.PORelNum = RcvDtl.PORelNum
and PORel.WarehouseCode = RcvDtl.WareHouseCode
and ( (RcvDtl.ReceivedComplete = 0 ) )
left outer join Erp.PartPlant as [PartPlant] on
Part.Company = PartPlant.Company
and Part.PartNum = PartPlant.PartNum
left outer join Erp.Vendor as [Vendor] on
PartPlant.Company = Vendor.Company
and PartPlant.VendorNum = Vendor.VendorNum
where (Part.TypeCode = 'p')
group by
[Part].[PartNum],
[Part].[PartDescription],
[PartWhse].[MinimumQty],
[PartWhse].[MaximumQty],
[PartWhse].[WarehouseCode],
[PartWhse].[OnHandQty],
[PODetail].[OpenLine],
[PORel].[WarehouseCode]
order by PartWhse.WarehouseCode, Part.PartNum
