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.
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:
Choose the first property, a comparison operator, and the values or properties to compare to the first property.
Type the value of the computed property for each comparison.
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. |
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:
If CallType is equal to "loc", then Price=0.10
If CallType is equal to "int", then Price=0.60
If CallType is equal to "inf", then Price=0.20
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.
Name: Type the name of the component (mandatory).
Description: Allows you to type the description of the component (optional).
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.
Name: Allows you to type the name of the computed property. This property is assigned a value depending on the comparisons that are set up in the table. The property name appears in the heading of the third column .... ?= of the table. Example: If you type Price, the third column heading in the table displays ...Price=.
Type: Select String or Number as the type of the computed property.
Default Value: Allows you to type the default value of the computed property, or allows you to select a numerical property that represents the default value. The computed property is assigned the default value if no comparison is true.
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:
is equal to: For example, if a property that contains "06526179" is compared with the second column entry that contains "06526179", the comparison is true; otherwise, the comparison is false.
starts with: For example, if a property that contains "06526179" is compared with the second column entry that contains "06", the comparison is true; otherwise, the comparison is false.
ends with: For example, if a property that contains "06526179" is compared with the second column entry that contains "79", the comparison is true; otherwise, the comparison is false.
contains: For example, if a property that contains "06526179" is compared with the second column entry that contains "261", the comparison is true; otherwise, the comparison is false.
...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.