Home Search

DriveWorks Pro 22
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.

    See Column Types below for more information on what each type is.

    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 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.

When a column is set to either of these types DriveWorks will look for a Form Control with the name:

[ColumnName][RowNumber]

For example, the following table shows a Calculation Table with the column types set as shown:

TypeControl InputDataControl Output
PanelWidthPanelDepthSheetWidth
1PanelWidth1Return15[2l]+[1l]
2PanelWidth2Return20[2l]+[1l]

The Calculation Table above will:

  • Use the value returned from the Form Control named PanelWidth1 in row 1 of the PanelWidth column.
  • Use the value returned from the Form Control named PanelWidth2 in row 2 of the PanelWidth column.
  • Send the value calculated in row 1 of the SheetWidth column to the Form Control named SheetWidth1.
  • Send the value calculated in row 2 of the SheetWidth column to the Form Control named SheetWidth2.

Control Output Columns

Form controls with the required name can be added after the Calculation Table has been created.

When a Form Control, with the required named is found

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 cell 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

The value of any cell can be used by referencing its relative position.

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

The value of any cell can be used by referencing its owners name.

  • To reference a cell in the same Calculation Table, use:

    [ColumnName][RowNumber]

    For example, the following rule references the Total column and 3rd cell down.

    =Total3

    To multiply the value of this Calculation Table cell with a Form Control, the Variable rule would be:

    Total3 * QtyReturn

    Referencing Form Controls

    To explicitly use the name of a Form Control (and not the name of the Calculation Table column and row) prefix the name with the ! symbol.

    For example

    =!Total3

    This will use the value of the Form Control named Total3 (and not the Calculation Table cell named Total3).

  • To reference a cell from another Calculation Table or in a rule anywhere in DriveWorks (for example from a Variable), use:

    [CalculationTableName].[ColumnName][RowNumber]

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

    =DWCalcPrices.Total3

    To multiply the value of this Calculation Table cell with a Form Control, the Variable rule would be:

    =DWCalcPrices.Total3 * QtyReturn

The function Indirect can be used to build an owners name to return its result.

The function MyNumber will return any number used within an owners name.

The function MyName will return the name assigned to the owner of the rule.

Absolute Columnar Referencing

A columnar range can be referenced from any rule in DriveWorks.

This is done by including the column heading after the Calculation Table name, for example:

=DWCalcPrices.Total

Referencing a columnar range returns a single column Array, with the header row set to the name of the column, and one data row per data row of the calculation table containing the column's values.

An example of using a columnar range can be seen in the function TableColumnLookup.

A Columnar range can also be referenced within the same Calculation Table as the column exists, without creating a circular dependency, as long as it is used within a different column to the one being called.

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