SAMPLE_N
When used within a query the function produces a recordset of only a number of the records from the input recordset.
The records are selected at random from the input recordset.
When used within a virtual field the function will return True for records that match the criteria given and False for those records that do not.
The records flagged as True are selected at random throughout the input recordset.
SAMPLE_N ( <table_name or expression>, <number of records> )
-
table name or expression: Can be either a table name, or an expression (a query string or another query domain function) resulting in a recordset.
-
number of records: A number representing the number of records to return at random from the recordset defined by the expression argument.
Example: create a query at the CUSTOMER level to return 55 records
SAMPLE_N(CUSTOMER,55)
Note: the sample will include all records if there are fewer records in the table or expression than the requested number, e.g. if SAMPLE_N (CUSTOMER,1000) is used but the CUSTOMER table only has 980 records, the sample size will be 980.