# Functions influence the number of evaluation sets

For this example, you have the following rule:

``NumberSet ( s ) = A:Card1 + SUM ( B:Card1 )``

Using the same values for A and B, there are only three evaluation sets as shown.

NumberSet = 7
A Values B Values
1 3
2 2
3 1
NumberSet = 8
A Values B Values
1 3
2 2
3 1
NumberSet = 9
A Values B Values
1 3
2 2
3 1

``NumberSet ( s ) = SUM ( A:Card1 ) + SUM ( B:Card1 )``

there is one evaluation set: NumberSet = 12

A Values B Values
1 3
2 2
3 1

If you have the following rule:

``NumberSet ( s ) = A:Card1 + EXTRACT ( B:Card2 , B:Card2 != 2 )``

the order of the operands does not affect the order of evaluation set selected. This is because an A is selected, then the EXTRACT is evaluated, then evaluation sets are determined for that A and a given EXTRACT result. When all EXTRACT results are used, the next A is selected, and so on.

Given the same data, this time you get the following results:

Evaluation # A B Extract Values Result
1 1 3 4
2 1 1 2
3 2 3 5
4 2 1 3
5 3 3 6
6 3 1 4

As another example, the following map rule applies to the output Status(s):

``````= IF ( Quantity:Order Record:Order > 10 &
OR ( Store:Order Record:Order = "A" ) ,
"Accept" , "Reject" )``````

The first argument of the IF function is an expression. One evaluation set of this expression requires:

• the Order
• one Order Record
• one Quantity of the selected Order Record
• all the Stores of the selected Order Record

The IF function evaluates once for each Quantity of each Order Record. Other than the first argument of the IF function, nothing else in the map rule affects the number of times the map rule will be evaluated. So, if there are 1000 Quantity data objects contained in Order, this map rule will evaluate 1000 times.