Home Search

DriveWorks Pro 21
Calculation Tables

Send Feedback

Calculation Tables

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

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.

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 and click OK.

    The Edit Calculation Table dialog will open.

  3. Enter the name for the required columns clicking the Add button after each.
  4. Set the Type for each column by clicking in the Type column adjacent to the Name the Type is to be applied.

  5. 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.
  6. Columns can be renamed by selecting the Name to be renamed and clicking the Rename button.
  7. 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.

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.

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.

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