Switch Table Operator

The Switch Table Operator compares the same property with one or more values or properties of the same type. When a comparison is true, the test stops and a numerical or string value is assigned to a computed property. If no comparison is true, a default value is assigned to the computed property.

Use

In a price plan, you may need to apply different prices that depend on the value of a property. To use the Switch Table Operator inside your price plan, do the following:

  1. Choose the first property, a comparison operator, and the values or properties to compare to the first property.

  2. Type the value of the computed property for each comparison.

  3. Describe the pricing of each value of the computed property.

Note:  The Switch Table Operator stops the test when a comparison is true; therefore, the order of the comparisons in the table is important.

Example

An operator bills telephone calls that depend on the duration and the type of call (local, international and information). In the price plan, the property "CallType" is assigned one of these three values: "Loc", "Int" or "Inf". In the Switch Table Operator component, the computed property "Price" is expressed in cents/minute and is assigned three values as described in the following table:

Property

Comparator

Value

Price

CallType

equal to

Loc

$0.10

CallType

equal to

Int

$0.60

CallType

equal to

Inf

$0.20

The table rows mean that:

The string property CallType is compared with the values "loc", "int" and "inf". Price is a new numerical property that is assigned a numerical value for each comparison. The Switch Table Operator stops the test when a comparison is true, and then Price is assigned the value relating to the comparison. For example, if CallType is equal to "inf", the value of Price is 0.20. If no comparison is true, a default value is assigned to Price.

Identification area

Name: Type the name of the component (mandatory).

Description: Allows you to type the description of the component (optional).

Definition tab

Property Name: Provides the list of properties. Select a property. The selected property is compared with the values or properties that are set up in the table. The property name appears in the heading of the first column If ? ... of the table. Example: If you select a property called Duration, the first column heading displays If Duration ....

Parameters of the computed property: Allows to name and set up the computed property, which is assigned a value depending on the comparisons of the table.

Table area

Each row added to the table allows you to make a comparison such as: If (condition) then (result). Example: If Duration... is equal to ... the value ...25...Price=100, where Duration is the property that you select in the Property Name list and Price is the computed property name.

: Adds a row to the table. Click this button to add a comparison.

: Deletes a row from the table. To remove a comparison, select the corresponding comparison row, and then click this button.

: Moves a row up in the table. To move a comparison up, select the corresponding comparison row, and then click this button.

: Moves a row down in the table. To move a comparison, select the corresponding comparison row, and then click this button.

: Opens the Open dialog box to search for a file and import data into the table. Click this button when you want to create comparisons with data from a CSV file instead of manually entering the data.

: Deletes all the rows in the table. Click this button to delete the list of comparisons.

If ? ...: The "?" symbol is replaced by the property that you select in the Property Name list. Each row that you add to the table allows you to select one of the following operators:

...the value...: Each row added to the table allows you to type a value or select a property to compare with the first column.

... ? =: The "?" symbol is replaced by the computed property name. Each row added the table allows you to type a value or select a property, either of them is assigned to the computed property when the comparison is true.