OR macro

The OR macro is available in Unica Campaign and Unica Interact.

Syntax

data1 OR data2 data1 || data2

Parameters

data1

The numbers to logical OR with the values in data2. 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 product.

data2

The number(s) to logical OR with the values in data1. 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 product.

Description

OR calculates the logical OR between the two specified data ranges. It returns a new column for each input column, each containing the corresponding column in data1 logically OR-ed to the corresponding column of data2 (that is, the first column of data1 is logically OR-ed to the first column of data, the second column with the second column, and so on).

If data2 is a constant, each value in data1 is logically OR-ed by that value. If data2 contains one or more columns, the calculations are performed on a row-by-row basis between one column from data2 and one column from data2. The first row of data1 is logically OR-ed 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.

Note: Using a column containing the same number x in each row as data2 is the same as using the constant x as data2.
Note: The OR operator can be abbreviated with a double-vertical bar (||). Use the double-vertical bar to separate the two arguments (for example, to specify V1 OR 3, you can simply type V1||3).

Examples

TEMP = 1 OR 8 or TEMP = 1 || 8

Creates a new column named TEMP containing the value one (any non-zero number is treated as a one).

TEMP = V1 || 1

Creates a new column named TEMP containing all ones (every value OR-ed with the number one produces one).

TEMP = V1 || V2

Creates a new column named TEMP, where each value is the row value of column V1 logically OR-ed with 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 logically OR-ed with the corresponding row values of column V4. The column VX contains the logically OR-ed values from columns V2 and V5. The column VY contains the logically OR-ed values from columns V3 and V6.

TEMP = V1[10:20] || V2

Creates a new column named TEMP, where the first 11 cells contain the logical OR-ed result of the values in rows 10-20 of columns V1 and V2. The other cells in TEMP are empty.

Related functions

Function Description
AND Computes the logical AND between two specified data ranges
NOT Computes the logical NOT of the contents of the specified data range