SAMPLE_P

When used within a query the function produces a recordset of only a percentage 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_P ( <table_name or expression>, <percent> )
  • 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.

  • percent: A number representing the percent of records to return at random from the recordset defined by the expression argument.

Example: create a query at the CUSTOMER level

SAMPLE_P(CUSTOMER,55.6)