Table Variables
Table variables are a special type of variable that represent a table. Table variables are like having a spreadsheet of values available to you from one variable name. You indicate a single value (like a ‘cell’ in a spreadsheet) by indicating which value from a specific row and column of data you want. Table variables provide 1-dimensional and 2-dimensional array capability.
Table variables can be incredibly useful, allowing loading many values for reference all at once, storing multiple values, and in general greatly reducing the number of separate variables that you need. For example, you could load values that control task durations, decision percentages, or other characteristics of process flow. As another example, you could store values of current model state at various steps, to share information across the model, or to store model state to have intermediate values for reporting purposes.
Defining and Initializing Table Variables
To define a table variable, go to the variables tab and change the type of a variable to table.

Once you do so, the initial value input will change to allow you to import a table. Click on New and follow the instructions. Certain values cannot be stored in a table variable; for example, durations with a unit (e.g., “10 seconds”) cannot be ‘understood’ as a Duration directly by the simulator, and would be seen as text and have to be ‘parsed’ to be used in Duration expressions.




Once you have finished importing a table, you are ready to get started using them in your expressions. To use them, go to any expression box and use the following syntax: Variable[Row, Column]. If you then run a simulation, the expression will use the value in your data.

Lastly, after you run a simulation, you can view the table that is stored in a variable by going to the model tab of the results and clicking on the icon under the variable name.

Assignments
In addition to simply using table variables, you can also assign new values to them. To do so, create an assignment as normal, but select your table variable. When you do so, two new input fields will appear: Row and Column. These allow you to specify what ‘cell’ (value at the specified row and column) will be assigned to.


If you go back to the assignments page, you can get a preview of the assignment, using the same syntax as when you use a table variable.

You may add new rows to a Table. When you assign to a table variable, you must assign to an existing column, but not necessarily to an existing row. If you try to assign to a column that does not exist in your data, you will get an error that stops the current simulation. If you assign to a row that does not exist, a new row will be created without warning.