anyone see anything off with this formula? ```NVL...
# suitescript
k
anyone see anything off with this formula?
Copy code
NVL2(
  { 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
)
Netsuite's not giving me a lot to go off with their error lol - the `TRUNC()`s work individually but not as part of
NVL2
🤷
s
I think this question is better suited for #C2A1ZEMF0
k
Thanks! I'll try there