September 30, 200916 yr 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.
September 30, 200916 yr 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.
September 30, 200916 yr Author 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.
Create an account or sign in to comment