Home Search

DriveWorks Pro 20
Calculation Table

Send Feedback

Calculation Tables

Calculation Tables allow real time calculations, in tabular form, to be carried out during a specification.

The Calculation Tables list can be filtered by using the filter at the top of the list.

Please see the topic How To Use Filters for more advanced filtering information.

Calculation Tables are automatically listed in alphabetical order

Data from form controls can be used in the table and results can be returned to other form controls.

Rules can be built for each cell in the table, and these rules can reference other cells in the table either using an absolute reference or a relative reference.

Rows can be deleted from a Calculation Table, during specification, by applying the task Delete Calculation Table Rows.
Rows can be dynamically added to a Calculation Table, during specification, by applying the document Export To Calculation Table.
See Keyboard Shortcuts for a list of all the shortcuts you can use with Calculation tables.

Add Table

From DriveWorks Administrator, and with a project open, go to Stage 3: Data and Rules > Calculation Tables:

  1. Click Add Table from the command bar.
  2. Enter a Name for the table in the pop-up that appears.
    Table names can be up to 245 characters in length.

    However we recommend keeping the length to a minimum.

  3. Click OK.

    The Edit Calculation Table dialog will open.

  4. Enter the name for the required columns clicking the Add button after each.
    Column Names cannot begin or end with a number.

    This is to ensure there is no conflict with the absolute cell referencing that calculation tables use.

  5. Set the Type for each column by clicking in the Type column adjacent to the Name the Type is to be applied.

  6. Column order can be modified by selecting the Name to be moved and clicking the Move Up and Move Down buttons from the Edit dialog.
  7. Columns can be renamed by selecting the Name to be renamed and clicking the Rename button.
  8. Columns can be removed by selecting the Name to be removed and clicking the Remove button.

Column Types

Columns are set to be a specific type, these can be:

  • Data
  • Control Input
  • Control Output

Data type columns allow set values or rules to be entered.

Control Input type columns will take the value from a set of corresponding controls (see Form Control Name Matching below).

Control Output type columns allow set values or rules to be entered, and will return the result to a set of corresponding controls (see Form Control Name Matching below).

Form Control Name Matching

Columns set to be of the type Control Input and Control Output will have their column name matched to a form control.

Name matching will append the row number to the column name and look for a control with that name.

For example:

When a column with the name PanelWidth has been added to the Calculation Table;

And the Calculation Table has 4 rows;

The form controls PanelWidth1, PanelWidth2, PanelWidth3, and PanelWidth4 must exist on a user form.

Form controls with the required column name and row reference number can be added after the Calculation Table has been created.

When using a Control Output column, the Set Output Control Rules button will need to be clicked to update the rules in the controls if the rule is added or changed.

DriveWorks will detect a corresponding name has been added and will present a grey indicator in the corner of the applicable cells.

The Calculation Table will display the Control Names Return value in normal viewing mode.

Rules

Rules can be built for any column of the type Data or Control Output.

There are 2 types of rule that can be built:

  • Cell Rules
  • Column Rules

When the calculation table is selected, Cell rules are built by:

  1. Select the cell to have a rule applied and click the Build Cell Rules button from the command bar.
  2. The rule builder will open to allow a rule to be constructed in the usual way.

When the calculation table is selected, Column rules are built by:

  1. Select the cell to have a rule applied and click the Build Column Rules button from the command bar.
  2. The rule builder will open to allow a rule to be constructed in the usual way.

    When rows are added to the Calculation table, Column Rules will apply to each cell in the column.

See Writing Rules for more information.

Relative Cell Referencing

When building cell rules, using the result of another cell is done by using relative referencing.

Taking the position of the cell requiring the result (the cell having the rule built) as a starting point:

  • Numeric references are made according to how many cells away the cell that has the result is
  • Directional references are made using the following symbols:
    • u - Up
    • d - Down
    • l - Left
    • r - Right

Each co-ordinate is placed within square brackets [], and separated with a comma ,

So for example to get the value of a cell 3 down and 2 left, the reference would look like:

[3d,2l]

To get the value of a cell immediately to the right of the current cell, the reference would be:

[1r]

And to multiply the above two cells together the rule would be:

[3d,2l] * [1r]

Absolute Cell Referencing

Any cell can referenced directly from any rule in DriveWorks.

For example, the following rule references the 3rd cell down, in the Total column of the Prices table.

="Total Price: " & DWCalcPrices.Total3

While writing cell rules, you do not have to prefix these references with the table reference (e.g. DWCalcPrices) - so long as you want to reference a cell that is in the same table. I.e. you can just reference another cell via Price3 (assuming you have a column called Price and you have at least 3 rows in your table).

These cell references can possibly override your ability to reference controls (and other items, if you get creative with naming your columns), as the references have the same name. e.g. If you have a cell called Price3 and a control called Price3, a cell rule reference just written as Price3 will reference the cell, not the control.

You can prefix references with exclamation marks (!) to ensure that you are referencing a control or any other "root" item. E.g. !Price3 will not reference a cell, but will reference a control.

Rename

Will rename the selected Calculation Table.

The renamed table will be ordered alphabetically in the list.

Renaming a table will scan all rules and replace any occurrence of the old name with the new name.

If DriveWorks detects that this could cause a delay, then the following message will be displayed.

Updating table names in rules is only supported when renaming project tables.

Renaming Group Tables, for example, will not scan every project in the group.

Delete Table

Will delete the selected Calculation Table.

Edit Columns

Allows existing columns to be edited, or more columns added.

Add Rows

Will add rows to the selected Calculation Table.

Multiple rows can be added by clicking the drop down on the Add Rows button, the following dialog will be displayed:

Select the Number of Rows to be inserted and click OK.

Set Output Control Rules

Will match Control Output type columns in the selected Calculation Table to Form Control names that have been added.

This will set the Text or Text (Override) property of any form control that has the name of the column in the Calculation Table, proceeded with the row number, with a rule that references the Calculation Table and cell.

Show Values

This toggles the view of the selected Calculation table between:

  • Displaying the rule that has been entered into a cell
  • Displaying the result of the rule

Cut

Calculation Table cells, rows and columns can be cut from the selected Table and pasted into another Table.

  1. Select the cell, row or column to be cut.

    Multiple cells, columns or rows can be selected by holding the Ctrl key when selecting.

  2. Click the Cut button.
  3. Select the destination Table and click the Paste button.

Copy

Calculation Tables can be copied and pasted into any Project (this includes the current Project, a Project within the existing Group or a Project in another Group).

  1. Select the Calculation Table to be copied.
  2. Click the Copy button.
  3. Select the Calculation Table view, in the destination Project, and click the Paste button.
    When copying a Calculation Table into a Project, where a Table with the same name exists, the copied Table name will be suffixed with the next number available.

Calculation Table cells, rows and columns can be copied from the selected Table and pasted into another Table.

  1. Select the cell, row or column to be copied.

    Multiple cells, columns or rows can be selected by holding the Ctrl key when selecting.

  2. Click the Copy button.
  3. Select the destination Table and click the Paste button.

DriveWorks Quick Tips

DriveWorks Quick Tips: Calculation Tables

Calculation tables give you the ability to remove redundant variables. In this example, we take a room with known dimensions and panelling of known sizes and use calculation tables to tell us how many panels we can have in that room. Calculation tables take user input or data and, using rules, create export data. That data takes the place of using several similar variables.

DriveWorks Quick Tips are a series of 1 minute videos, available on YouTube, that explain specific functionality. View all Quick Tips


See Also

Delete Calculation Table Rows

Export To Calculation Table

Keyboard Shortcuts