The IsMemberOf function

The IsMemberOf (IMO) function provides an efficient method for identifying and acting on large quantities of lookup table data to determine which records contain a specified value.

Any component where you can build a Boolean expression can use the IMO operator. That is, it can be used in Simple, Container Manipulator, Action, and Boolean expression components.

The IMO compares a single value with a single field in each row contained in a Select component. The field used for comparison in the Select component cannot use a function. A function reduces the data returned by a Select component to a scalar value, and the IMO requires a set of values.

Most often the Select is obtains its data from a lookup table, but it can also be obtain its data from a Container component, or another Select component.

The data type of the single value and the data type of the field in the Select must be the same. The value used for comparison is any value that can be created in the Value Selector (for example, integer, double, or string).

Usage

IMO is the most efficient way to check whether a value is equal to any value in a large group of values.

Suppose your organization offers 1000 products for sale. Of the 1000 products, there are 300 for which you send a rebate coupon. On first thought, you might create a Simple component that recognizes each one of the 300 product numbers. However, this method has some drawbacks.

  • A Simple Event that identifies 300 product numbers is cumbersome to create.
  • A Simple Event that identifies 300 products is difficult to maintain should you need to change the products included in the promotion.
  • There is a limit to the number of characters that can be included in every component. The 300 product codes that need to be identified may exceed the length boundary of the Simple component.

Opportunity Detect provides the IMO function to effectively address these issues.

Usage example

The following steps describe an efficient method for identifying the 300 products in the example above.

  1. Create a lookup table listing all 1000 product codes with a flag that indicates whether the product offers a rebate.

    Product codes can easily be added to or removed from this table, and the associated flag can be changed as products are included or removed from the promotion.

  2. Create a Select component, named Select_1 in this example. This component queries the lookup table for records that have a flag indicating that the product is included in the promotion. Include the product code in the Output panel.

    This step efficiently identifies only the products that are included in the promotion.

  3. Create a Simple component that processes transaction records and uses an inline Boolean expression in its Firing Condition.

    The Boolean expression uses IMO to compare a product code in a transaction record to the data returned by the Select component.

    If the Boolean expression is true, the Simple component fires its event.

    In this example, if the transaction data source is named StorePurchases, and it contains a field named ProductCode, the expression would look like this: StorePurchases.ProductCode IsMemberOf Select_1

  4. Create an Action component that includes any data from the transaction data source that is needed to process the rebate offer.

The following diagram illustrates this usage example.


Diagram that illustrates this usage example.