Forum Discussion
RyanStanford1
5 years agoQrew Captain
The fields generally have a setting where null values are treated as 0, but you can probably also have it where you can set them as variables and go from there:
var number inventoryHand = if([Inventory on Hand] > 0, [Inventory on Hand], 0);
[Inventory Par] - $inventoryHand
-----
Hope this helps
------------------------------
Ryan Stanford
------------------------------
var number inventoryHand = if([Inventory on Hand] > 0, [Inventory on Hand], 0);
[Inventory Par] - $inventoryHand
-----
Hope this helps
------------------------------
Ryan Stanford
------------------------------
- PaulPeterson15 years agoQrew Assistant CaptainThis formula could lead to a negative number being entered if the inventory on hand is greater than the par value.
To cover all bases,
var number inventoryHand = if([Inventory on Hand] > 0 and [Inventory on Hand] < [Inventory Par], [Inventory on Hand], 0);
------------------------------
Paul Peterson
------------------------------- BrandonHermez5 years agoQrew MemberSo I tried this and It asked me to put a number after the semicolon, so i put the [Par] - [inventory on hand] and i'm still getting the same result. The issue is if the on hand is null then i want the order amount to be 0, and it only does the equation (par - on hand) when someone enters in a number for the on hand inventory. The par is always static so right now in the order it is always showing that static number when on hand inventory is null
------------------------------
Brandon Hermez
------------------------------- PaulPeterson15 years agoQrew Assistant CaptainTry this:
If(IsNull([inventory on hand]), 0, [Par] - [inventory on hand])
------------------------------
Paul Peterson
------------------------------
- BrandonHermez5 years agoQrew MemberHi Paul,
Thank you so much so far! I tried your formula: If(IsNull([inventory on hand]), 0, [Par] - [inventory on hand])
i'm still getting the par as my result to order instead of 0 when my on hand inventory is null
Any other idea? Thank you so much!
------------------------------
Brandon Hermez
------------------------------- PaulPeterson15 years agoQrew Assistant CaptainTry this instead:
If([inventory on hand]="", 0, [Par] - [inventory on hand])
------------------------------
Paul Peterson
------------------------------