Transformation of Text Variables (Variables of Type Text)
Statistica supports numeric as well as variables of type text (see Variable Data Types). In addition, you can attach text labels to numeric values (example, attach label Male to numeric value 1 (see also Notes on Text Labels and Text Values). For these variables, transformation formulas are always applied to the numeric representations of values (that is, to numeric value 1 in this case).
Concatenating Text Values (+)
Use the standard arithmetic operator for addition of numbers ("+") to concatenate strings. For example, the transformation V1="Good "+"Program" (e.g., entered into the Batch Transformations editor, see Batch Transformation Formulas) assigns the text value Good Program to all cells in variable 1.
Logical Operators
The logical operators:
<, <=, >, >=, =, <>
Perform (case-sensitive) lexigraphical comparisons between strings; the results of these comparisons evaluate to either True or False.
Other Text (String) Functions
The following functions are available in transformation formulas to operate on text (string) values.
| UCase(Str) | convert argument to upper case |
| LCase(Str) | convert argument lower case |
| LabelOf(v) | if variable has text label, return that label as string |
| StrComp(Str1, Str2) | return -1, 0, 1 if Str1 is lexigraphically <, =, or > than Str2 |
| StrIComp(Str, Str) | case insensitive version of StrComp |
| Mid(Str, Index, Len) | See also Statistica Visual Basic; Return the substring of Str starting at Index for Len characters. NOTE: Index is 1-based, that is, the first character in a string is referenced as 1. |
| Len(Str) | string length |
Simple Type Conversion
| ToString(x) | convert numeric argument x to a string |
| ToStringEx(x, format) | convert numeric argument x to a string, using the format specified in the second argument; example, ToStringEx(1.5,"d.dd") would convert number 1.5 to string "1.50" |
| ToNumber(Str) | convert string argument Str containing a number in text form (e.g., string "1.45") to the numeric representation (the number 1.45). |
| ToNumberEx(Str, format) | convert string argument Str containing a number in text form and formatted as described in format to the respective numeric representation; for example, function ToNumberEx("5/17/62", "mm/dd/yy") would convert the date "5/17/62" to the numerical equivalent Julian date (see also Date Operations dialog box - Numeric Dates tab) |