Spectre Flow Excel Input Object
The Spectre Flow Excel Input object brings typed data into the build script from an xlsx file.
The Excel Input object has three sections in the properties panel where you set attributes.
You set attributes for the Excel Input object in the
object attributes section.
| Attribute | Description |
|---|---|
| File |
Defines a .xlsx file as a data source. Use project-based pathing. For information about the flow script tag, see file.
|
| Password | Provides a password if the Excel file is password-protected. It is not recommended to use password-protected Excel files as data sources. For information about the flow script tag, see password. |
| Sheet | Specifies which sheet in the Excel file to pull data from. The value can be either a name or a number. Spectre checks for a name match first. If that fails, it tries treating the sheet as a number. Name matching ignores case, and if multiple sheets have the same name, Spectre only looks at the first one that matches. If this value is empty, the first worksheet in the Excel file is used. For information about the flow script tag, see sheet. |
| Range | Specifies a range of cells to use from the input. Any cells outside of the range are ignored. The format for the range is the top-left cell (column letter and row number), followed by a colon, followed by the bottom-right cell (column letter and row number). For example, A1:D25 returns the first 25 rows from the first column (column A) through the fourth column (column D). For information about the flow script tag, see range. |
| Start Row |
Defines the row number to begin reading data from. If this value is empty, Spectre attempts to automatically determine which row represents the start. For information about the flow script tag, see start-row. NOTE: If the No Headers attribute is set to False, the value of Start Row should be the row number the header is on. |
| No Headers | Indicates the presence or absence of column headings in the Excel file. Set to True to name each column manually. For information about the flow script tag, see no-headers. |
| No Trim | Removes any leading or trailing spaces from the data. This is the default behavior for Spectre. Set to True to disable the trimming of white space. For information about the flow script tag, see no-trim. |
| Include Other Columns | If true, any columns found in the input that are not specified are included. For information about the flow script tag, see include-other-columns. |
| Limit Rows | Directs the build to use a specific number of rows from the Excel file. For information about the flow script tag, see limit-rows. |
| Prefix | Sets a string to add to the beginning of all column names from this input. Optional. For information about the flow script tag, see prefix. |
| Current Date | Specifies the current day for time-series calculations and Analysis Tables. The value of this attribute must follow the default DI date formatting of "YYYY/MM/DD". It is DI best practice to pass a parameter with the current date value to this attribute rather than writing the value directly in the attribute. The default current date is today(). |
| Date Dimension | Specifies the name of the date dimension. This dimension is used in time-series calculations and Analysis Tables. |
| Extract Timestamp | Defines a timestamp value for later use in ProDiver. The timestamp value is accessed in ProDiver using the $EXTRACT_DATE and $EXTRACT_TIME macros. It is DI best practice to pass a parameter with the extract timestamp value to this attribute rather than writing the value directly in the attribute. |
To access column properties, select a column from the Column List. The following attributes are common column attributes. For a list of all column attributes, including attributes specific to certain data types, see Spectre Flow Column Tags.
| Attribute | Description |
|---|---|
| Name | Read only attribute displaying the name of the column. |
| Type | Specifies the data type of the column. Available data types are string, integer, double, fixed100, date, datetime, period, and boolean. |
| Sort By | Defines another column to sort by when this column is sorted. For example, setting Month Number as the Sort By column for Month sorts months by their number instead of their alphabetical order (1 (Jan), 2 (Feb), 3 (Mar), etc.). |
| Label | Defines a display name for a column. This name is displayed in ProDiver and DivePort, while calculations and other technical processes use the value in the Name attribute. |
| Required Dimension |
Sets a column to behave like a classic Info Field. In ProDiver, the info field is available as a column that you can add to other columns displayed in a dive. For example, to see the Address column requires that the Customer column is available.
|
| Suggested Dimension |
Allows you to promote or demote a column.
|
| Comment | Defines a comment that describes this column. |
Each object has an area where you can enter comments. It is DI best practice to enter a note for every object in a Spectre Flow script.
Every Spectre Flow node comment area is Markdown-enabled. For more information, see Workbench Markdown Editor.
The Excel Input object
column grid section lists the columns from the input files.
| Attribute | Description |
|---|---|
| Name | Displays the name of each input column. This attribute is read-only. |
| Alias | Defines an alternate name for one or more input columns. Spaces before or after an alias column name are ignored. Spaces within an alias column name are acceptable. |
| Type | Displays and sets the type of each input column. |
| Repeat if Blank | When set to true, each blank value in the column is given the value of the previous non-blank value in the column. For example, if the value of row 1 is "A", and row 2 has a blank value, row 2 is given the value "A". |
| Keep |
Manages which columns are kept in the output data flow. If no columns have a Keep check mark, all columns are kept in the output data flow, except for any explicitly marked Drop. Select the Keep check box for columns you want to explicitly keep in the output data flow. A number is automatically added in the Keep Order column when you select its Keep check box. After marking any column with a Keep check mark, only those marked Keep are kept in the output data flow. NOTE: After any Keep check boxes are checked, do not use the Drop check boxes, because clicking a Drop check box sets all Keep check boxes to unchecked. |
| Keep Order | Manages the order of the columns in the output data flow. By default, columns that are passed to the next object in the data flow are displayed in the order in which they appear in the Name column. You can change this order by typing a number in the Keep Order column. When you assign a Keep Order number, the Keep column is checked automatically. The Keep Order numbers might reorder to accommodate any changes you make. |
| Drop |
Manages which columns are removed from the output data flow. Select the Drop check box for columns that you want to explicitly suppress from the output data flow. NOTE: Use the Drop check boxes only when no Keep check boxes are checked. |