MULT macro

The MULT macro is available in HCL® Campaign and HCL Interact.

Syntax

data MULT multiplier data * multiplier

Parameters

data

The numerical values to multiply. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your HCL product.

multiplier

The number to multiply all values in the specified column by. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. The number of columns in multiplier must equal the number of columns in data, unless multiplier is a constant. For the format definition of multiplier (same as data), see the "Macro Function Parameters" section in the chapter in this guide for your HCL product.

Description

MULT multiplies the values in the two specified data ranges. It returns one new column for each input column, each containing the numbers in data multiplied by multiplier. If multiplier is a constant, each value in data is multiplied by that value. If multiplier is a column, the calculations are performed on a row-by-row basis. The values in data are multiplied by the first row value of multiplier, the second row with the second row, and so on. This row-by-row calculation produces a result for each row up to the last value of the shortest column.

Note: Using a column containing the same number x in each row as multiplier is the same as using the constant x as multiplier.
Note: The MULT operator can be abbreviated with an asterisk ( *).

Examples

TEMP = 8 MULT 4 or TEMP = 8 * 4

Creates a new column named TEMP containing the value 32.

TEMP = V1 * 8

Creates a new column named TEMP, where each value is the contents of column V1 multiplied by eight.

TEMP = V1:V3 * 2

Creates three new columns named TEMP, VX, and VY. The values in the TEMP column are two times the contents of column V1, the values of the VX column are two times the contents of column V2, and the values of the VY column are two times the contents of column V3.

TEMP = V1 * V1

Creates a new column named TEMP containing the square of each value in column V1.

TEMP = V1 * V2

Creates a new column named TEMP, where each value is the row value of column V1 multiplied by the corresponding row value of column V2.

TEMP = V1:V3 * V4:V6

Creates three new columns named TEMP, VX, and VY. The column TEMP contains the values in V1 times the corresponding row values of column V4. The column VX multiplies column V2 by V5. The column VY multiplies column V3 by V6.

TEMP = V1[10:20] * V2 or TEMP = V1[10:20] * V2[1:11]

Creates a new column named TEMP, where the first 11 cells contain the values in rows 10-20 of column V1 times the values in rows 1-11 of column V2. The other cells in TEMP are empty.

Related functions

Function Description
DIV Divides one specified data range by another
EXP Computes the natural number (e) raised to the contents of each cell in the specified data range
POW Computes a base value raised to the specified exponential power(s)