BREAK Subcommand (AGGREGATE command)

BREAK lists the optional grouping variables, also called break variables. Each unique combination of values of the break variables defines one break group.

  • The variables named on BREAK can be any combination of variables in the active dataset.
  • Unless PRESORTED is specified, aggregated variables are appended to the active dataset (OUTFILE=* MODE=ADDVARIABLES), AGGREGATE sorts cases after aggregating. By default, cases are sorted in ascending order of the values of the break variables. AGGREGATE sorts first on the first break variable, then on the second break variable within the groups created by the first, and so on.
  • Sort order can be controlled by specifying an A (for ascending) or D (for descending) in parentheses after any break variables.
  • The designations A and D apply to all preceding undesignated variables.
  • The subcommand PRESORTED overrides all sorting specifications, and no sorting is performed with OUTFILE=* MODE=ADDVARIABLES.

Example

AGGREGATE
  /BREAK=region
  /sales_mean = MEAN(var1) 
  /sales_median = MEDIAN(var1) 
  /sales_sum = SUM(var1).

For each case, the new aggregated variable values represent the mean, median, and total (sum) sales values for its region.

Example with no BREAK variable

AGGREGATE
  /sales_mean = MEAN(var1) 
  /sales_median = MEDIAN(var1) 
  /sales_sum = SUM(var1).

For each case, the new aggregated variable values represent the mean, median, and total (sum) sales values for the entire dataset.