CREATE Subcommand (OLAP CUBES command)
CREATE
allows you to calculate and display arithmetic
and percentage differences between groups or between variables. You
can also define labels for these difference categories.
GAC (gvar(cat1 cat2)). Arithmetic difference (change)
in the summary variable(s) statistics between each specified pair
of grouping variable categories. The keyword must be followed
by a grouping variable name specified in parentheses, and the variable
name must be followed by one or more pairs of grouping category values.
Each pair of values must be enclosed in parentheses inside the parentheses
that contain the grouping variable name. String values must be enclosed
in single or double quotation marks. You can specify multiple pairs
of category values, but you can only specify one grouping variable,
and the grouping variable must be one of the grouping variables specified
at the beginning of the OLAP CUBES
command, after
the BY
keyword. The difference calculated is the
summary statistic value for the second category specified minus the
summary statistic value for the first category specified: cat2
– cat1
.
GPC (gvar(cat1 cat2)). Percentage difference (change)
in the summary variable(s) statistics between each specified pair
of grouping variable categories. The keyword must be followed
by a grouping variable name enclosed in parentheses, and the variable
name must be followed by one or more pairs of grouping category values.
Each pair of values must be enclosed in parentheses inside the parentheses
that contain the grouping variable name. String values must be enclosed
in single or double quotation marks. You can specify multiple pairs
of category values, but you can only specify one grouping variable,
and the grouping variable must be one of the grouping variables specified
at the beginning of the OLAP CUBES
command, after
the BY
keyword. The percentage difference calculated
is the summary statistic value for the second category specified minus
the summary statistic value for the first category specified, divided
by the summary statistic value for the first category specified: (cat2
– cat1)/cat1
.
VAC(svar1 svar2). Arithmetic difference (change) in
summary statistics between each pair of specified summary variables. Each
pair of variables must be enclosed in parentheses, and all specified
variables must be specified as summary variables at the beginning
of the OLAP CUBES
command. The difference calculated
is the summary statistic value for the second variable specified minus
the summary statistic value for the first variable specified: svar2
– svar1
.
VPC(svar1 svar2). Percentage difference (change) in
summary statistics between each pair of specified summary variables.
Each pair of variables must be enclosed in parentheses, and all specified
variables must be specified as summary variables at the beginning
of the OLAP CUBES
command. The percentage difference
calculated is the summary statistic value for the second variable
specified minus the summary statistic value for the first variable
specified: (svar2 – svar1)/svar1
.
’category label’. Optional label for each difference
category created. These labels must be the first specification
in the CREATE
subcommand. Each label must be enclosed
in single or double quotation marks. If no labels are specified, defined
value or variable labels are used. If no labels are defined, data
values or variable names are displayed. If multiple differences are
created, the order of the labels corresponds to the order the differences
are specified. To mix custom labels with default labels, use the keyword
DEFAULT
for the difference categories without custom
labels.
Both arithmetic and percentage differences can be specified in the same command, but you cannot specify both grouping variable differences (GAC/GPC) and summary variable differences (VAC/VPC) in the same command.
Example
OLAP CUBES
sales96 BY region
/CELLS=SUM NPCT
/CREATE GAC GPC (region (1 3) (2 3)).
- Both the arithmetic (GAC) and percentage (GPC) differences will be calculated.
- Differences will be calculated for two different pairs of categories of the grouping variable region.
- The grouping variable specified in the
CREATE
subcommand, region, is also specified as a grouping variable at the beginning of theOLAP CUBES
command.
Example
OLAP CUBES
sales95 sales96 BY region
/CELLS=SUM NPCT
/CREATE VAC VPC (sales95 sales96).
- Both the arithmetic (VAC) and percentage (VPC) differences will be calculated.
- The difference calculated will be sales96 - sales95.
- The percentage difference calculated will be (sales96 - sales95)/sales95.
- The two variables, sales95 and sales96 are also
specified as summary variables at the beginning of the
OLAP CUBES
command.
Example
OLAP CUBES
sales96 BY region
/CELLS=SUM NPCT
/CREATE DEFAULT 'West-East GPC' DEFAULT 'West-Central % Difference'
GAC GPC (region (1 3) (2 3)).
- Four labels are specified, corresponding to the four difference categories that will be created: arithmetic and percentage differences between regions 3 and 1 and between regions 3 and 2.
- The two
DEFAULT
labels will display the defined value labels or values if there aren’t any value labels for the two arithmetic (GAC) difference categories.