SlideShare a Scribd company logo
1 of 60
OLAP
2
Business Intelligence Technologies
• OLAP and Data Mining differ in what they offer
the user and because of this they are
complementary technologies.
• An environment that includes a data warehouse
(or more commonly one or more data marts)
together with tools such as OLAP and /or data
mining are collectively referred to as Business
Intelligence (BI) technologies.
© Pearson Education Limited 1995, 2005
3
Online Analytical Processing (OLAP)
• The dynamic synthesis, analysis, and consolidation of large volumes
of multi-dimensional data, Codd (1993).
• Describes a technology that uses a multi-dimensional view of
aggregate data to provide quick access to strategic information for
the purposes of advanced analysis.
© Pearson Education Limited 1995, 2005
4
Online Analytical Processing (OLAP)
• Enables users to gain a deeper understanding and knowledge about
various aspects of their corporate data through fast, consistent,
interactive access to a wide variety of possible views of the data.
• Allows users to view corporate data in such a way that it is a better
model of the true dimensionality of the enterprise.
© Pearson Education Limited 1995, 2005
5
Online Analytical Processing (OLAP)
• Can easily answer ‘who?’ and ‘what?’ questions, however, ability to
answer ‘what if?’ and ‘why?’ type questions distinguishes OLAP
from general-purpose query tools.
• Types of analysis ranges from basic navigation and browsing (slicing
and dicing) to calculations, to more complex analyses such as time
series and complex modeling.
© Pearson Education Limited 1995, 2005
6
OLAP Applications
• JIT information is computed data that usually reflects complex
relationships and is often calculated on the fly. Also as data
relationships may not be known in advance, the data model must be
flexible.
© Pearson Education Limited 1995, 2005
7
Examples of OLAP applications in various
functional areas
© Pearson Education Limited 1995, 2005
8
OLAP Applications
• Although OLAP applications are found in widely divergent functional
areas, they all have the following key features:
• multi-dimensional views of data
• support for complex calculations
• time intelligence
© Pearson Education Limited 1995, 2005
9
OLAP Applications - multi-
dimensional views of data
• Core requirement of building a ‘realistic’ business
model.
• Provides basis for analytical processing through
flexible access to corporate data.
• The underlying database design that provides the
multi-dimensional view of data should treat all
dimensions equally.
© Pearson Education Limited 1995, 2005
10
OLAP Applications - support for
complex calculations
• Must provide a range of powerful computational methods such as
that required by sales forecasting, which uses trend algorithms such
as moving averages and percentage growth.
• Mechanisms for implementing computational methods should be
clear and non-procedural.
© Pearson Education Limited 1995, 2005
11
OLAP Applications – time intelligence
• Key feature of almost any analytical application as performance is
almost always judged over time.
• Time hierarchy is not always used in the same manner as other
hierarchies.
• Concepts such as year-to-date and period-over-period comparisons
should be easily defined.
© Pearson Education Limited 1995, 2005
period-over-period
• The year-over-year growth rate compares a time period,
usually a month or a quarter, against the same time period
last year. It is a more effective way of looking at
performance. If you are doing better than last month, for
example, but worse than this time last year, then you might
be lulled into thinking you were improving when in fact you
were not. The improvement might simply be because you
always do better this time of year. For this reason,
whenever you are looking at a financial or economic
report, make sure you know whether it is being compared
to the last period (quarter, month, week, day) or year-over-
year.
12
13
OLAP Benefits
• Increased productivity of end-users.
• Retention of organizational control over the integrity of corporate
data.
• Reduced query drag and network traffic on OLTP systems or on the
data warehouse.
• Improved potential revenue and profitability.
© Pearson Education Limited 1995, 2005
Pivot Table
14
15
Representation of Multi-dimensional
Data
• Example of two-dimensional query.
• What is the total revenue generated by property sales in each city, in each quarter of
2004?’
• Choice of representation is based on types of queries end-user may
ask.
• Compare representation - three-field relational table versus two-
dimensional matrix.
© Pearson Education Limited 1995, 2005
16
Multi-dimensional Data as Three-field table versus Two-dimensional
Matrix
© Pearson Education Limited 1995, 2005
17
Representation of Multi-dimensional
Data
• Example of three-dimensional query.
• ‘What is the total revenue generated by property sales for each type of
property (Flat or House) in each city, in each quarter of 2004?’
• Compare representation - four-field relational table versus three-
dimensional cube.
© Pearson Education Limited 1995, 2005
18
Multi-dimensional Data as Four-field Table
versus Three-dimensional Cube
© Pearson Education Limited 1995, 2005
19
Representation of Multi-dimensional
Data
• Cube represents data as cells in an array.
• Relational table only represents multi-dimensional data in two
dimensions.
© Pearson Education Limited 1995, 2005
20
Representation of Multi-dimensional
Data
• Use multi-dimensional structures to store data and relationships
between data.
• Multi-dimensional structures are best visualized as cubes of data,
and cubes within cubes of data. Each side of a cube is a dimension.
• A cube can be expanded to include other dimensions.
© Pearson Education Limited 1995, 2005
21
Representation of Multi-dimensional Data
• A cube supports matrix arithmetic.
• Multi-dimensional query response time depends on how many cells
have to be added ‘on the fly’.
• As number of dimensions increases, number of the cube’s cells
increases exponentially.
© Pearson Education Limited 1995, 2005
22
Representation of Multi-dimensional Data
• However, majority of multi-dimensional queries use summarized,
high-level data.
• Solution is to pre-aggregate (consolidate) all logical subtotals and
totals along all dimensions.
© Pearson Education Limited 1995, 2005
23
Representation of Multi-dimensional
Data
• Pre-aggregation is valuable, as typical dimensions are hierarchical in
nature.
• (e.g. Time dimension hierarchy - years, quarters, months, weeks, and days)
• Predefined hierarchy allows logical pre-aggregation and, conversely,
allows for a logical ‘drill-down’.
© Pearson Education Limited 1995, 2005
24
Representation of Multi-dimensional
Data
• Supports common analytical operations
• Consolidation
• Drill-down
• Slicing and dicing
© Pearson Education Limited 1995, 2005
25
Representation of Multi-dimensional Data
• Consolidation - aggregation of data such as simple ‘roll-ups’ or
complex expressions involving inter-related data.
• Drill-Down - is the reverse of consolidation and involves displaying
the detailed data that comprises the consolidated data.
© Pearson Education Limited 1995, 2005
26
Representation of Multi-dimensional Data
• Slicing and Dicing - (also called pivoting) refers to the ability to look
at the data from different viewpoints.
© Pearson Education Limited 1995, 2005
27
Representation of Multi-dimensional Data
• Can store data in a compressed form by dynamically selecting
physical storage organizations and compression techniques that
maximize space utilization.
• Dense data (that is, data that exists for a high percentage of cells)
can be stored separately from sparse data (that is, a significant
percentage of cells are empty).
© Pearson Education Limited 1995, 2005
28
Representation of Multi-dimensional Data
• Ability to omit empty or repetitive cells can greatly reduce the size
of the cube and the amount of processing.
• Allows analysis of exceptionally large amounts of data.
© Pearson Education Limited 1995, 2005
29
Representation of Multi-dimensional Data
• In summary, pre-aggregation, dimensional hierarchy, and sparse
data management can significantly reduce the size of the cube and
the need to calculate values ‘on-the-fly’.
• Removes need for multi-table joins and provides quick and direct
access to arrays of data, thus significantly speeding up execution of
multi-dimensional queries.
© Pearson Education Limited 1995, 2005
30
Codd’s rules for OLAP
• Dynamic sparse matrix handling
• Multi-user support
• Unrestricted cross-dimensional operations
• Intuitive data manipulation
• Flexible reporting
• Unlimited dimensions and aggregation levels
© Pearson Education Limited 1995, 2005
31
OLAP Extensions to SQL
• Advantages of SQL include that it is easy to learn, non-procedural,
free-format, DBMS-independent, and that it is a recognized
international standard.
• However, major limitation of SQL is the inability to answer routinely
asked business queries such as computing the percentage change in
values between this month and a year ago or to compute moving
averages, cumulative sums, and other statistical functions.
© Pearson Education Limited 1995, 2005
32
OLAP Extensions to SQL
• Answer is ANSI adopted a set of OLAP functions as an extension to
SQL to enable these calculations as well as many others that used to
be impossible or even impractical within SQL.
• IBM and Oracle jointly proposed these extensions early in 1999 and
they now form part of the current SQL standard, namely SQL: 2003.
© Pearson Education Limited 1995, 2005
33
OLAP Extensions to SQL - RISQL
• The extensions are collectively referred to as the ‘OLAP package’
and are described as follows:
• Feature T431, ‘Extended Grouping capabilities’
• Feature T611, ‘Extended OLAP operators’
© Pearson Education Limited 1995, 2005
34
Extended Grouping Capabilities
• Aggregation is a fundamental part of OLAP. To
improve aggregation capabilities the SQL standard
provides extensions to the GROUP BY clause such as
the ROLLUP and CUBE functions.
© Pearson Education Limited 1995, 2005
35
Extended Grouping Capabilities
• ROLLUP supports calculations using aggregations
such as SUM, COUNT, MAX, MIN, and AVG at
increasing levels of aggregation, from the most
detailed up to a grand total.
• CUBE is similar to ROLLUP, enabling a single
statement to calculate all possible combinations of
aggregations. CUBE can generate the information
needed in cross-tabulation reports with a single
query.
© Pearson Education Limited 1995, 2005
36
Extended Grouping Capabilities
• ROLLUP and CUBE extensions specify exactly the
groupings of interest in the GROUP BY clause and
produces a single result set that is equivalent to a
UNION ALL of differently grouped rows.
© Pearson Education Limited 1995, 2005
37
Extended Grouping Capabilities
• ROLLUP Extension to GROUP BY
• enables a SELECT statement to calculate multiple levels of
subtotals across a specified group of dimensions. ROLLUP
appears in the GROUP BY clause in a SELECT statement
using the following format:
SELECT ... GROUP BY ROLLUP(columnList)
© Pearson Education Limited 1995, 2005
38
Extended Grouping Capabilities
• ROLLUP creates subtotals that roll up from the most
detailed level to a grand total, following a column list
specified in the ROLLUP clause.
• ROLLUP first calculates the standard aggregate values
specified in the GROUP BY clause and then creates
progressively higher level subtotals, moving from right to
left through the column list until finally completing with
a grand total.
© Pearson Education Limited 1995, 2005
39
Extended Grouping Capabilities
• ROLLUP creates subtotals at n + 1 levels, where n is the
number of grouping columns. For instance, if a query
specifies ROLLUP on grouping columns of propertyType,
yearMonth, and city (n = 3), the result set will include
rows at 4 aggregation levels.
© Pearson Education Limited 1995, 2005
40
Example - Using the ROLLUP Group
Function
• Show the totals for sales of flats or houses by
branch offices located in Aberdeen, Edinburgh, or
Glasgow for the months of September and October
of 2004.
© Pearson Education Limited 1995, 2005
41
Example - Using the ROLLUP Group
Function
SELECT propertyType, yearMonth, city, SUM(saleAmount) AS sales
FROM Branch, PropertyFor Sale, PropertySale
WHERE Branch.branchNo = PropertySale.branchNo
AND PropertyForSale.propertyNo = PropertySale.propertyNo
AND PropertySale.yearMonth IN ('2004-08', '2004-09')
AND Branch.city IN (‘Aberdeen’, ‘Edinburgh’, ‘Glasgow’)
GROUP BY ROLLUP(propertyType, yearMonth, city);
© Pearson Education Limited 1995, 2005
42
Example - Using the ROLLUP Group
Function
© Pearson Education Limited 1995, 2005
43
Extended Grouping Capabilities
• CUBE Extension to GROUP BY
• CUBE takes a specified set of grouping columns and
creates subtotals for all of the possible combinations.
CUBE appears in the GROUP BY clause in a SELECT
statement using the following format:
SELECT ... GROUP BY CUBE(columnList)
© Pearson Education Limited 1995, 2005
44
Extended Grouping Capabilities
• CUBE generates all the subtotals that could be
calculated for a data cube with the specified
dimensions.
• CUBE can be used in any situation requiring cross-
tabular reports. The data needed for cross-tabular
reports can be generated with a single SELECT using
CUBE. Like ROLLUP, CUBE can be helpful in generating
summary tables.
© Pearson Education Limited 1995, 2005
45
Extended Grouping Capabilities
• CUBE is typically most suitable in queries that
use columns from multiple dimensions rather
than columns representing different levels of a
single dimension.
© Pearson Education Limited 1995, 2005
46
Example - Using the CUBE Group
Function
• Show all possible subtotals for sales of
properties by branches offices in Aberdeen,
Edinburgh, and Glasgow for the months of
September and October of 2004.
© Pearson Education Limited 1995, 2005
47
Example - Using the CUBE Group
Function
SELECT propertyType, yearMonth, city, SUM(saleAmount) AS
sales
FROM Branch, PropertyFor Sale, PropertySale
WHERE Branch.branchNo = PropertySale.branchNo
AND PropertyForSale.propertyNo =
PropertySale.propertyNo
AND PropertySale.yearMonth IN ('2004-08', '2004-09')
AND Branch.city IN (‘Aberdeen’, ‘Edinburgh’, ‘Glasgow’)
GROUP BY CUBE(propertyType, yearMonth, city);
© Pearson Education Limited 1995, 2005
48
Example - Using the CUBE Group
Function
© Pearson Education Limited 1995, 2005
49
Elementary OLAP Operators
• Supports a variety of operations such as rankings
and window calculations.
• Ranking functions include cumulative
distributions, percent rank, and N-tiles.
• Windowing allows the calculation of cumulative
and moving aggregations using functions such as
SUM, AVG, MIN, and COUNT.
© Pearson Education Limited 1995, 2005
50
Elementary OLAP Operators
• Ranking Functions
• Computes the rank of a record compared to other
records in the dataset based on the values of a set of
measures. There are various types of ranking
functions, including RANK and DENSE_RANK. The
syntax for each ranking function is:
RANK( ) OVER (ORDER BY columnList)
DENSE_RANK( ) OVER (ORDER BY columnList)
© Pearson Education Limited 1995, 2005
51
Elementary OLAP Operators
• The difference between RANK and DENSE_RANK
is that DENSE_RANK leaves no gaps in the
sequential ranking sequence when there are ties
for a ranking.
© Pearson Education Limited 1995, 2005
52
Example - Using the RANK and
DENSE_RANK Functions
• Rank the total sales of properties for branch
offices in Edinburgh.
SELECT branchNo, SUM(saleAmount) AS sales,
RANK() OVER (ORDER BY SUM(saleAmount)) DESC AS ranking,
DENSE_RANK() OVER (ORDER BY SUM(saleAmount)) DESC AS
dense_ranking
FROM Branch, PropertySale
WHERE Branch.branchNo = PropertySale.branchNo
AND Branch.city = ‘Edinburgh’
GROUP BY(branchNo);
© Pearson Education Limited 1995, 2005
53
Example - Using the RANK and DENSE_RANK
Functions
© Pearson Education Limited 1995, 2005
54
Elementary OLAP Operators
• Supports a variety of operations such as rankings
and window calculations.
• Ranking functions include cumulative
distributions, percent rank, and N-tiles.
• Windowing allows the calculation of cumulative
and moving aggregations using functions such as
SUM, AVG, MIN, and COUNT.
© Pearson Education Limited 1995, 2005
55
Elementary OLAP Operators
• Windowing Calculations
• Can be used to compute cumulative, moving, and
centered aggregates. They return a value for each
row in the table, which depends on other rows in the
corresponding window.
© Pearson Education Limited 1995, 2005
56
Elementary OLAP Operators
• Windowing Calculations
• Can be used to compute cumulative, moving, and
centered aggregates. They return a value for each
row in the table, which depends on other rows in the
corresponding window.
• These aggregate functions provide access to more
than one row of a table without a self-join and can be
used only in the SELECT and ORDER BY clauses of the
query.
© Pearson Education Limited 1995, 2005
57
Example - Using Windowing Calculations
• Show the monthly figures and three-month
moving averages and sums for property sales at
branch office B003 for the first six months of
2004.
© Pearson Education Limited 1995, 2005
58
Example - Using Windowing Calculations
SELECT yearMonth, SUM(saleAmount) AS monthlySales,
AVG(SUM(saleAmount))
OVER (ORDER BY yearMonth, ROWS 2 PRECEDING) AS 3-
month moving avg,
SUM(SUM(salesAmount)) OVER (ORDER BY yearMonth ROWS
2 PRECEDING)
AS 3-month moving sum
FROM PropertySale
WHERE branchNo = ‘B003’
AND yearMonth BETWEEN ('2004-01' AND '2004-06’)
GROUP BY yearMonth
ORDER BY yearMonth;
© Pearson Education Limited 1995, 2005
59
Example - Using Windowing Calculations
© Pearson Education Limited 1995, 2005
Lecture 06 -IIS-OLAP.pptx

More Related Content

Similar to Lecture 06 -IIS-OLAP.pptx

Application Middleware Overview
Application Middleware OverviewApplication Middleware Overview
Application Middleware OverviewChristalin Nelson
 
Data Warehouse Design on Cloud ,A Big Data approach Part_One
Data Warehouse Design on Cloud ,A Big Data approach Part_OneData Warehouse Design on Cloud ,A Big Data approach Part_One
Data Warehouse Design on Cloud ,A Big Data approach Part_OnePanchaleswar Nayak
 
Lecture 1_ Introduction to Business Processes_V1.pptx
Lecture 1_ Introduction to Business Processes_V1.pptxLecture 1_ Introduction to Business Processes_V1.pptx
Lecture 1_ Introduction to Business Processes_V1.pptxTahirihrani Muniandy
 
What's New in Oracle EPM Cloud
What's New in Oracle EPM CloudWhat's New in Oracle EPM Cloud
What's New in Oracle EPM CloudPerficient, Inc.
 
Agile Data Architecture
Agile Data ArchitectureAgile Data Architecture
Agile Data ArchitectureCprime
 
Online analytical processing
Online analytical processingOnline analytical processing
Online analytical processingSamraiz Tejani
 
Lesson 3 - The Kimbal Lifecycle.pptx
Lesson 3 - The Kimbal Lifecycle.pptxLesson 3 - The Kimbal Lifecycle.pptx
Lesson 3 - The Kimbal Lifecycle.pptxcalf_ville86
 
Planning Tools and Technique in Management
Planning Tools and Technique in ManagementPlanning Tools and Technique in Management
Planning Tools and Technique in ManagementArdiMuluk1
 
Chapter 09 dss-mis-eis-es-ai
Chapter 09 dss-mis-eis-es-aiChapter 09 dss-mis-eis-es-ai
Chapter 09 dss-mis-eis-es-aiPooja Sakhla
 
Chapter 09 dss mis eis es ai
Chapter 09   dss mis eis es aiChapter 09   dss mis eis es ai
Chapter 09 dss mis eis es aiPooja Sakhla
 
Sami patel full_resume
Sami patel full_resumeSami patel full_resume
Sami patel full_resumeJignesh Shah
 
Chapter 11 Enterprise Resource Planning System
Chapter 11 Enterprise Resource Planning SystemChapter 11 Enterprise Resource Planning System
Chapter 11 Enterprise Resource Planning SystemMuhammad Azmy
 
Data warehousing and machine learning primer
Data warehousing and machine learning primerData warehousing and machine learning primer
Data warehousing and machine learning primerTom Donoghue
 
MLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive AdvantageMLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive AdvantageDATAVERSITY
 
Virran 1st Year Achievements
Virran 1st Year AchievementsVirran 1st Year Achievements
Virran 1st Year AchievementsRajasekhar R
 
86921864 olap-case-study-vj
86921864 olap-case-study-vj86921864 olap-case-study-vj
86921864 olap-case-study-vjhomeworkping4
 

Similar to Lecture 06 -IIS-OLAP.pptx (20)

Application Middleware Overview
Application Middleware OverviewApplication Middleware Overview
Application Middleware Overview
 
Data Warehouse Design on Cloud ,A Big Data approach Part_One
Data Warehouse Design on Cloud ,A Big Data approach Part_OneData Warehouse Design on Cloud ,A Big Data approach Part_One
Data Warehouse Design on Cloud ,A Big Data approach Part_One
 
Lecture 1_ Introduction to Business Processes_V1.pptx
Lecture 1_ Introduction to Business Processes_V1.pptxLecture 1_ Introduction to Business Processes_V1.pptx
Lecture 1_ Introduction to Business Processes_V1.pptx
 
Data Warehouse
Data WarehouseData Warehouse
Data Warehouse
 
What's New in Oracle EPM Cloud
What's New in Oracle EPM CloudWhat's New in Oracle EPM Cloud
What's New in Oracle EPM Cloud
 
Agile Data Architecture
Agile Data ArchitectureAgile Data Architecture
Agile Data Architecture
 
Online analytical processing
Online analytical processingOnline analytical processing
Online analytical processing
 
Lesson 3 - The Kimbal Lifecycle.pptx
Lesson 3 - The Kimbal Lifecycle.pptxLesson 3 - The Kimbal Lifecycle.pptx
Lesson 3 - The Kimbal Lifecycle.pptx
 
Planning Tools and Technique in Management
Planning Tools and Technique in ManagementPlanning Tools and Technique in Management
Planning Tools and Technique in Management
 
Chapter 09 dss-mis-eis-es-ai
Chapter 09 dss-mis-eis-es-aiChapter 09 dss-mis-eis-es-ai
Chapter 09 dss-mis-eis-es-ai
 
Chapter 09 dss mis eis es ai
Chapter 09   dss mis eis es aiChapter 09   dss mis eis es ai
Chapter 09 dss mis eis es ai
 
Sami patel full_resume
Sami patel full_resumeSami patel full_resume
Sami patel full_resume
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 
Chapter 11 Enterprise Resource Planning System
Chapter 11 Enterprise Resource Planning SystemChapter 11 Enterprise Resource Planning System
Chapter 11 Enterprise Resource Planning System
 
OLAP
OLAPOLAP
OLAP
 
Data warehousing and machine learning primer
Data warehousing and machine learning primerData warehousing and machine learning primer
Data warehousing and machine learning primer
 
BI Introduction
BI IntroductionBI Introduction
BI Introduction
 
MLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive AdvantageMLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive Advantage
 
Virran 1st Year Achievements
Virran 1st Year AchievementsVirran 1st Year Achievements
Virran 1st Year Achievements
 
86921864 olap-case-study-vj
86921864 olap-case-study-vj86921864 olap-case-study-vj
86921864 olap-case-study-vj
 

More from Asadkhan47384

Usability in Practice.pptx
Usability in Practice.pptxUsability in Practice.pptx
Usability in Practice.pptxAsadkhan47384
 
Lecture 08B - Logical-DWH-Model-Pending.pptx
Lecture 08B - Logical-DWH-Model-Pending.pptxLecture 08B - Logical-DWH-Model-Pending.pptx
Lecture 08B - Logical-DWH-Model-Pending.pptxAsadkhan47384
 
Lecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptLecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptAsadkhan47384
 
Lecture 10 - DataMiningEngineering.ppt
Lecture 10 - DataMiningEngineering.pptLecture 10 - DataMiningEngineering.ppt
Lecture 10 - DataMiningEngineering.pptAsadkhan47384
 
Lecture 05-SchemaMatching.ppt
Lecture 05-SchemaMatching.pptLecture 05-SchemaMatching.ppt
Lecture 05-SchemaMatching.pptAsadkhan47384
 
Lecture 01-1-IIS.pptx
Lecture 01-1-IIS.pptxLecture 01-1-IIS.pptx
Lecture 01-1-IIS.pptxAsadkhan47384
 
Lecture 02-2-IIS.pptx
Lecture 02-2-IIS.pptxLecture 02-2-IIS.pptx
Lecture 02-2-IIS.pptxAsadkhan47384
 
Lecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptLecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptAsadkhan47384
 

More from Asadkhan47384 (14)

cactus-.pptx
cactus-.pptxcactus-.pptx
cactus-.pptx
 
Usability in Practice.pptx
Usability in Practice.pptxUsability in Practice.pptx
Usability in Practice.pptx
 
HCI_Lec-15.pptx
HCI_Lec-15.pptxHCI_Lec-15.pptx
HCI_Lec-15.pptx
 
Lecture 08B - Logical-DWH-Model-Pending.pptx
Lecture 08B - Logical-DWH-Model-Pending.pptxLecture 08B - Logical-DWH-Model-Pending.pptx
Lecture 08B - Logical-DWH-Model-Pending.pptx
 
Lecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptLecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.ppt
 
Lecture 10 - DataMiningEngineering.ppt
Lecture 10 - DataMiningEngineering.pptLecture 10 - DataMiningEngineering.ppt
Lecture 10 - DataMiningEngineering.ppt
 
HCI_Lec-12.pptx
HCI_Lec-12.pptxHCI_Lec-12.pptx
HCI_Lec-12.pptx
 
Lecture 05-SchemaMatching.ppt
Lecture 05-SchemaMatching.pptLecture 05-SchemaMatching.ppt
Lecture 05-SchemaMatching.ppt
 
Lecture 01-1-IIS.pptx
Lecture 01-1-IIS.pptxLecture 01-1-IIS.pptx
Lecture 01-1-IIS.pptx
 
Lecture 02-2-IIS.pptx
Lecture 02-2-IIS.pptxLecture 02-2-IIS.pptx
Lecture 02-2-IIS.pptx
 
HCI_ Lec-5.pptx
HCI_ Lec-5.pptxHCI_ Lec-5.pptx
HCI_ Lec-5.pptx
 
HCI.pptx
HCI.pptxHCI.pptx
HCI.pptx
 
Lecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.pptLecture 06- Reading-SQLDataManipulation.ppt
Lecture 06- Reading-SQLDataManipulation.ppt
 
HCI.pptx
HCI.pptxHCI.pptx
HCI.pptx
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

Lecture 06 -IIS-OLAP.pptx

  • 2. 2 Business Intelligence Technologies • OLAP and Data Mining differ in what they offer the user and because of this they are complementary technologies. • An environment that includes a data warehouse (or more commonly one or more data marts) together with tools such as OLAP and /or data mining are collectively referred to as Business Intelligence (BI) technologies. © Pearson Education Limited 1995, 2005
  • 3. 3 Online Analytical Processing (OLAP) • The dynamic synthesis, analysis, and consolidation of large volumes of multi-dimensional data, Codd (1993). • Describes a technology that uses a multi-dimensional view of aggregate data to provide quick access to strategic information for the purposes of advanced analysis. © Pearson Education Limited 1995, 2005
  • 4. 4 Online Analytical Processing (OLAP) • Enables users to gain a deeper understanding and knowledge about various aspects of their corporate data through fast, consistent, interactive access to a wide variety of possible views of the data. • Allows users to view corporate data in such a way that it is a better model of the true dimensionality of the enterprise. © Pearson Education Limited 1995, 2005
  • 5. 5 Online Analytical Processing (OLAP) • Can easily answer ‘who?’ and ‘what?’ questions, however, ability to answer ‘what if?’ and ‘why?’ type questions distinguishes OLAP from general-purpose query tools. • Types of analysis ranges from basic navigation and browsing (slicing and dicing) to calculations, to more complex analyses such as time series and complex modeling. © Pearson Education Limited 1995, 2005
  • 6. 6 OLAP Applications • JIT information is computed data that usually reflects complex relationships and is often calculated on the fly. Also as data relationships may not be known in advance, the data model must be flexible. © Pearson Education Limited 1995, 2005
  • 7. 7 Examples of OLAP applications in various functional areas © Pearson Education Limited 1995, 2005
  • 8. 8 OLAP Applications • Although OLAP applications are found in widely divergent functional areas, they all have the following key features: • multi-dimensional views of data • support for complex calculations • time intelligence © Pearson Education Limited 1995, 2005
  • 9. 9 OLAP Applications - multi- dimensional views of data • Core requirement of building a ‘realistic’ business model. • Provides basis for analytical processing through flexible access to corporate data. • The underlying database design that provides the multi-dimensional view of data should treat all dimensions equally. © Pearson Education Limited 1995, 2005
  • 10. 10 OLAP Applications - support for complex calculations • Must provide a range of powerful computational methods such as that required by sales forecasting, which uses trend algorithms such as moving averages and percentage growth. • Mechanisms for implementing computational methods should be clear and non-procedural. © Pearson Education Limited 1995, 2005
  • 11. 11 OLAP Applications – time intelligence • Key feature of almost any analytical application as performance is almost always judged over time. • Time hierarchy is not always used in the same manner as other hierarchies. • Concepts such as year-to-date and period-over-period comparisons should be easily defined. © Pearson Education Limited 1995, 2005
  • 12. period-over-period • The year-over-year growth rate compares a time period, usually a month or a quarter, against the same time period last year. It is a more effective way of looking at performance. If you are doing better than last month, for example, but worse than this time last year, then you might be lulled into thinking you were improving when in fact you were not. The improvement might simply be because you always do better this time of year. For this reason, whenever you are looking at a financial or economic report, make sure you know whether it is being compared to the last period (quarter, month, week, day) or year-over- year. 12
  • 13. 13 OLAP Benefits • Increased productivity of end-users. • Retention of organizational control over the integrity of corporate data. • Reduced query drag and network traffic on OLTP systems or on the data warehouse. • Improved potential revenue and profitability. © Pearson Education Limited 1995, 2005
  • 15. 15 Representation of Multi-dimensional Data • Example of two-dimensional query. • What is the total revenue generated by property sales in each city, in each quarter of 2004?’ • Choice of representation is based on types of queries end-user may ask. • Compare representation - three-field relational table versus two- dimensional matrix. © Pearson Education Limited 1995, 2005
  • 16. 16 Multi-dimensional Data as Three-field table versus Two-dimensional Matrix © Pearson Education Limited 1995, 2005
  • 17. 17 Representation of Multi-dimensional Data • Example of three-dimensional query. • ‘What is the total revenue generated by property sales for each type of property (Flat or House) in each city, in each quarter of 2004?’ • Compare representation - four-field relational table versus three- dimensional cube. © Pearson Education Limited 1995, 2005
  • 18. 18 Multi-dimensional Data as Four-field Table versus Three-dimensional Cube © Pearson Education Limited 1995, 2005
  • 19. 19 Representation of Multi-dimensional Data • Cube represents data as cells in an array. • Relational table only represents multi-dimensional data in two dimensions. © Pearson Education Limited 1995, 2005
  • 20. 20 Representation of Multi-dimensional Data • Use multi-dimensional structures to store data and relationships between data. • Multi-dimensional structures are best visualized as cubes of data, and cubes within cubes of data. Each side of a cube is a dimension. • A cube can be expanded to include other dimensions. © Pearson Education Limited 1995, 2005
  • 21. 21 Representation of Multi-dimensional Data • A cube supports matrix arithmetic. • Multi-dimensional query response time depends on how many cells have to be added ‘on the fly’. • As number of dimensions increases, number of the cube’s cells increases exponentially. © Pearson Education Limited 1995, 2005
  • 22. 22 Representation of Multi-dimensional Data • However, majority of multi-dimensional queries use summarized, high-level data. • Solution is to pre-aggregate (consolidate) all logical subtotals and totals along all dimensions. © Pearson Education Limited 1995, 2005
  • 23. 23 Representation of Multi-dimensional Data • Pre-aggregation is valuable, as typical dimensions are hierarchical in nature. • (e.g. Time dimension hierarchy - years, quarters, months, weeks, and days) • Predefined hierarchy allows logical pre-aggregation and, conversely, allows for a logical ‘drill-down’. © Pearson Education Limited 1995, 2005
  • 24. 24 Representation of Multi-dimensional Data • Supports common analytical operations • Consolidation • Drill-down • Slicing and dicing © Pearson Education Limited 1995, 2005
  • 25. 25 Representation of Multi-dimensional Data • Consolidation - aggregation of data such as simple ‘roll-ups’ or complex expressions involving inter-related data. • Drill-Down - is the reverse of consolidation and involves displaying the detailed data that comprises the consolidated data. © Pearson Education Limited 1995, 2005
  • 26. 26 Representation of Multi-dimensional Data • Slicing and Dicing - (also called pivoting) refers to the ability to look at the data from different viewpoints. © Pearson Education Limited 1995, 2005
  • 27. 27 Representation of Multi-dimensional Data • Can store data in a compressed form by dynamically selecting physical storage organizations and compression techniques that maximize space utilization. • Dense data (that is, data that exists for a high percentage of cells) can be stored separately from sparse data (that is, a significant percentage of cells are empty). © Pearson Education Limited 1995, 2005
  • 28. 28 Representation of Multi-dimensional Data • Ability to omit empty or repetitive cells can greatly reduce the size of the cube and the amount of processing. • Allows analysis of exceptionally large amounts of data. © Pearson Education Limited 1995, 2005
  • 29. 29 Representation of Multi-dimensional Data • In summary, pre-aggregation, dimensional hierarchy, and sparse data management can significantly reduce the size of the cube and the need to calculate values ‘on-the-fly’. • Removes need for multi-table joins and provides quick and direct access to arrays of data, thus significantly speeding up execution of multi-dimensional queries. © Pearson Education Limited 1995, 2005
  • 30. 30 Codd’s rules for OLAP • Dynamic sparse matrix handling • Multi-user support • Unrestricted cross-dimensional operations • Intuitive data manipulation • Flexible reporting • Unlimited dimensions and aggregation levels © Pearson Education Limited 1995, 2005
  • 31. 31 OLAP Extensions to SQL • Advantages of SQL include that it is easy to learn, non-procedural, free-format, DBMS-independent, and that it is a recognized international standard. • However, major limitation of SQL is the inability to answer routinely asked business queries such as computing the percentage change in values between this month and a year ago or to compute moving averages, cumulative sums, and other statistical functions. © Pearson Education Limited 1995, 2005
  • 32. 32 OLAP Extensions to SQL • Answer is ANSI adopted a set of OLAP functions as an extension to SQL to enable these calculations as well as many others that used to be impossible or even impractical within SQL. • IBM and Oracle jointly proposed these extensions early in 1999 and they now form part of the current SQL standard, namely SQL: 2003. © Pearson Education Limited 1995, 2005
  • 33. 33 OLAP Extensions to SQL - RISQL • The extensions are collectively referred to as the ‘OLAP package’ and are described as follows: • Feature T431, ‘Extended Grouping capabilities’ • Feature T611, ‘Extended OLAP operators’ © Pearson Education Limited 1995, 2005
  • 34. 34 Extended Grouping Capabilities • Aggregation is a fundamental part of OLAP. To improve aggregation capabilities the SQL standard provides extensions to the GROUP BY clause such as the ROLLUP and CUBE functions. © Pearson Education Limited 1995, 2005
  • 35. 35 Extended Grouping Capabilities • ROLLUP supports calculations using aggregations such as SUM, COUNT, MAX, MIN, and AVG at increasing levels of aggregation, from the most detailed up to a grand total. • CUBE is similar to ROLLUP, enabling a single statement to calculate all possible combinations of aggregations. CUBE can generate the information needed in cross-tabulation reports with a single query. © Pearson Education Limited 1995, 2005
  • 36. 36 Extended Grouping Capabilities • ROLLUP and CUBE extensions specify exactly the groupings of interest in the GROUP BY clause and produces a single result set that is equivalent to a UNION ALL of differently grouped rows. © Pearson Education Limited 1995, 2005
  • 37. 37 Extended Grouping Capabilities • ROLLUP Extension to GROUP BY • enables a SELECT statement to calculate multiple levels of subtotals across a specified group of dimensions. ROLLUP appears in the GROUP BY clause in a SELECT statement using the following format: SELECT ... GROUP BY ROLLUP(columnList) © Pearson Education Limited 1995, 2005
  • 38. 38 Extended Grouping Capabilities • ROLLUP creates subtotals that roll up from the most detailed level to a grand total, following a column list specified in the ROLLUP clause. • ROLLUP first calculates the standard aggregate values specified in the GROUP BY clause and then creates progressively higher level subtotals, moving from right to left through the column list until finally completing with a grand total. © Pearson Education Limited 1995, 2005
  • 39. 39 Extended Grouping Capabilities • ROLLUP creates subtotals at n + 1 levels, where n is the number of grouping columns. For instance, if a query specifies ROLLUP on grouping columns of propertyType, yearMonth, and city (n = 3), the result set will include rows at 4 aggregation levels. © Pearson Education Limited 1995, 2005
  • 40. 40 Example - Using the ROLLUP Group Function • Show the totals for sales of flats or houses by branch offices located in Aberdeen, Edinburgh, or Glasgow for the months of September and October of 2004. © Pearson Education Limited 1995, 2005
  • 41. 41 Example - Using the ROLLUP Group Function SELECT propertyType, yearMonth, city, SUM(saleAmount) AS sales FROM Branch, PropertyFor Sale, PropertySale WHERE Branch.branchNo = PropertySale.branchNo AND PropertyForSale.propertyNo = PropertySale.propertyNo AND PropertySale.yearMonth IN ('2004-08', '2004-09') AND Branch.city IN (‘Aberdeen’, ‘Edinburgh’, ‘Glasgow’) GROUP BY ROLLUP(propertyType, yearMonth, city); © Pearson Education Limited 1995, 2005
  • 42. 42 Example - Using the ROLLUP Group Function © Pearson Education Limited 1995, 2005
  • 43. 43 Extended Grouping Capabilities • CUBE Extension to GROUP BY • CUBE takes a specified set of grouping columns and creates subtotals for all of the possible combinations. CUBE appears in the GROUP BY clause in a SELECT statement using the following format: SELECT ... GROUP BY CUBE(columnList) © Pearson Education Limited 1995, 2005
  • 44. 44 Extended Grouping Capabilities • CUBE generates all the subtotals that could be calculated for a data cube with the specified dimensions. • CUBE can be used in any situation requiring cross- tabular reports. The data needed for cross-tabular reports can be generated with a single SELECT using CUBE. Like ROLLUP, CUBE can be helpful in generating summary tables. © Pearson Education Limited 1995, 2005
  • 45. 45 Extended Grouping Capabilities • CUBE is typically most suitable in queries that use columns from multiple dimensions rather than columns representing different levels of a single dimension. © Pearson Education Limited 1995, 2005
  • 46. 46 Example - Using the CUBE Group Function • Show all possible subtotals for sales of properties by branches offices in Aberdeen, Edinburgh, and Glasgow for the months of September and October of 2004. © Pearson Education Limited 1995, 2005
  • 47. 47 Example - Using the CUBE Group Function SELECT propertyType, yearMonth, city, SUM(saleAmount) AS sales FROM Branch, PropertyFor Sale, PropertySale WHERE Branch.branchNo = PropertySale.branchNo AND PropertyForSale.propertyNo = PropertySale.propertyNo AND PropertySale.yearMonth IN ('2004-08', '2004-09') AND Branch.city IN (‘Aberdeen’, ‘Edinburgh’, ‘Glasgow’) GROUP BY CUBE(propertyType, yearMonth, city); © Pearson Education Limited 1995, 2005
  • 48. 48 Example - Using the CUBE Group Function © Pearson Education Limited 1995, 2005
  • 49. 49 Elementary OLAP Operators • Supports a variety of operations such as rankings and window calculations. • Ranking functions include cumulative distributions, percent rank, and N-tiles. • Windowing allows the calculation of cumulative and moving aggregations using functions such as SUM, AVG, MIN, and COUNT. © Pearson Education Limited 1995, 2005
  • 50. 50 Elementary OLAP Operators • Ranking Functions • Computes the rank of a record compared to other records in the dataset based on the values of a set of measures. There are various types of ranking functions, including RANK and DENSE_RANK. The syntax for each ranking function is: RANK( ) OVER (ORDER BY columnList) DENSE_RANK( ) OVER (ORDER BY columnList) © Pearson Education Limited 1995, 2005
  • 51. 51 Elementary OLAP Operators • The difference between RANK and DENSE_RANK is that DENSE_RANK leaves no gaps in the sequential ranking sequence when there are ties for a ranking. © Pearson Education Limited 1995, 2005
  • 52. 52 Example - Using the RANK and DENSE_RANK Functions • Rank the total sales of properties for branch offices in Edinburgh. SELECT branchNo, SUM(saleAmount) AS sales, RANK() OVER (ORDER BY SUM(saleAmount)) DESC AS ranking, DENSE_RANK() OVER (ORDER BY SUM(saleAmount)) DESC AS dense_ranking FROM Branch, PropertySale WHERE Branch.branchNo = PropertySale.branchNo AND Branch.city = ‘Edinburgh’ GROUP BY(branchNo); © Pearson Education Limited 1995, 2005
  • 53. 53 Example - Using the RANK and DENSE_RANK Functions © Pearson Education Limited 1995, 2005
  • 54. 54 Elementary OLAP Operators • Supports a variety of operations such as rankings and window calculations. • Ranking functions include cumulative distributions, percent rank, and N-tiles. • Windowing allows the calculation of cumulative and moving aggregations using functions such as SUM, AVG, MIN, and COUNT. © Pearson Education Limited 1995, 2005
  • 55. 55 Elementary OLAP Operators • Windowing Calculations • Can be used to compute cumulative, moving, and centered aggregates. They return a value for each row in the table, which depends on other rows in the corresponding window. © Pearson Education Limited 1995, 2005
  • 56. 56 Elementary OLAP Operators • Windowing Calculations • Can be used to compute cumulative, moving, and centered aggregates. They return a value for each row in the table, which depends on other rows in the corresponding window. • These aggregate functions provide access to more than one row of a table without a self-join and can be used only in the SELECT and ORDER BY clauses of the query. © Pearson Education Limited 1995, 2005
  • 57. 57 Example - Using Windowing Calculations • Show the monthly figures and three-month moving averages and sums for property sales at branch office B003 for the first six months of 2004. © Pearson Education Limited 1995, 2005
  • 58. 58 Example - Using Windowing Calculations SELECT yearMonth, SUM(saleAmount) AS monthlySales, AVG(SUM(saleAmount)) OVER (ORDER BY yearMonth, ROWS 2 PRECEDING) AS 3- month moving avg, SUM(SUM(salesAmount)) OVER (ORDER BY yearMonth ROWS 2 PRECEDING) AS 3-month moving sum FROM PropertySale WHERE branchNo = ‘B003’ AND yearMonth BETWEEN ('2004-01' AND '2004-06’) GROUP BY yearMonth ORDER BY yearMonth; © Pearson Education Limited 1995, 2005
  • 59. 59 Example - Using Windowing Calculations © Pearson Education Limited 1995, 2005

Editor's Notes

  1. How to calculate percent increase between two numbers? To calculate percent difference, you need to follow these steps: Percent Problem: You need to calculate percent % increase from 2 to 10. First Step: find the difference between two numbers, in this case, it's 10 - 2 = 8. Second Step: Take the difference, 8, and divide by the original number: 8/2 = 4. Last, multiply the number above by 100: 4*100 = 400%. You're done! You calculated difference of a number in percent, and the answer is a percentage increase of 400%.