ABL Loops & Calculated Fields in BAQs

(9.05.606)

Creating a BAQ to use on a dashboard that will show different part usage metrics.

Though calculated fields were done in C# (at least 9.05.700 seems to be) but our version is only properly highlighting ABL syntax. I'm currently none too skilled with ABL.

What I'm looking to do is divide the quantity on hand by the quantity used over the past 90 days. But it depends if it's service inventory or production.



Below is my incorrect, not functional attempt to do this. I realize I likely need to pull some of this information through an ABL query, but I'm not sure where to start in attempting that.

Define var startDate as Date = Today - 90.
Define var totalQty as Integer.

If isNull(PartWhse.OnHandQty) Then
PartWhse_Service.OnHandQty / While startDate <= Today:
totalQty += PartTran.TranQt
startDate++.
End.
Else
PartWhse.OnHandQty / While startDate <= Today:
totalQty += PartTran.TranQt
startDate++.
End.
End.

Thanks,

Justin