Professional Documents
Culture Documents
Olap - Operation (Compatibility Mode)
Olap - Operation (Compatibility Mode)
The following table represents the 2-D view of Sales Data for a
company with respect to time, item, and location dimensions.
1
3-D table can be represented as 3-D data
cube
Multidimensional Modeling
• Example: compute total sales volume per
product and store
Store
Total Product
Sales 1 2 3 4
1 $454 - - $925 800
2 $468 $800 - -
Store
3 $296 - $240 -
4 $652 - $540 $745
Product
2
Multidimensional View
BPL
IND
RAI
BIL
Q2
Q3
Q4
H C P S
Items
Example
roll-up to region
Dimensions:
NY
SF
Time, Product, Store
roll-up to brand
LA
Attributes:
Product (upc, price, …)
Juice 10
Store …
Product
Milk 34
56
…
Coke
32 Hierarchies:
Cream
Soap 12 Product → Brand → …
Bread 56 roll-up to week Day → Week → Quarter
M T W Th F S S Store → Region → Country
Time
56 units of bread sold in LA on M
3
• The slice operation selects one particular
dimension from a given cube and provides
a new sub-cube.
SLICE
• Perform selection on one dimension
• Slicetime=‘Q1’ C [quarter,city,item] =
C[city,item]
BPL
Location(cities)
IND
RAI
H C P S
Item
4
• Dice selects two or more dimensions from
a given cube and provides a new sub-
cube.
DICE
• Reduce the data into two or more
dimension
• Dice for(location=“BIL” or “RAI”)&
(time=‘Q1’or‘Q2’)&(Item=‘H’or‘C’)
C(quarter,city,prodouct)
RAI
BIL
Q1
Q2
H C
5
PIVOT
• Visualization operation.
• Provide alternative representation.
• Rotating the axis of cube.
• Transform the 3D cube into the series of
2D plane.
6
Pivoting
Fact table view: Multi-dimensional cube:
sale prodId storeId date amt
p1 c1 1 12
p2 c1 1 11 c1 c2 c3
p1 c3 1 50 day 2
p1 44 4
p2 c2 1 8 p2 c1 c2 c3
p1 c1 2 44 day 1
p1 12 50
p1 c2 2 4 p2 11 8
c1 c2 c3
p1 56 4 50
p2 11 8
PIVOT
605
H
825
C
Item
14
P
400
S
7
Common OLAP Operations
• Roll-up: move up the
hierarchy PRODUCT LOCATION TIME
– e.g given total sales category region year
per city, we can roll-up
to get sales per state product country quarter
8
Roll Up/ Drilling UP
Drilling Up / Roll up
MP
CH
Q1
Time(quarter)
Q2
Q3
Q4
H C P S
Item
9
Drilling Down
BPL
IND
RAI
BIL
Jan
Feb
Mar
Apr
Drilling down/Roll down
May
June
July
Aug
Sep
Oct
Nov
Dec
H C P S
10
11
12
13
14
Drill across
• Execute query involve ( across ) query in
more than one fact table
• It means switching from a classification in
one-dimension to different classification in
different dimension.
• Accesses more than one fact table that is
linked by common dimensions.
• Combines cubes that share one or more
dimensions.
Drill across
• For example, we are doing the sales revenue
analysis and have been able to find out the best
and least performing offices.
• However, to have a further understanding of the
picture, we now move across measures to find
out about the Sales transactions of these offices
– (a low revenue , but higher sales transaction point to
a certain level of activity) and number of sales staff
(the low performing offices could have lesser staff)
and number of months since the office is set-up (the
new offices being in gestation period could be
performing lower
15
Drill through
• Drill through – operation make use of
relational SQL facilities to drilling through
the bottom level of a data cube down to its
back end relational table.
• Because transactional data is not
contained within the OLAP cube(ROLAP),
the manager needs a mechanism to
present the underlying transactions
Drill through
• The enterprise often needs to be able to see the
underlying transactions once he or she identifies
a summary that raises questions .
• Drill through, allows the property manager to
see the transactions that make up the margins,
exposing, for example, the tenants, vendors,
services, and other entities involved within each,
so that focused action can be taken to ultimately
control results
16
OLAP vs Data Mining
• The main difference between OLAP and
data mining is how they operate on the
data
• OLAP ( Addition)
• Data mining ( Division)
17
OLAP vs Data Mining
• For example, OLAP can tell you about the
total number of items sold in all the ZIP
codes in the country.
• OLAP is implemented in a multi-user
environment and offers consistent, quick
response, regardless of the volume of data
18
OLAP vs Data Mining
Data mining, on the other hand, is about ratios,
patterns and influences in a data set. As such,
data mining is division. Data mining can tell you
about the factors influencing the sales of the
items in those ZIP codes.
Gartner has defined data mining as "the process
of discovering meaningful new correlations,
patterns and trends by sifting through large
amounts of data stored in repositories, using
pattern recognition technologies as well as
statistical and mathematical techniques
19
OLAP vs Data Mining
For example, a data mining analysis can
discover a significant relationship in a set
of attributes.
OLAP can then expand on this and
generate a report detailing the impact of
the discovery
20