KevinJ of Kansas
04/23/2019, 11:04 PMNVL2(
max( { item.averagecost }),
( TRUNC(
SUM(
NVL({ amount }, 0) - NVL({ item.averagecost }, 0) * { quantity }
) / SUM(NULLIF({ amount }, 0)),
2
) * 100),
(TRUNC(
SUM(
NVL({ amount }, 0) - NVL({ item.lastpurchaseprice }, 0) * { quantity }
) / SUM(NULLIF({ amount }, 0)),
2
) * 100)
)