0 / 0
typenode properties

typenode properties

Type node iconThe Type node specifies field metadata and properties. For example, you can specify a measurement level (continuous, nominal, ordinal, or flag) for each field, set options for handling missing values and system nulls, set the role of a field for modeling purposes, specify field and value labels, and specify values for a field.

Example

node = stream.createAt("type", "My node", 50, 50)
node.setKeyedPropertyValue("check", "Cholesterol", "Coerce")
node.setKeyedPropertyValue("direction", "Drug", "Input")
node.setKeyedPropertyValue("type", "K", "Range")
node.setKeyedPropertyValue("values", "Drug", ["drugA", "drugB", "drugC", "drugD", "drugX",
 "drugY", "drugZ"])
node.setKeyedPropertyValue("null_missing", "BP", False)
node.setKeyedPropertyValue("whitespace_missing", "BP", False)
node.setKeyedPropertyValue("description", "BP", "Blood Pressure")
node.setKeyedPropertyValue("value_labels", "BP", [["HIGH", "High Blood Pressure"],
 ["NORMAL", "normal blood pressure"]])

Note that in some cases you may need to fully instantiate the Type node for other nodes to work correctly, such as the fields from property of the SetToFlag node. You can simply connect a Table node and run it to instantiate the fields:

tablenode = stream.createAt("table", "Table node", 150, 50)
stream.link(node, tablenode)
tablenode.run(None)
stream.delete(tablenode)
Table 1. typenode properties
typenode properties Data type Property description
direction Input
Target
Both
None
Partition
Split
Frequency
RecordID
Keyed property for field roles.
type Range
Flag
Set
Typeless
Discrete
OrderedSet
Default
Measurement level of the field (previously
called the "type" of field). Setting type to
Default will clear any values parameter
setting, and if value_mode has the value
Specify, it will be reset to Read.
If value_mode is set to Pass or Read,
setting type will not affect value_mode.

The data types used internally differ from those visible in the type node. The correspondence is as follows: Range -> Continuous Set - > Nominal OrderedSet -> Ordinal Discrete- > Categorical.

storage Unknown
String
Integer
Real
Time
Date
Timestamp
Read-only keyed property for field storage type.
check None
Nullify
Coerce
Discard
Warn
Abort
Keyed property for field type and range checking.
values [value value] For continuous fields, the first value is the minimum, and the last value is the maximum. For nominal fields, specify all values. For flag fields, the first value represents false, and the last value represents true. Setting this property automatically sets the value_mode property to Specify.
value_mode Read
Pass
Read+
Current
Specify
Determines how values are set. Note that you cannot set this property to Specify directly; to use specific values, set the values property.
extend_values flag Applies when value_mode is set to Read. Set to T to add newly read values to any existing values for the field. Set to F to discard existing values in favor of the newly read values.
enable_missing flag When set to T, activates tracking of missing values for the field.
missing_values [value value ...] Specifies data values that denote missing data.
range_missing flag Specifies whether a missing-value (blank) range is defined for a field.
missing_lower string When range_missing is true, specifies the lower bound of the missing-value range.
missing_upper string When range_missing is true, specifies the upper bound of the missing-value range.
null_missing flag When set to T, nulls (undefined values that are displayed as $null$ in the software) are considered missing values.
whitespace_ missing flag When set to T, values containing only white space (spaces, tabs, and new lines) are considered missing values.
description string Specifies the description for a field.
value_labels [[Value LabelString] [ Value LabelString] ...] Used to specify labels for value pairs.
display_places integer Sets the number of decimal places for the field when displayed (applies only to fields with REAL storage). A value of –1 will use the stream default.
export_places integer Sets the number of decimal places for the field when exported (applies only to fields with REAL storage). A value of –1 will use the stream default.
decimal_separator DEFAULT
PERIOD
COMMA
Sets the decimal separator for the field (applies only to fields with REAL storage).
date_format

"DDMMYY"
"MMDDYY"
"YYMMDD"
"YYYYMMDD"
"YYYYDDD"
DAY
MONTH
"DD-MM-YY"
"DD-MM-YYYY"
"MM-DD-YY"
"MM-DD-YYYY"
"DD-MON-YY"
"DD-MON-YYYY"
"YYYY-MM-DD"
"DD.MM.YY"
"DD.MM.YYYY"
"MM.DD.YYYY"
"DD.MON.YY"
"DD.MON.YYYY"
"DD/MM/YY"
"DD/MM/YYYY"
"MM/DD/YY"
"MM/DD/YYYY"
"DD/MON/YY"
"DD/MON/YYYY"
MON YYYY
q Q YYYY
ww WK YYYY

Sets the date format for the field (applies only to fields with DATE or TIMESTAMP storage).
time_format

"HHMMSS"
"HHMM"
"MMSS"
"HH:MM:SS"
"HH:MM"
"MM:SS"
"(H)H:(M)M:(S)S"
"(H)H:(M)M"
"(M)M:(S)S"
"HH.MM.SS"
"HH.MM"
"MM.SS"
"(H)H.(M)M.(S)S"
"(H)H.(M)M"
"(M)M.(S)S"

Sets the time format for the field (applies only to fields with TIME or TIMESTAMP storage).
number_format DEFAULT
STANDARD
SCIENTIFIC
CURRENCY
Sets the number display format for the field.
standard_places integer Sets the number of decimal places for the field when displayed in standard format. A value of –1 will use the stream default.
scientific_places integer Sets the number of decimal places for the field when displayed in scientific format. A value of –1 will use the stream default.
currency_places integer Sets the number of decimal places for the field when displayed in currency format. A value of –1 will use the stream default.
grouping_symbol DEFAULT
NONE
LOCALE
PERIOD
COMMA
SPACE
Sets the grouping symbol for the field.
column_width integer Sets the column width for the field. A value of –1 will set column width to Auto.
justify AUTO
CENTER
LEFT
RIGHT
Sets the column justification for the field.
measure_type Range / MeasureType.RANGE
Discrete / MeasureType.DISCRETE
Flag / MeasureType.FLAG
Set / MeasureType.SET
OrderedSet / MeasureType.ORDERED_SET
Typeless / MeasureType.TYPELESS
Collection / MeasureType.COLLECTION
Geospatial / MeasureType.GEOSPATIAL
This keyed property is similar to type in that it can be used to define the measurement associated with the field. What is different is that in Python scripting, the setter function can also be passed one of the MeasureType values while the getter will always return on the MeasureType values.
collection_ measure Range / MeasureType.RANGE
Flag / MeasureType.FLAG
Set / MeasureType.SET
OrderedSet / MeasureType.ORDERED_SET
Typeless / MeasureType.TYPELESS
For collection fields (lists with a depth of 0), this keyed property defines the measurement type associated with the underlying values.
geo_type Point
MultiPoint
LineString
MultiLineString
Polygon
MultiPolygon
For geospatial fields, this keyed property defines the type of geospatial object represented by this field. This should be consistent with the list depth of the values.
has_coordinate_ system boolean For geospatial fields, this property defines whether this field has a coordinate system
coordinate_system string For geospatial fields, this keyed property defines the coordinate system for this field.
custom_storage_ type Unknown / MeasureType.UNKNOWN
String / MeasureType.STRING
Integer / MeasureType.INTEGER
Real / MeasureType.REAL
Time / MeasureType.TIME
Date / MeasureType.DATE
Timestamp / MeasureType.TIMESTAMP
List / MeasureType.LIST
This keyed property is similar to custom_storage in that it can be used to define the override storage for the field. What is different is that in Python scripting, the setter function can also be passed one of the StorageType values while the getter will always return on the StorageType values.
custom_list_ storage_type String / MeasureType.STRING
Integer / MeasureType.INTEGER
Real / MeasureType.REAL
Time / MeasureType.TIME
Date / MeasureType.DATE
Timestamp / MeasureType.TIMESTAMP
For list fields, this keyed property specifies the storage type of the underlying values.
custom_list_depth integer For list fields, this keyed property specifies the depth of the field
max_list_length integer Only available for data with a measurement level of either Geospatial or Collection. Set the maximum length of the list by specifying the number of elements the list can contain.
max_string_length integer Only available for typeless data and used when you are generating SQL to create a table. Enter the value of the largest string in your data; this generates a column in the table that is big enough to contain the string.
default_value_mode Read
Pass
Set the default mode for all fields to Read or Pass. The import node passes fields by default, while the Type node reads values by default.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more