Text Syntax

When the Edit Text option button is selected in the Rules Builder, the rules can be displayed or edited in text mode. In text mode, white space is ignored. Default tabs are inserted when converting from tree view mode to indicate nested conditionals.

Name = Formula

When editing the rules in text mode, the rules types use the following syntax:

Name = Formula

In text mode, this is expressed as:

name = EvalExpr("formula")

Parameter Description
name It is the rules variable name, and follows standard STATISTICA variable name conventions.
Note: To specify a temporary rules variable, that is not be sent to the final results spreadsheet, prepend the variable name with a dollar sign ($)
formula It is any expression allowed by the STATISTICA Spreadsheet formulas, including variables from the input data file, and rules variables that have been previously defined

Name = Model

In the text mode, this is expressed as:

name = EvalModel("enterprise-path", version, desired_statistic, "category")

Parameter Description
name The rules variable name, and follows standard STATISTICA variable name conventions.
Note: To specify a temporary rules variable, that is not be sent to the final results spreadsheet), prepend the variable name with a dollar sign ($)
enterprise-path A string that specifies the STATISTICA Enterprise path name of the model
version The version number from SDMS. 0 refers to the latest value and should be used if SDMS is not specified. -100 refers to the latest approved version. Otherwise, this is the explicit version number of the model
desired_statistic Specifies which statistic to return from the model, and should be one of the following:
  • 0 – Prediction
  • 1 – Residual
  • 2 – Prediction probability for specified category
category If the value of desired_statistic is set to 2 to return prediction probability for a category, this string specifies the particular category to return.

Linking to Other Rules

Linking to other rules is specified only in text mode; if you had copied the rules, they would have been included as individual rule steps. To specify linking to other rules in text mode, use the following syntax:

ImportRules("enterprise-path", version)

Parameter Description
enterprise-path A string that specifies the STATISTICA Enterprise path name of the model
version It specifies the version number from SDMS. 0 refers to the latest value and should be used if SDMS is not specified. -100 refers to the latest approved version. Otherwise, this is the explicit version number of the model.

Conditionals

In the text mode, the if/elseif/else construct is specified as follows:

If( EvalExpr("expression") )

Rules steps…

ElseIf( EvalExpr("expression") )

Rules steps…

Else

Rules steps…

EndIf
Parameter Description
expression Any expression allowed by the STATISTICA Spreadsheet formulas, including variables from the input data file and rules variables that have been previously defined
Rules steps… Specify the rules steps to execute as defined by the conditional executional logic
ElseIf Optional clause
Else Optional clause
EndIf Must be specified to designate the end of the if/elseif/else clause

Comments

Comments are specified by prepending the text with a semicolon.

; this is a comment

Push Array Value

Push("array-name", "name", value)

Parameter Description
array-name Specifies the specific array name, and follows standard STATISTICA variable name conventions.
name The text version of the name/value pair being added to the array
value The numeric weighting value

ArrayMax/ArrayMin

name = ArrayMax("array-name", index)

name = ArrayMin("array-name", index)

Parameter Description
name Specifies rules variable name, and follows standard STATISTICA variable name conventions.
array-name Specifies the specific array name, and follows standard STATISTICA variable name conventions.
index Specifies the numeric ordered index, starting with 1, that specifies the sorted values from either the highest weighted value (ArrayMax), or lowest weighted value (ArrayMin).