Classifying data

Concept Information

CLASSIFY command

Classifying groups the records in a table based on identical key field values, and counts the number of records in each group. Key fields can be character or numeric.

For example, you could classify a transactions table on the customer number field to find the total number of transactions for each customer.

In the example below, there are ten values in the Customer Number field in the input table. Some values are unique, and some values are identical. After summarizing, the values are grouped into four unique groups. The Count tells you how many records, or transactions, are in each customer number group.

Input table Output results
Key field: Customer Number Classified group Count
795401 230575 1
518008 518008 5
518008 795401 3
925007 925007 1
518008    
795401    
518008    
230575    
795401    
518008    

Subtotaling associated numeric fields

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

Classifying and sorting

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

Classifying unsorted tables requires Analytics to create a variable for each set of identical values in the key field and store these variables in memory until the entire table is read. If you are working with a large table, storing the required variables requires a lot of RAM and can be slow.

The Statistics option

The Include Statistics for Subtotal Fields option allows you to calculate average, minimum, and maximum values for any subtotal field you specify. The results of the calculations are broken down by group in the classified output table.

In the example above, the statistics option would calculate the average, minimum, and maximum transaction amounts for each customer.

Classifying in detail

Classifying performs the following operations:

Operation

Location in Classify results

Groups the records based on identical values in a character or numeric field

Product Class field

Counts (subtotals) the number of records for each group, and calculates the percentage of the total count represented by each subtotal

Count field

Percent of Count field

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

Inventory Value at Cost field

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 classifying)

not shown

Classify results

Output results produced by:

  • classifying on product class in an inventory table

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

  • subtotaling inventory value
  • outputting the results to screen

The results show that the inventory value is concentrated in four product classes: 03, 04, 08, 09.

Steps

You can classify data by grouping the records in a table based on identical values in a character or numeric field.

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