For the horse at the top row of a starters view in natural order, the function will return the value of the expression embedded in the string of the first argument. For horses at other rows, the function will return the value of the expression embedded in string of the second argument (.NULL. will be returned if the second argument is missing). We can use this function to get a datum from one and only one horse of a race. Incorporating with the statistics (pushing the 'Stat' button) feature, we can calculate statistics on a race-based (instead of horse based) item.
"Natural order" in the above paragraph means:
• | In past races: ordered by finishing positions |
• | In races without finishing positions: ordered by horse numbers |
Syntax
IfAtTop('fTrueExpression','fFalseExpression')
Returns
The same data type as the expression contained in the argument strings
Example
In the following example, the formula IfAtTop('HrRunners( )') is applied to the fourth column of the view. Lombard is the horse at top of the view in natural order. No matter what current order the view is in (e.g., in the right figure the view is sorted by horse names), the function will always return 12 (number of runners) in the row of Lombard and return .NULL. in other rows.
Remark: No matter what current order is, when you push the left top small button of the grid, the view will be reset to the natural order.
Page url: http://www.racematenet.com/english/help/index.html?ifattop.htm