Global Positioning System Reference
In-Depth Information
The virtual cube in Fig. 11 includes a calculated measure called
IncidenceRate . According to user requirements, this measure should be
obtained as a division of the number of cancer cases and the corresponding
district population multiplied by 100,000, to obtain the number of cases
for every 100,000 inhabitants. Notice that both measures, Population from
the Demographics cube and Quantity from the Cancer cube are represented
at a different granularity level. Therefore, if the formula is expressed
as ( Quantity / Population )*100000 and the user requests this measure for
a specifi c type of cancer, e.g., leukemia, and for particular district, e.g.,
Carmen, (Geo)Mondrian will look for Quantity and Population according
to these two fi lters: leukemia and Carmen. Since the population for a
specifi c type of cancer and district does not exist, the calculation fails.
Considering this situation and in order to ensure adequate calculation, it
is necessary to obtain a population fi gure at the district level, i.e., ignoring
the Cancer type dimension, as shown in Fig. 11. This is achieved by using
the aggregate function and representing the Population measure at the level
called All, where all members of the Cancer type dimensions are considered
together.
Querying a cube data
To obtain SDW data according to the cube schema expressed by the XML
schema, a query must be executed. (Geo)Mondrian uses a MDX for writing
these queries. MDX was fi rst introduced by Microsoft in 1997 and then
adopted by a wide range of OLAP software providers. Despite being similar
to the traditional SQL, MDX is not an SQL extension; it is a special query
language with many analytical functions. It not only expresses selections,
calculations, and some metadata defi nitions against an OLAP cube, but
also provides some capabilities for specifying how query results should be
represented (Smith et al. 2009). MDX for OLAP cubes takes a similar role
as SQL for relational databases.
A simple query in MDX uses the select-from-where form indicating what
should be displayed on rows and columns. For example, the following query
accesses the Cancer cube (the from clause) to retrieve (the select clause) (1)
the quantity of cancer cases that should be displayed on columns and (2)
members of highest level of the CRDivision hierarchy, i.e., provinces, that
should be displayed on rows. Additionally the restriction for considering
only the year 2005 is added (the where clause):
select {[Measures].[Quantity]} on columns,
{[CRDivision].[Province].Members} on rows
from
[Cancer]
where
[Time].[2005]
Search WWH ::




Custom Search