Building the Model: Advanced Elements > Arrays > Import Data into Arrays

Import Data into Arrays

When you import data, from either an external Excel spreadsheet or SQL database, into an array, ProModel loads the data from left to right, top to bottom. Although there is no limit to the quantity of values you may use, ProModel supports only two-dimensional arrays.

Import from an Excel Spreadsheet

Import File The name of the spreadsheet you will use. You may enter either a fully qualified path to your .xls file or a path relative to your .mod file. For example, if your .xls file is in the same directory as your .mod file, simply enter the name of the .xls file into this field.

 

Sheet Name The name of the sheet from which you will import the array data.

Please Note: If your spreadsheet contains only a single data set, ProModel will automatically load the data into the array—you do not have to define any cell information unless you wish to limit the contents of the array to a portion of the data set. Array import requires Microsoft Excel 97 or later.

Import Start Cell The first piece of data to place into the array. Enter the Excel cell reference (e.g., A1), which is the column letter and row number.

Import End Cell The last piece of data to place into the array. Enter the Excel cell reference (e.g., D20), which is the column letter and row number.

How to import Excel spreadsheet data into array:

  1. Select Arrays from the Build menu.
  2. Select or create the array record (row) you wish to import.
  3. Click the Import File button on the Arrays dialog.
  4. In the File field, enter the name of the spreadsheet you wish to use (you may also browse to select a file).

  1. In the Sheet Name field, enter the name of the worksheet that contains the data you wish to use.
  2. Enter the Import Start Cell location. The value in this cell will occupy the first position in the array. Enter the Excel cell reference (e.g., B50), which is the column letter and row number.
  3. Enter the Import End Cell location. The value in this cell will occupy the last position in the array. Enter the Excel cell reference (e.g., E100), which is the column letter and row number.
  4. Click OK.

Import from a SQL Database

Connection String The connection string used to connect to the SQL database including all necessary security parameters.

 

Query or Stored Procedure Enter the SQL query or the name of the stored procedure to be executed during the model’s initialization logic to populate the array.

How to import SQL database data into array:

  1. Select Arrays from the Build menu.
  2. Select or create the array record (row) you wish to import.
  3. Click the Import File button on the Arrays dialog.
  4. Click on the Database radio button.

  1. In the Connection String field enter the necessary string to connect to the desired database.
  2. In the Query or Stored Procedure field enter the SQL query or stored Procedure name that will be used to populate the array during the initialization logic.
  3. Click OK.

© 2012 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com