ParamItem
You can use this function for Optiva Equations.
Purpose
Returns the concentration or percentage value of an item’s parameter for a formula, using the parameter’s unit of measure. The value is not a function of how the item is used in the formula; but it is an attribute of the item.
Suppose the concentration of the parameter for one item is 10MG/100GM and
the other item is 20MG/100GM. ParamItem
returns 10
and 20 respectively.
The
param
functions return a string unless you convert
them to a numeric data type before performing numeric operations, such as
addition. Otherwise, you get a concatenated string when you add several values.
Equations for Alt UOM conversions should use
ObjProperty to obtain the parameter values. Do not
use
Param
or
ParamItem
.
Syntax
Dim variable As String = paramitem(parameter name, <item code> OR <line ID>)
Description
Alternatively, replace the line number with an item code to retrieve the value of the parameter for that item. Use for formula ingredient parameters.
When the parameter is a concentration or percentage, it uses the
concentration or percentage. It does not use the actual amount of the parameter.
Suppose the concentration of the parameter for one item is 10MG/100GM and the other
item is 20MG/100GM. Then ParamItem
returns
10 and 20 respectively.
Use Param
to return the current
(i.e., original or overwritten) concentration or percentage value for the formula’s
parameter. The value is in the parameter’s unit of measure. If the total (extended)
contribution of the parameter for all items is 15MG/100GM, then Param
returns 15.
Use Tparam
to return the net
contribution of a formula’s parameter (i.e., the actual value). This value is based
on the percentage or concentration of the parameter and the formula’s mass. What if
the total concentration of the parameter for all items is 16.666MG/100GM and the
total quantity for the items is 3KG (3000GM)? Then Tparam
returns 499.98. The
calculation is 16.666MG/100GM X 3000GM = 499.98
.
Use TparamItem
to return the net
contribution of an item’s parameter (i.e., the actual value). This value is based on
the percentage or concentration of the parameter and the formula’s mass. Suppose the
parameter value for one item is 3.33MG/100GM of the formula and there is 3KG
(3000GM) of the item. Then, the tparamitem
value is
99.9. The calculation is 3.33MG/100GM X 3000GM\100GM = 99.9
.
Examples
The
sValue
variable assigns the amount of calcium from an item to the parameter that
is assigned this equation. The item is on line two of the Item Lines tab.
Dim sValue As String = paramitem("CALCIUM","#02")
You can create a parameter that is calculated at the item level and then
rolled up. For this scenario, use equation indicator
4=Calculated Parameter
. You can use the param
function to retrieve the item parameter values in your equation.
Dim sValue as String = param("CALCIUM")