4.7 Values from Next Row

Use the expression to obtain value from the previous record without specifying the field name to obtain the value in the next record. The specification of the data types are shown in 4.4.

It is possible to calculate total by combining if function with top() function. The cumulative calculation on the amount field is shown below.

$ mcal c='if(top(),${amount},${amount}+#{})' a=cumulativeAmount

Table 4.4: Specification to retrieve values from previous row

Data Type

Format

Example

Numeric($num$)

#{}

#{}

Character String($str$)

#s{}

#s{}

Date($date$)

#d{}

#d{}

Time($time$)

#t{}

#d{}

Boolean($bool$)

#b{}

#b{}