Stratifying data

Concept Information

STRATIFY command

Stratifying groups the records in a table into numeric intervals (value ranges) based on values in a numeric field, and counts the number of records in each interval.

For example, you could stratify an accounts receivable table on the invoice amount field to group records into $5000 intervals – invoices from $0 to $4,999.99, from $5,000 to $9,999.99, and so on – and to find the total number of transactions, and the total transaction amount, for each interval.

Subtotaling associated numeric fields

When stratifying, you can optionally subtotal one or more associated numeric fields. In the example above, you could subtotal the discount amount field to find the total discount amount for each interval.

Note

If you do not specify a subtotal field, the field you are stratifying on is automatically subtotaled.

How numeric intervals work

Numeric intervals are value ranges. You have two options when creating numeric intervals:

  • equal-sized intervals
  • custom-sized intervals

Equal-sized intervals

Analytics calculates equal-sized intervals by grouping the values in the key field into a specified number of intervals.

To create equal-sized intervals, you specify the minimum value of the first interval and the maximum value of the last interval, and the number of intervals you want.

Tip

If you use the actual minimum and maximum values in the field, the interval size is typically not a round amount. If you want the interval size to be a round amount, you can specify minimum and maximum values in round amounts – for example, 0 and 5000.

Custom-sized intervals

Analytics calculates custom-sized intervals by grouping the values in the key field into intervals with starting values that you specify.

To create custom-sized intervals, you specify the start value of each interval and the end value of the last interval. You can create equal-sized intervals, or intervals that vary in size.

Examples of equal-sized and custom-sized intervals

The table below shows examples of the types of intervals that you could create for a set of values that ranges from $48.19 to $4,792.83.

Equal-sized intervals

(using actual min and max values)

Equal-sized intervals

(min and max specified as round numbers)

Custom-sized intervals
48.19 - 997.11

997.12 - 1,946.04

1,946.05 - 2,894.97

2,894.98 - 3,843.90

3,843.91 - 4,792.83

0.00 - 999.99

1,000.00 - 1,999.99

2,000.00 - 2,999.99

3,000.00 - 3,999.99

4,000.00 - 5,000.00

0.00 - 99.99

100.00 - 999.99

1,000.00 - 5,000.00

Stratifying and sorting

You can stratify sorted or unsorted tables. When you stratify an unsorted table Analytics automatically sorts the output results as part of the stratify operation.

The Statistics option

The Include Statistics for Subtotal Fields option allows you to calculate average, minimum, and maximum values for each subtotaled numeric field. In the example above, using the statistics option would calculate the average, minimum, and maximum invoice amounts in each interval, and the average, minimum, and maximum discount amounts in each interval if you also subtotaled the discount amount field.

Stratifying in detail

Stratifying performs the following operations:

Operation

Location in Stratify results

Groups the records into intervals based on a numeric field

Trans Amount field, first

Counts (subtotals) the number of records falling into each interval, and calculates the percentage of the total count represented by each subtotal

Count field

Percent of Count field

Provides the minimum and maximum values in the numeric field being stratified

not shown

Optionally subtotals the values of one or more numeric fields for each interval, and for the first selected field calculates the percentage of the field total represented by each subtotal

Trans Amount field, second

Percent of Field field

Optionally calculates average, minimum, and maximum values for each subtotaled numeric field

not shown

Provides totals for all numeric fields included in the output results

Totals row

Optionally breaks down the output results based on the values in a character field such as customer ID or transaction type (requires that the character field is sorted prior to stratifying)

not shown

Stratify results

Output results produced by:

  • stratifying on transaction amount in an accounts receivable table

    (the Ar table in ACL DATA\Sample Data Files\Sample Project.ACL)

  • using $1000 intervals
  • outputting the results to screen

Steps

You can stratify data by grouping the records in a table into equal-sized, or custom-sized, numeric intervals.

For each interval, you can optionally include the following calculations for associated numeric fields: subtotal, average value, minimum value, maximum value.