Multidimensional analysis v17
Multidimensional analysis refers to the process of examining data using various combinations of dimensions. Dimensions are categories used to classify data such as time, geography, a company’s departments, product lines, and so forth. This process is commonly used in data warehousing applications. The results associated with a particular set of dimensions are called facts. Facts are typically figures associated with product sales, profits, volumes, counts, and so on.
To obtain these facts according to a set of dimensions in a relational database system, you typically use SQL aggregation. SQL aggregation basically means data is grouped according to certain criteria (dimensions), and the result set consists of aggregates of facts, such as counts, sums, and averages of the data in each group.
Aggregating results
The GROUP BY
clause of the SQL SELECT
command supports the following extensions that simplify the process of producing aggregate results:
ROLLUP
extensionCUBE
extensionGROUPING SETS
extension
In addition, you can use the GROUPING
function and the GROUPING_ID
function in the SELECT
list or the HAVING
clause to aid with the interpretation of the results when you use these extensions.
Note
The sample dept
and emp
tables are used extensively in this discussion to provide usage examples. The following changes were applied to these tables to provide more informative results:
The following rows from a join of the emp
and dept
tables are used: