Hey everyone,
I am trying to recreated this Query in a BAQ. Is there a way to get the
Top(1) with ties
and the
order by ROW_NUMBER() over (partition by a.PartNum order by a.TranDate desc)
in a BAQ?
Full Query below:
select
Top(1) with ties
Max(a.TranDate) as LastTranDate,
a.PartNum,
a.TranType,
a.TranQty
from erp.PartTran a
where a.Company = ‘PPI’ and a.TranType in (‘STK-CUS’)
group by a.PartNum,
a.TranType,
a.TranQty,
a.TranDate
order by ROW_NUMBER() over (partition by a.PartNum order by a.TranDate desc)
