Академический Документы
Профессиональный Документы
Культура Документы
DATA WAREHOUSING
ASSIGNMENT 3 – OLAP
GROUP 18
Bhatti, Waqas
Luo, Haoxu
Vu, Phuong
1/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
assignment
Task one:
Second:dim butik
2/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
3/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
4/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
Task Two:
5/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
Task Three:
3.1
6/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
3.2
How much has the shop Electronics Bothell had in profit for
products of the category ”högtalarpaket”?
There are two conditions in this question,the one is product
category ‘högtalarpaket’ ,another is shop ‘Electronics Bothell’.So we
could get One hierarchy ‘kategori – tillverkare – beskrivning ’ from
dim_Produkt and choose the category ’ högtalarpaket’,then select
one hierarchy ’beskrivning’ from dim_Kampanj and choose
‘Electronics Bothell’ simultaneity.the final step is to get total profit
from Fact Kop.as is showed in the following:
7/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
3.3
8/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
3.4
During which month was the sales amount highest this far?
9/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
3.5
Which salesperson has sold the most of the product ”LCD-TV” this
far?
Like the same way we did before, confirm the conditions of the
question. one could get from One hierarchy ‘kategori – tillverkare –
beskrivning ’ from dim_Produkt and choose the category ’ LCD-TV’,
then select one hierarchy ‘personnr ’ of Dim_Säljare.The final step
is to get total count from Fact Kop. As is showed in the following:
Task four:
4.1
Display the total profit for all purchases made by customers with
the civilstatus ”married”.
10/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
4.2
drillthrough maxrows 10
select [Measures].[Total profit] on 0,
[Dim Demografi].[civilstånd – kön – årslön].
[Cilvilstånd].&[married] on 1
from [Elektronikkedja DW]
4.3
11/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
4.4
Display the number of purchases and total profit for the period May
to September 2006 (each month by its own) made by customers
living in Seattle.
select
{( [Dim Datum].[År - Månad - Dag].[Månad].&[200605] ):
( [Dim Datum].[År - Månad - Dag].[Månad].&[200609] )} on 0,
{[Measures].[Total Count] ,[Measures].[Total profit]} on 1
from [Elektronikkedja DW]
where [Dim Kund].[postort – gatuadress].[Postort].&[Seattle]
4.5
Display how much bonus each salesperson has gotten for each
month. Months should be displayed as columns and the
salespersons names should be displayed as rows. Bonus for each
salesperson is calculated according to 0.01*sum_sales for the
12/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
salesperson.
WITH
MEMBER [Säljare namn] as [Dim Säljare].
[Personnr].Properties( "Namn" )
MEMBER [Measures].[Bonus] as [Measures].[Total sum] * 0.01
SELECT [Dim Datum].[Månadsnamn].[Månadsnamn] ON COLUMNS,
[Dim Säljare].[namn].[namn].members ON ROWS
FROM [Elektronikkedja DW]
where [Measures].[Bonus]
Task five:
5.1
[Profit_Per_Product]
According to the requirement, we add a new calculation named
‘Profit_Per_Product’ and write expression like following:
13/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
5.2
[Profitability_Status]
Add new calculation named as ‘Profitability_Status’ and write the
expression:
case
when [Measures].[Total Profit]/[Measures].[Total Count]> 2000
then 'Very profitable'
when [Measures].[Total Profit]/[Measures].[Total Count]> 1500
then 'Profitable'
when [Measures].[Total Profit]/[Measures].[Total Count]> 1000
then 'Slightly profitable'
else 'Not profitable'
end
14/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
5.3
[Average_Sum_Per_Month]
The operation of adding new calculation is same with before.
15/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
5.4
[Profit_Development]
16/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
Case
When [Dim Datum].[År - Månad - Dag].CurrentMember.Level Is
[Dim Datum].[År - Månad - Dag].[(All)]
Then ’’
When IsEmpty((
ParallelPeriod([Dim Datum].[År - Månad - Dag].[Månad],1,[Dim
Datum].[År - Månad - Dag].CurrentMember
),[Measures].[Total Summa]) )
then ''
Else (
( [Dim Datum].[År - Månad - Dag].CurrentMember,
[Measures].[Total Summa] )
-
(
ParallelPeriod
(
[Dim Datum].[År - Månad - Dag].[Månad],
1,
[Dim Datum].[År - Månad - Dag].CurrentMember
),
[Measures].[Total Summa]
)
)
/
(
ParallelPeriod
(
[Dim Datum].[År - Månad - Dag].[Månad],
1,
[Dim Datum].[År - Månad - Dag].CurrentMember
),
[Measures].[Total Summa]
)
End
17/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
5.5
[Sales_Deviation]
18/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
Case
When [Dim Datum].[År - Månad - Dag].CurrentMember.Level Is
[Dim Datum].[År - Månad - Dag].[Dag]
then ([Measures].[Total Summa]-6000000)/6000000
When [Dim Datum].[År - Veckonr - Dag].CurrentMember.Level Is
[Dim Datum].[År - Veckonr - Dag].[Veckonr]
Then ([Measures].[Total Summa]-6000000*(Count(Descendants([Dim
Datum].[År - Veckonr - Dag].currentmember, [Dim Datum].[År -
Veckonr - Dag].[Dag], SELF))))/((Count(Descendants([Dim Datum].
[År - Veckonr - Dag].currentmember, [Dim Datum].[År - Veckonr -
Dag].[Dag], SELF)))*6000000)
when [Dim Datum].[År - Månad - Dag].CurrentMember.Level Is
[Dim Datum].[År - Månad - Dag].[Månad]
Then ([Measures].[Total Summa]-6000000*(Count(Descendants([Dim
Datum].[År - Månad - Dag].currentmember, [Dim Datum].[År - Månad
- Dag].[Dag], SELF))))/((Count(Descendants([Dim Datum].[År -
Månad - Dag].currentmember, [Dim Datum].[År - Månad - Dag].[Dag],
SELF)))*6000000)
When [Dim Datum].[År - Månad - Dag].CurrentMember.Level Is
[Dim Datum].[År - Månad - Dag].[År]
else ''
end
19/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
Task six:
"http://www.google.se/search?q="+[Dim Produkt].
[Tillverkare].currentmember.name+ " " +[Dim Produkt].
[Beskrivning].currentmember.name
20/21
Data warehouse ASSIGNMENT 3 – OLAP Group 18
21/21