You are here: Commands > Stratify

Stratify

Menu: Found in the ANALYZE menu

Use the Stratify command to count the number of records falling into specified intervals (strata) of numeric or elapsed time field or expression values, as well as to accumulate one or more numeric fields for each stratum. The record count for each stratum is listed in a COUNT column in the Command Log.

Stratify works on unsorted files and is particularly useful for quick scanning and summarizing. Stratify allows you to count the number of records that fall into a specified number of even intervals, providing totals by stratum for selected numeric or elapsed time fields. Alternatively you can specify the start points for the intervals, using the Free option to create custom intervals of any size.

This command can be auto-executed. For more information see Autoexecute Commands.

Parameters

In addition to the command parameters described below, the Stratify command has the following command parameters: Append, First, Graph, GroupBy, If, Open, Next, Noformat, To and While. For a description of these parameters, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

On

Specifies the key numeric or elapsed time field to be stratified on. In the command dialog, select the field from the “Stratify key field” pull-down list or click [Choose] to display the Selected Fields dialog. For more information, see Selection/Edit Dialog Boxes.

Accumulate

Specifies the numeric or elapsed time fields or expressions for which Analyzer supplies totals by stratum. In the command dialog, select fields from the “Fields to accumulate” list box or click [Choose] to display the Selected Fields dialog.

Suppress

The suppress parameter excludes amounts falling outside the user specified output range. By default, the Stratify command analyzes two additional ranges: the range of values below the minimum specified and the range of values above the maximum specified. In the command dialog, "Suppress items outside intervals" check box overrides this behavior.

Free

Allows you to specify the start point of each interval and the end point of the last interval. In the command dialog, enter these values in the “Specify Intervals” text box, one per line.

For elapsed times, the intervals can be expressed as long format elapsed times (`e0/00:00:00`) or short format elapsed times (`e00:00:00`). For example, an interval of 5 minutes could be expressed as either `e0/00:05:00` or `e00:05:00`.

Intervals

Specifies the number of even intervals Analyzer produces over the range Minimum to Maximum. The default is 20, but you can change it globally in the Tools/Options dialog. In the command dialog, enter the number of intervals in the “Even Intervals” text box. See Stratify Intervals.

Maximum

Optional parameter that allows manually specifying the maximum value of the last stratification interval. If you previously issued a Profile or Statistics command, the highest value in the field is used by default. If you specified free intervals, the highest value specified is used. In the command dialog, click the [More] button, then manually specify the maximum in the “Specified limits” group box.

Tip: If the minimum and maximum values are left blank when you click OK, Analyzer will automatically profile the data to determine these values.

Minimum

Optional parameter that allows manually specifying the minimum value of the first stratification interval. If you previously issued a Profile or Statistics command, the lowest value in the stratified field is used by default. If you specified free intervals, the lowest value specified is used. In the command dialog, click the [More] button, then manually specify the minimum in the “Specified limits” group box.

Tip: If the minimum and maximum values are left blank when you click OK, Analyzer will automatically profile the data to determine these values.

Command Mode Syntax

STRATIFY <ON> numeric/elapsed-time field-name <INTERVALS=n>

<MAXIMUM=max>

<MINIMUM=min>¿

STRATIFY <ON> numeric/elapsed-time field-name FREE interval-start-points...

<MINIMUM=min>

<MAXIMUM=max>¿

You can add the following options to each syntax format:

<TO data-file-name|GRAPH|SCREEN>

<IF test> <WHILE test> <FIRST|NEXT range>

<SUPPRESS>

<ACCUMULATE numeric/elapsed-time field-list>

<GROUPBY field <+ ...>> <PRESORT>

<NOFORMAT> <APPEND>

<OPEN>¿

Examples

In the first example, you will produce an even intervals stratification.

A stratified analysis of an accounts receivable file shows whether the file contains a few large or several smaller value items. This information can help management to develop appropriate collection procedures.

1. Open the Receivables table
2. Click Analyze in the menu and select Stratify.
3. Stratify by transaction amount and accumulate the transaction amount field.
4. Enter 10 as the number of intervals. Click [OK].

Analyzer displays the result in the Command Log in tabular format.

Click on any of the strata intervals to drill-down and see all records in the strata displayed in the View.

In the second example, you produce free interval stratifications. Free interval stratification allows you to obtain a further breakdown of the stratum from the preceding example.

1. Open the Receivables table
2. Click Analyze in the menu and select Stratify.
3. Stratify by transaction amount and accumulate the transaction amount field.
4. Select the “Specify Intervals” radio button. Specify 0, 100, 250, 500, 750 as interval start points and 1000 as the end point.

The results appear in the Command Log in tabular format.

Click on any of the strata intervals to drill-down and see all records in the strata displayed in the View.

Command Output

The Command Log output has columns for the strata intervals, the number of records in each interval and the percent of the total records that each interval represents. If one or more fields were accumulated, additional columns are displayed: another percent column and the accumulated field totals for each interval.

Each percent column points to the column it represents. The right-hand percent column points to the nearest accumulated field column and shows the percent of the total value that the value of this interval represents. Percentages are not provided for additional accumulated field columns.

You can send the command output to a graph. Click the [More] button and select Graph from the pull-down list in the “Output Options” group box. For more information, see Graph Output. You can also write the command output to a data file. Click the [More] button and select DATA pull-down list in the “Output Options” group box.