This Specification Flow Task will set the number of rows in a Calculation Table.
Property Name | Description |
---|---|
Title | Changes the Title (not the name) of the task. |
Calculation Table Name | The name of the Calculation Table. |
Row Count | The number of rows to set the Calculation Table to. |
This connection point can be linked to another task, such as Drive Constant Value, to report the number of rows that were added or subtracted.
The value will be positive for rows added and negative for rows subtracted.
When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.
Property Name | Example Rule | Example Result | Meaning |
---|---|---|---|
Calculation Table Name | MyCalculationTable | MyCalculationTable | Will set the row count on the Calculation Table named MyCalculationTable. |
Row Count | CalcTableRowsToUseReturn | 4 | Will set the row count to the value of the control CalcTableRowsToUse. |
The following shows a basic example of how this task can be used to display a set number of rows from a Calculation Table.
The Calculation Table below (named MyCalculationTable) consists of 5 rows of data.
Column Rules have been built for each Column Value, this is so the example can display more rows than the 5 applied in the Calculation Table.
Cell rules can be used in the Calculation Table but only if you will be needing the same amount or less than the rows applied to the table.
BaseNumber | Multiplier | RandomValue | SumColumnValue | |
---|---|---|---|---|
1 | ExtractNumber(MyName()) | 125 | Round(RandBetween(1,100),0) | [3l]+[2l]+[1l] |
2 | ExtractNumber(MyName()) | 125 | Round(RandBetween(1,100),0) | [3l]+[2l]+[1l] |
3 | ExtractNumber(MyName()) | 125 | Round(RandBetween(1,100),0) | [3l]+[2l]+[1l] |
4 | ExtractNumber(MyName()) | 125 | Round(RandBetween(1,100),0) | [3l]+[2l]+[1l] |
5 | ExtractNumber(MyName()) | 125 | Round(RandBetween(1,100),0) | [3l]+[2l]+[1l] |
A Specification Macro (SetCalcRows) is required that will use the Set Calculation Table Row Count Task.
We can also drive the Row Count Delta (the number of rows subtracted or added) into a constant (DWConstantRowCountDelta) using the Drive Constant Value Task.
And
Create a constant named RowCountDelta.
This will enable you to complete the properties for these tasks.
The following controls have been added to our user form:
The Row Count property of the Set Calculation Table Row Count Task should be set to the return value of this control.
The Macro Name property of this control should be set to the name of the Specification Macro created above (SetCalcRows).
The Items property of this control should be set to the name of the Calculation Table created (MyCalculationTable).
The Text property of this control should include the constant (DWConstantRowCountDelta) to be displayed on the user form.
When a specification is run, and before the Macro button is executed, the Data Table will display all the rows from the Calculation Table.
When the Spin Button is set to 4 (1 less row than in the Calculation Table), and the Macro Button is executed, the Data Table will display only the first 4 rows of the Calculation Table.
The Row Count Delta will be -1.
When the Spin Button is set to 8 (4 more Row than previously selected), and the Macro Button is executed, the Data Table will display 8 rows of the Calculation Table.
The Row Count Delta will be 4.
See also Delete Calculation Table Row.