Home Search

DriveWorks Pro 22
SppTableColumnAddValue

Send Feedback

SppTableColumnAddValue

This function adds a value to each cell in the specified column of a table.

Syntax

SppTableColumnAddValue([Table],[Column Index],[Value])

Where:

Table is a table array or the name of a table (this can be any DriveWorks table such as a simple table or calculation table, or the result of a QueryDataValues function).

Column Index is the column of cells to add the value. A number starting at 1 for the first column.

Value is the number to add to each of the cells in the specified column.

Examples

Example Data

A table named MyNumbers containing the following data:

First Second
41
82
153
164
235
426

Example 1

RuleResultMeaning
SppTableColumnAddValue(DwLookupMyNumbers, 2, 10){"First","Second";4,11;8,12;15,13;16,14;23,15;42,16}Will return an array of the table MyNumbers with 10 added to all the values in the second column.

Example Result Viewed As A Table

The result of the above example when viewed as a table.

FirstSecond
411
812
1513
1614
2315
4216

Example 2 - Subtraction

This function can also be used to do subtraction by using a negative number as the Value.

RuleResultMeaning
SppTableColumnAddValue(DwLookupMyNumbers,1,-1){"First","Second";3,1;7,2;14,3;15,4;22,5;41,6}Will return an array of the table MyNumbers with 1 subtracted to all the values in the first column.

Example Result Viewed As A Table

The result of the above example when viewed as a table.

FirstSecond
31
72
143
154
225
416