Model Input Object
The Integrator Model input object accesses data that has been built into a standard DI Model or returns information about the Model (metadata). It can retrieve row level data that was used to build the Model. If the Model was built using a Detail Build, then the detail fields are also accessible (i.e., Detail Dimensions, Detail Summaries and Detail Info Fields). If the Model was squashed, then only squashed detail is available.
The object returns columns for the Dimensions, Summaries and Info Fields. In a multi-model case, data from a given Model has blank values for columns that do not correspond to fields within the Model. The order of the records are based on how they are stored in the Model. This is not necessarily how they were input into the build.
Model Attributes
| Attribute | Type | Description |
|---|---|---|
| input_type (required) |
String | Identifies the object as a Model input object. The value of this string is "model". |
| model | String |
Specifies the filename for the input Model. This attribute is required if not using models, diveplan, or model_list_input attributes. NOTE: This attribute is Model name(s) in Visual Integrator. |
| models | Array of Strings |
Defines an array of filenames for the Model files. The named Models are merged to create the input. The attributes diveplan, model, models, model_list_input are mutually exclusive. NOTE: This attribute is Model name(s) in Visual Integrator. |
| diveplan | String |
Defines the filename for the DivePlan to be read. If this is a multi-Model DivePlan, the Models in the DivePlan are merged together and read. The attributes diveplan, model, models, model_list_input are mutually exclusive. NOTE: This attribute is Diveplan in Visual Integrator. |
| model_list_input | String |
Specifies a separate input flow to generate a list of Model names. This string is an object name,
not a filename. This input flow should have a column named "filename". The Model object uses
the values in this column as a list of filenames to open as its models. This is similar to the
file_list_input attribute in the Filein input object. This attribute allows programmatic control
over the input to the Integrator. The input model filenames can be read from a file and processed
using any of the Integrator process objects (with calculated fields, etc.). NOTE: This attribute is Model List Input in Visual Integrator. |
| lookup_model | String |
Defines a Lookup Model to be used in a multi-Model merge. Do not use this attribute unless the existing Model was built as a Lookup Model. See the classic Builder manual for a description of Lookup Models. NOTE: This attribute is Lookup Model in Visual Integrator. |
| password | String | Specifies the password to be used to open password-protected Models. This attribute is deprecated and is for legacy use only. |
| detail | Boolean | Indicates where data is read from when a Detail Model is used. Values
include:
|
| filter_input | String |
Specifies a separate input flow used to filter columns for a detail Model. This input flow should have the columns specified in the filter_columns array. The core dimensions that match the rows in this filter input flow will be returned. This is used to give fast access to the detail data in the Model based on the Model Dimensions; in effect, the detail Model is used as an indexed file. This type of filtering must be used against a single detail Model; it does not support MultiModels. The filter_input and filter_values attributes are mutually exclusive. NOTE: This attribute is Filter Input in Visual Integrator. |
| filter_columns | Array of Strings | Specifies the columns in the filter_input flow that are used to filter data in the detail Model. These columns must appear in the filter_input flow and must be defined as Detail Dimensions in the Model. The Model input object will return the detail data that match the values in the filter_columns in the filter input flow. |
| filter_values | Array of Strings |
Provides an alternate way of specifying filter data that is optimized for Tunnel parameters instead
of using a filter_input flow. Each element of this array corresponds to a column in
filter_columns.
For example, given a Tunnel script that takes parameters, Month, Product, and Customer, the following attributes will filter for the combination of Months, Products and Customers passed into the script: filter_columns = { "Month", "Product", "Customer" },filter_values = { `$(Month)`, `$(Product)`, `$(Customer)` } |
| dimension | String |
Indicates that the Model input object should return Dimension data instead of row level data. The
dimension attribute identifies a Dimension or an Info Field whose values should be returned. The
output of the Model input object will be a column of the unique values for the given Dimension,
along with additional columns for any associated Info Fields. If the attribute names an Info Field,
the Model object will return a single column of the Info Field values as they would appear as a
Dynamic Dimension. No other columns will be returned in this case, since an Info Field does not
have any associated Info Fields.
The Dimension data returned by the Model object is equivalent to a first level dive on the given Dimension without the Summary fields. All the associated Info Fields are included. If they are not needed for later processing, the keep_columns attribute can be used to remove them from the output flow and reduce the amount of work the Model input object performs. |
| first | Integer | Determines the number of records to be read from the input file. If used, Data Integrator reads up to the number of records specified. This limit is particularly useful for script testing on a small number of input records. If this attribute is not used, all rows are returned. This attribute is ignored if the metadata = "true" flag is present. |
| format_dates | Boolean |
Controls whether or not date fields in the Model are returned in string or numeric form, and
whether date fields used as filter values are input as strings or numbers. NOTE: This attribute is Format Dates in Visual Integrator. |
| prefix | String | Defines a prefix that is prepended to all columns in the flow that are not aliased using the aliases array. If you want a space between the prefix and the column name, include that space in the prefix string definition. |
| aliases | Array of Strings |
Defines new column names for the columns already defined in the input data. Format is "oldname=newname". Blanks before or after the columns names will be ignored. Spaces within a column name are acceptable. If newname is blank, then the given column is deleted from the output flow. NOTE: This attribute is Alias Lines in Visual Integrator. |
| keep_columns | Array of Strings | Defines a list of columns to be kept by the input object. If this attribute is not used, all columns are kept. The output flow of the object is limited to those columns that are listed, and no excluded columns are available to subsequent process objects. Column names in the keep_columns array should be given after they are aliased or prepended with the prefix string. |
| metadata | Boolean | Allows the Model input object to return metadata information about the fields in the Model
instead of just Model data when set to "true". When set to "false" or not specified, only Model
data is returned. If the detail flag is also "true", the metadata information returned will describe the detail fields in the Model. The resulting flow will consist of one row per Model field, where a Model field is a Dimension, Summary, or Info Field. The resulting flow will contain the columns in the next table (Columns resulting from metadata flow). |
| encoding | String |
Defines the encoding for the input Model(s). Values include:
UCS-2 and UTF-8 files can include a Byte Order Mark (BOM) at the beginning of the file to denote the file encoding. These file signatures are defined as follows:
File signatures are common for Unicode files on Windows operating systems. If the file input object reads multiple files, the signature of each file determines its encoding. If the encoding attribute is auto and no signature is found, the encoding is assumed to be latin1 if no other object in the task handles Unicode data and the VI file is not encoded as utf-8 (using the charset 1208 directive). Otherwise, the encoding is assumed to be utf-8. See also Integrator Unicode Data Support. |
| trace_after | Sub-object |
Traces data flows leaving the specified object, which makes debugging scripts easier. This is equivalent to adding a Trace process object immediately after the current object. See Embedded Trace Object for more on using trace sub-objects. |
Columns resulting from metadata flow
| Column | Description |
|---|---|
| Filename | Contains the filename of the Model as given by the model attribute. If a Model is opened via a DivePlan, then this contains the name of the DivePlan. If a multi-Model is opened via the models attribute, this column will be blank. |
| Field Name | Gives the name of the Model field, e.g., "Salesperson". |
| Field Type | Identifies the field as a Dimension, Summary, or Info Field. The values for the column will be one of "Dimension", "Summary", or "Info". |
| Number Values | For string fields, contains the number of possible values in the column. For other field types, this column is blank. |
| Info Dimension | For Info Fields, contains the name of the associated Dimension. For other field types, this column is blank. |
| Data Type | Contains the data type (String, Double, etc) used to represent the given Model field. The values for the column will be one of "Byte", "Short", "Integer", "Unsigned Byte", "Unsigned Short", "Unsigned Integer", "Float", "String", "Decimal Integer", "Decimal Long Integer", "Double", or "Long Integer". All detail fields are represented as strings in a Model. |
| Format | Contains the format defined for the field by the Builder object’s Description attribute. This applies to date fields, otherwise the value will be blank. See the Builder object for additional information. |
| Date Type | Describes whether the field is defined to be a date by the Builder. The values for this column will either be "date" or blank. |
| Field Number | Contains the field number within the Model, with the first Dimension in the Model having field number "1". If metadata data from multiple Models is combined using the append flag in the Fileout object, this column can be filtered for the value "1" to provide a Model level summary. |
| Summary Types | For Summary fields, contains a comma separated string of summary types that are available for the given field, as described by the sum_- types attribute in the Build Description. For example: "Total, Minimum, Maximum, Std Dev". For non-Summary fields, this column is blank. |
| Dimension Count Prebuilt | For Dimensions, has the value "true" if Dimension counts were built into the Model using the dimcounts attribute via the Builder object, otherwise this column will have the value "false". For non-Dimension fields, this column is blank. See the classic Builder manual for additional information on the dimcounts attribute. |
| Model Status | Contains the value "Built" if the Model was opened successfully. If the Model cannot be opened, the metadata output will consist of a single row, with a field number of "1" and a Model status containing an error message such as "Model was not finished" or "Cannot open file". All other columns will be blank. |
| Build Time | Contains the date and time when the Model was built. This is in the form of a Dimensional Insight standard date and time. For example: "2006/02/20 21:50:04" |
| Model Footer |
Contains the footer for the Model, as defined by the footer attribute in the Build Description. |
| Model Comments | Contains the comments for the Model, as defined by the comments attribute in the Build Description. |
| Build Description | Contains the filename of the Build Description used to build the Model specified via the Model attribute. This information is not returned when multiple Models are specified using the Models attribute. This may contain an Integrator script name if the Model was built using an Integrator Builder output object. If the Builder output object refers to a description file, this build description is stored instead. This information is returned for Models that were built using Builder version 4.2 (18) or later. |
| Block Factor | Contains the effective block factor used to build the Model specified via the Model attribute. This information is not returned when multiple Models are specified using the Models attribute. This may be lower that the block factor in the Build Description because the block factor cannot exceed the number of records in the Model. |
| Model Size | Contains the total Model size in bytes, including the space used by the main Model file and any Model continuation files. |
| Detail Model |
Contains the value "true" if the given Model was built with detail data using the Detail Build option. Otherwise, it will have the value "false". |
| Elapsed Build Time | Contains the amount of time it took to build the Model specified via the Model attribute. This information is not returned when multiple Models are specified using the Models attribute. This will be in Dimensional Insight standard time format of "HH:MM:SS", e.g. "1:30:23". This field is returned for Models that were built using Builder 4.3(24) or later. |
| Nullable | Contains the value "true" if a Summary field is set to be nullable; otherwise it will have the value "false". Blanks in nullable columns show up as empty strings. Zeroes in nullable columns show up as zeroes. |