titanium Posted September 30, 2009 Posted September 30, 2009 Hi, I am trying to calculate the results of a field ussing a CASE statement. I have the following fields: Quantity (text) Min Quantity (text) Max Quantity (text) LevelWarning LevelWarning is a calculation with the following: Case ( Quantiy ≤ Min Quantity-1; "Inventory is LOW"; Quantiy ≥ Max Quantity+1; "Inventory is High"; "Inventory level is OK." ) This is not write however as it does not return the expected result... just what seems to be random (tho im sure its logical in its own right) Any thoughts on ware im going wrong would be much appreciated. Thanks in advance.
comment Posted September 30, 2009 Posted September 30, 2009 An example of input and result would be useful, but I'll venture a guess anyway: either change the field types to Number, or at least use = Case ( GetAsNumber ( Quantity ) ≤ GetAsNumber ( Min Quantity ) - 1 ; "Inventory is LOW" ; GetAsNumber ( Quantity ) ≥ GetAsNumber ( Max Quantity ) + 1 ; "Inventory is High" ; "Inventory level is OK." ) BTW, assuming quantities are integers, a ≤ b - 1 can be written simply as a < b.
titanium Posted September 30, 2009 Author Posted September 30, 2009 Sorry for not being more clear in my post, however your 'reading between the lines" was absolutely correct. The example you provided worked perfectly. Thanks very much. For anyone else who may be searching for this answer...more details... I want to assign a range of inventory level for items. IE: 10 is the minimum to have on hand and 50 is the maximum. If the level drops bellow the min, i want to be notified, if above the max i also want to be notified. Otherwise, the level on hand is OK.
Recommended Posts
This topic is 5592 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now