EQ macro
The EQ
macro
is available in HCL®
Campaign and HCL
Interact.
Syntax
data1 EQ data2 data1 == data2
(data1 = data2)
Parameters
data1
The
cell range to compare. 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.
data2
The
number(s) to compare all values in the specified column against. 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 data2
must
equal the number of columns in data1
, unless data2
is
a constant. For the format definition of data
, see
the "Macro Function Parameters" section in the chapter in
this guide for your HCL
product.
Description
EQ
compares
the two specified data ranges, returning a one if the values are equal
or a zero if they are not equal. It returns a new column for each
input column, each containing the corresponding column in data1
compared
to the corresponding column of data2
(that is, the
first column of data1
is compared to the first column
of data
, the second column with the second column,
and so on).
If data2
is a constant, each value
in data
is compared to that value. If data2
is
a column, the calculations are performed on a row-by-row basis. The
values in data1
are compared to the first row value
of data2
, 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.
When comparing strings, case does not matter (that is, "Yes", "YES", "yes", and "yeS" are all considered equal).
EQ
operator
can be abbreviated with a double equal sign (==
).
Inside parentheses, a single equal sign (=
) also
can be used for the EQ
macro function (outside parentheses,
the equal sign is interpreted as the assignment operator).Examples
TEMP = 3 EQ 4 or TEMP = 3==4 or
TEMP = (3=4) Creates a new
column named |
TEMP = "No" == "NO"
Creates a new column named |
TEMP = V1 == 8 Creates
a new column named |
TEMP = V1==V1 Creates
a new column named |
TEMP = V1==V2 Creates
a new column named |
TEMP = V1:V3 == V4:V6
Creates three new columns named |
TEMP = V1[10:20] == V2 or TEMP =
V1[10:20] == V2[1:11] Creates a new
column named |
Related functions
Function | Description |
---|---|
EQ |
Returns TRUE if one data range is equal to another |
GE |
Returns TRUE if one data range is greater than or equal to another |
GT |
Returns TRUE if one data range is greater than another |
LE |
Returns TRUE if one data range is less than or equal to another |
LT |
Returns TRUE if one data range is less than another |
NE |
Returns TRUE if one data range is not equal to another |