Skip to Content
0
Dec 12, 2022 at 12:53 PM

Approval query issue

132 Views Last edit Jan 11, 2023 at 01:24 AM 2 rev

Hello Experts,

I'm trying to set up a query based approval template that'll exclude a specific business partner (or customer group) and will trigger when margin % drops below a specified level. I believe it's important the query checks margin on the active window for this to work correctly.

I've got the below to work on some occasions, but I seem to run into errors when the value reaches a certain level. I'm not at all convinced I have this right, so help would be greatly appreciated.

SELECT DISTINCT 'TRUE' FROM ORDR

WHERE $[ORDR.CardCode] <> 'C0001103'

AND ($[ORDR.GrosProfit] / NULLIF($[$22.0.number],0)) < '0.25'

Thanks in advance!