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.
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.
From DriveWorks Administrator, and with a project open, go to Stage 3: Data and Rules > Calculation Tables:
However we recommend keeping the length to a minimum.
The Edit Calculation Table dialog will open.
See Column Types below for more information on what each type is.
This is to ensure there is no conflict with the absolute cell referencing that calculation tables use.
Columns are set to be a specific type, these can be:
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:
Type | Control Input | Data | Control Output |
PanelWidth | PanelDepth | SheetWidth | |
---|---|---|---|
1 | PanelWidth1Return | 15 | [2l]+[1l] |
2 | PanelWidth2Return | 20 | [2l]+[1l] |
The Calculation Table above will:
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 can be built for any cell column of the type Data or Control Output.
There are 2 types of rule that can be built:
When the calculation table is selected, Cell rules are built by:
When the calculation table is selected, Column rules are built by:
When rows are added to the Calculation table, Column Rules will apply to each cell in the column.
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:
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]
The value of any cell can be used by referencing its owners name.
[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).
[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.
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.
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.
Will delete the selected Calculation Table.
Allows existing columns to be edited, or more columns added.
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.
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.
This toggles the view of the selected Calculation table between:
Calculation Table cells, rows and columns can be cut from the selected Table and pasted into another Table.
Multiple cells, columns or rows can be selected by holding the Ctrl key when selecting.
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).
Calculation Table cells, rows and columns can be copied from the selected Table and pasted into another Table.
Multiple cells, columns or rows can be selected by holding the Ctrl key when selecting.
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