Home Search

DriveWorks Pro 20
SppTableColumnMultiplyByValue

Send Feedback

SppTableColumnMultiplyByValue

This function multiplies each cell in the specified column of a table by a value.

Syntax

SppTableColumnMultiplyByValue([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 multiply each of the cells in the specified column by.

Examples

Example Data

A table named MyNumbers containing the following data:

First Second
41
82
153
164
235
426

Example 1

RuleResultMeaning
SppTableColumnMultiplyByValue(DwLookupMyNumbers, 2, 100){"First","Second";4,100;8,200;15,300;16,400;23,500;42,600}Will return the table MyNumbers with all the values in the second column multiplied by 100.

Example Result Viewed As A Table

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

FirstSecond
4100
8200
15300
16400
23500
42600

Example 2 - Division

This function can also be used to do division by using a decimal or fraction as the Value.

RuleResultMeaning
SppTableColumnMultiplyByValue(DwLookupMyNumbers, 1, 0.5)

Or

SppTableColumnMultiplyByValue(DwLookupMyNumbers, 1, 1/2)

{"First","Second";2,1;4,2;7.5,3;8,4;11.5,5;21,6}Will return the array all the values in the first column divided by 2.

Example Result Viewed As A Table

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

FirstSecond
21
42
7.53
84
11.55
216