Expressions

Units that can be used in expressions

Data type of evaluation results

Property with no value

Expression Dialog

Internal Functions

For expression type properties, you will need to specify expressions.


General

You will write an expression by composing

  • properties
  • values
  • operators
  • functions

composed together.

For example, the expression below is a "use instruction bar text expression" by default for the resource Gantt chart.

UseInst_Operation.Work_Order+'¥n'+UseInst_Operation.Work_OperationOutMainItem+'¥n'+UseInst_Operation.Work_OperationOutMainItemQty

"UseInst_Operation.Work_OperationOutMainItemQty" is a property indicating the production quantity of an operation.
"+" is the addition operator. (It merges the strings when it is used between strings.)
'\n' is a string (value) indicating a new line.

When calculating time or time span, or setting capacity value(setup, production, teardown), Units can be used.

Expressions with multiple data types such as combined by time span and numbers can also be used.

To know more about, how to evaluate properties with no values, please refer here.


Property

Long Name and Short Name

The property names have both long name and short name. For example, when a quantity is defined for an order,

Qty

is a short name and

Order_Qty

is a long name. In principle, a class name and an under bar are prefixed before a short name (When an exact long name is looked into, please either refer to the "class property" of Help or check with a row of letters of "code" defined by property.)

When a property name is described, using ME, etc., a targeted object is clear.In that case, use a short name.This is normally used. The one listed on the dropdown list is a short name too.

When a parent object (Parent), a child object (Child) or a sort key is stated in the form of a formula, a targeted object is unclear, one class have several same short names.On that occasion, it is necessary to use a long name.

In case that class has several short names, there are some cases that the property cannot be changed correctly when switch the [Use alias/display names] option in expression dialog between checked and unchecked. See here for more details.


ME

When you use a property in an expression, enter

ME

first.
ME refers to the object to which the expression type property with an expression written is targeted. For example, in the case of the property "Valid condition" of a use instruction of the Integrated Master, ME refers to an operation.In the case of the property "Use instruction bar text expression" of the resource Gantt chart, ME refers to a use instruction.

If you enter a period (.) after ME, a list of properties will be displayed from which you can select a property. Of course, you can directly enter the name of a property after a period.

For example, when you want to enter due date for the property "Order bar right text expression" of the order Gantt chart, enter as follows.

ME.LET

You can also omit ME.

In that case, the property name you entered will be processed as a property of ME.
Therefore, in the above example, if you write "ME.LET" or "LET", they will have the same meaning.

If the property you selected is of object type, you can enter a period (.) again and select a property of the object (or you can input a property directly).
For example, when you want to enter the name of an item of an order for the use instruction bar text expression of the resource Gantt chart, the expression will

ME.Order.Item.Name

.


OTHER

For properties such as the property "Pegging condition" that compare values of two properties, you can also use OTHER in addition to ME. OTHER also refers to an object. You can use OTHER in the same way as ME.

For example, if you want to describe that the order spec 1, is equal between two properties using the property "Pegging condition" of the item class, the expression will be

ME.Order.Spec1.Code==OTHER.Order.Spec1.Code

You can check in the Expression dialog as to whether you can use OTHER or not and the object to which OTHER refers.

There is a property that compares values of two properties. That is, the property "Furnace valid condition".

Here we will specify properties to compare using only ME and not OTHER.

For example, you can write a furnace value condition as follows to describe that orders can be simultaneously assigned to the same furnace when the orders are from the same customer.

ME.Order.Customer.Code

.


HOLDER

HOLDER refers to an object that owns the expression type property. For example, in the valid condition of a use instruction of the Integrated Master, ME is an operation and HOLDER is a master use instruction. Therefore, when you refer to the resource code of the use instruction in the valid condition of the use instruction of the Integrated Master, the expression will

HOLDER.Resource.Code

would be used.
In many cases, ME and HOLDER are pointing to the same object.


PROJECT

PROJECT means the currently opened project. You can refer to the properties that are displayed in the project settings.
You can use PROJECT from any expression.

For example, when you refer to the scheduling basis time, the expression will be

PROJECT.BasisTime

would be used.


WORKSPACE

WORKSPACE means the workspace of the currently opened project. You can refer to the properties that are displayed in the workspace settings.

You can use WORKSPACE from any expression.
For example, you may obtain a project file name with the expression:

WORKSPACE.ProjectFileName

.


TARGET

TARGET can be used only in the argument of certain internal functions.
Specify OBJECT for the first argument of the internal function, and specify TARGET from the second argument onward. TARGET refers to the first argument's OBJECT.

Using sum function of the internal function for example, the expression will be

Sum('Order',TARGET.Qty)

. In this case, TARGET means "Order."


Given internal functions A and B that can take a TARGET variable. If function B is specified as an argument for function A, the TARGET argument for B will be the object argument in B.

Example: * ME = order
MaxIF(ME.RightmostOrder,TARGET.LET==Min(ME.RightmostOrder,TARGET.LET)),TARGETQty)

For example, in this example, the largest order quantity is acquired among the items with the earliest due date among the rightmost orders among ME orders.The first TARGET is evaluated by ME.RightmostOrder, which is the first argument of the MaxIF function, and the second TARGET is evaluated by ME.RightmostOrder, which is the first argument of the Min function.

Calling an internal function within an internal function is called nesting. The number of nesting levels can be specified.


INPUT

INPUT is used in virtual property inverse expressions, display expressions / display inverse expressions and currency format expressions etc.
In principle, it refers to the string entered in a given cell; for more details, please refer to the explanation of respective properties.


DELETE

DELETE is used when you want to delete a property value. When using DELETE, you can delete the value of the property on the left by using an assignment expression such as

ME.Name=DELETE

.

* From Ver. 15.0, the following expression and the above expression are so that they produce the same result.

ME.Name=''

In versions older than Ver. 15.0, null characters were set.


Multiple value properties

When a property has multiple values, you can enter [n] after the name of the property. "n" is a number indicating nth of multiple values.
For example, if you want to describe the second comment of an order, the expression will

Order.Comments[2]

.

If you enter "0" for "n", the last element will be returned. For example, when "'a;b;c'" is specified for the property Comments, "c" will be returned if Comments[0] is written in the expression.

If you do not add [n], all of the values will be returned if the property is of the character type; otherwise, the last element will be returned. For example, when "'a;b;c'" is specified for the property Comments, "a;b;c" will be returned because of the Comments character type.


Multiple value properties where the type of the property is an object

For object type properties which are multiple value properties, the code of objects can also be used to specify an index in the multiple value list.
When comparing objects to the given string, the priority for comparison is Code->Display name->Alias.

For example, if ME is an operation, to access the instruction of this operation with the code S1, the expression:

ME.ProductionTask.UseInstructions['S1']

would be used.

Also, suppose the user adds a class "MyClass" with a property called "MyProperty1". To access the MyProperty1 property of the MyClass object with the name "ABC", the following expression could be used:

PROJECT.Child['MyClass'].Child['ABC'].MyProperty1

would be used. For adding new classes and properties, please refer to Add new class and New property definition.



Value

You will also often use values such as numbers and strings for expressions.
When you use those values in expressions, please keep the following points in mind.

NumbersDescribe as they are.123
StringsAdd a single quotation before and after a string.'123'
DatesAdd a sharp (#) sign before and after a date.#2005/10/1 12:00:00#
True or falseDescribe as in the column to the right.TRUE, FALSE

Control string in string

¥ in a string together with the character next to it indicate a control character.

ExpressionResultDescription
'¥¥'¥This is treated as a backslash character.
'¥n'NewlineSpecifying the use instruction bar text expression of the resource Gantt chart as follows causes it to be displayed with a new line.
ME.Code+'¥n'+ME.Qty
'¥'''This is treated as a single quotation character. For example, you can assign an expression containing a single quotation to a property with the following expression.
ME.Item.PeggingConditionExpr='IF(ME.Order.Type==¥'J¥',TRUE,FALSE)'
This feature is supported from Ver. 15.0.

 

Operators

You can use the following operators in Asprova.

 + Addition, Merging strings
 - Subtraction
 * Multiplication
 / Division
 ^ Exponentiation
 % Remaining
 && AND
 || OR
 ! Negation
 == Equal (comparison)
 != Not equal (comparison)
 > Greater (comparison)
 >= Greater or equal (comparison)
 < Less (comparison)
 <= Less or equal (comparison)
 (,) Parenthesis
 = Assignment

The priority of operators is as follows.

  1. ^
  2. *, /, %
  3. +, -
  4. !, ==, !=, >, <, >=, <=
  5. &&, ||
  6. =

When you use parenthesis in an expression, the contents in the parenthesis will be evaluated first.


Short circuit evaluation

Asprova supports short circuit evaluation. Expressions can be processed faster if it is written to take advantage of short circuiting behavior.
For details see here.


Conditional If

Evaluation of different operations based on condition is possible using the expression below.

If(Condition, evaluated if condition is TRUE, evaluated if condition is FALSE)

Example

If start time is earlier than 2020/06/01?insert “ABC” to the first comment, otherwise insert “XYZ”.

ME.'Comments (common)'[1]=IF(ME.'Start time'<=#2020/06/01 00:00:00#,'ABC','XYZ')

Or

IF(ME.'Start time'<=#2020/06/01 00:00:00#,ME.'Comments (common)'[1]='ABC',ME.'Comments (common)'[1]='XYZ')

From Ver. 13.1, multiple conditions can be described.as

IF (conditional expression 1, executable expression when conditional expression 1 is TRUE, conditional expression 2, executable expression when conditional expression 2 is TRUE, ..., conditional expression n, executable expression when conditional expression n is TRUE , executable expression when conditional expression n is FALSE)

Example

Red when the priority is 90 or higher, blue when it is 50 to 90, and green when it is less than 50.

IF(ME.Order.Priority>=90,RGB(255,0,0),IF(ME.Order.Priority<50,RGB(0,255,0),RGB(0,0,255)))


Functions

In expressions, you can use Asprova's internal functions and functions created and incorporated by the user.
When you use functions, make sure to describe function names and arguments correctly.

For example, the function to get spec 1 applicable to an operation is as follows.

GetApplicableSpec(1,ME.Operation)

would be used.

For more information about Asprova's internal functions, please click here.



HelpNo.:741000
© Since 2018 Asprova Corporation, All rights reserved.