Performing record sampling

Concept Information

SAMPLE command

You can create a new table that contains a representative sample of the data in the active table.

Record sampling is appropriate if you are interested in the rate of deviation from a prescribed control.

Note

This procedure does not include filtering (IF statements) or scope parameters because applying these options compromises the validity of a sample.

Steps

Note

Detailed information appears after the steps. See Sample dialog box options.

Do not include the thousands separator, or the percentage sign, when you specify values. These characters prevent the command from running, or cause errors.

  1. In the Navigator, open the table you want to draw a sample from.
  2. Select Sampling > Record/Monetary Unit Sampling > Sample.
  3. On the Main tab, select Record.
  4. In the Sample Parameters panel, specify a sample selection method:
    • Fixed Interval
    • Cell
    • Random
  5. Enter the sample parameters for the selection method you chose:
    Selection methodSample parameters
    Fixed Interval
    • Interval
    • Start (optional)
    Cell
    • Interval
    • Seed (optional)
    • Algorithm – leave Mersenne Twister selected
    Random
    • Size
    • Seed (optional)
    • Population (optional) – prefilled with the number of records in the table
    • Algorithm – leave Mersenne Twister selected

    Note

    Sample parameters are explained in detail below.

  6. In the To text box, specify the name of the Analytics table that will contain the output results.
  7. On the More tab, select one of the following:

    RecordThe entire record is included in the output table.

    Fields Only the selected fields are included in the output table.

  8. If you chose Fields, select the field(s) to include in the output table from the Extract Fields list.
  9. Optional. Select Report Selection Order if you want to add the ORDER field to the output results.

    Note

    Report Selection Order is available only if both the Random selection method and Fields output are selected.

  10. Click OK.

Sample dialog box options

The tables below provide detailed information about the options in the Sample dialog box.

Main tab

Options – Sample dialog box Description
MUS

Record

The sample type:

  • MUS Monetary unit sampling

    Appropriate if you are interested in the total amount of monetary misstatement in a file.

  • Record Record sampling

    Appropriate if you are interested in the rate of deviation from a prescribed control.

Sample On

Not used for record sampling.

Fixed Interval

Specifies that the fixed interval method is used for sample selection.

Samples are selected based on an interval value and a start number that you specify. For more information, see Fixed interval selection method.

If you selected Fixed Interval enter the following values:

  • Interval (required) – the interval value that was generated by calculating the sample size

    Note

    If you have not already calculated the sample size, you can click Size to open the Size dialog box. For more information, see Calculating sample size for a record sample.

  • Start (optional) – a start number that is greater than zero and less than the interval value

    Tip

    Enter a start number of ‘0’, or leave the start number blank, if you want Analytics to randomly select a start number.

Cell

Specifies that the cell method is used for sample selection.

The data set is divided into multiple equal-sized cells or groups, and one sample is randomly selected from each cell. The interval value dictates the size of each cell. For more information, see Cell selection method.

If you selected Cell enter the following values:

  • Interval (required) – the interval value that was generated by calculating the sample size

    Note

    If you have not already calculated the sample size, you can click Size to open the Size dialog box. For more information, see Calculating sample size for a record sample.

  • Seed (optional) – can be any number

    This number is used to initialize the random number generator in Analytics.

    Tip

    Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to randomly select a seed value.

  • Algorithm (required) – leave Mersenne Twister selected

    Only select Default if you require backward compatibility with Analytics scripts or sampling results created prior to Analytics version 12.

Random

Specifies that the random method is used for sample selection.

Samples are randomly selected from the entire data set. For more information, see Random selection method.

If you selected Random enter the following values:

  • Size (required) – the sample size that was calculated by Analytics

    Note

    If you have not already calculated the sample size, you can click Size to open the Size dialog box. For more information, see Calculating sample size for a record sample.

  • Seed (optional) – can be any number

    This number is used to initialize the random number generator in Analytics.

    Tip

    Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to randomly select a seed value.

  • Population (optional) –prefilled with the number of records in the table, which is the population from which the sample will be selected
  • Algorithm (required) – leave Mersenne Twister selected

    Only select Default if you require backward compatibility with Analytics scripts or sampling results created prior to Analytics version 12.

If

Caution

Do not create an IF statement or filter records in the course of sampling. Doing so compromises the validity of the sample.

For more information, see Conditional sampling.

To The name and location of the output table.
  • To save the output table to the Analytics project folder enter only the table name.
  • To save the output table in a location other than the project folder specify an absolute or relative file path, or click To and navigate to a different folder.

    For example: C:\Results\Output.fil or Results\Output.fil.

Regardless of where you save the output table, it is added to the open project if it is not already in the project.

If Analytics prefills a table name, you can accept the prefilled name, or change it.

Note

Analytics table names are limited to 64 alphanumeric characters, not including the .FIL extension. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number.

Local

If you are connected to a server table, specifies where to save the output table.

  • Local selected saves the output table to the same location as the Analytics project, or to a specified path, or location you navigate to.
  • Local deselected saves the output table to the Prefix folder on AX Server.
Use output table Specifies whether the Analytics table containing the output results opens automatically upon completion of the operation.

More tab

Options – Sample dialog box Description
Scope panel

Caution

Do not limit which records are processed in the course of sampling. Doing so compromises the validity of the sample.

For more information, see Conditional sampling.

Record

Fields

Specifies whether the output table includes the entire record, or selected fields.

If you choose Fields, do one of the following:

Select the field(s) to extract from the Extract Fields list.

Click Extract Fields to select the field(s), or to create an expression.

The order in which you select the fields is the order in which the columns appear in the results. If you are appending results to an existing Analytics table, the column selection and order must be identical to the column selection and order in the existing table.

Report Selection Order

(Optional) Adds the ORDER field to the output results.

This field displays the order in which each record is randomly selected.

Note

Report Selection Order is available only if both the Random selection method and Fields output are selected.

Append To Existing File Specifies that the output results are appended (added) to the end of an existing Analytics table.

Note

Leaving Append To Existing File deselected is recommended if you are uncertain whether the output results and the existing table have an identical data structure.

For more information about appending and data structure, see Appending output results to an existing table.

OK Executes the operation.

If the overwrite prompt appears, select the appropriate option.

If you are expecting the Append option to appear and it does not, click No to cancel the operation and see Appending output results to an existing table.