Description of Assignment Three

download Description of Assignment Three

of 21

Transcript of Description of Assignment Three

  • 8/14/2019 Description of Assignment Three

    1/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    ROYAL INSTITUTE OF TECHNOLOGY

    DATA WAREHOUSING

    ASSIGNMENT 3 OLAP

    GROUP 18

    Bhatti, Waqas

    Leghari, Arshad Ali

    Luo, Haoxu

    Vu, Phuong

    1/21

  • 8/14/2019 Description of Assignment Three

    2/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    The description of OLAP

    assignment

    Following the requirements of this assignment three, the task one

    and two are easy to be finished.

    Task one:

    After setting up the project environment of DW, just to create

    data source view and add the dimension as following:

    First: dim Datum using time dimension: add two hierarchies asrequirement:

    Second:dim butik

    2/21

  • 8/14/2019 Description of Assignment Three

    3/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Third: dim Demografi:

    Fourth: dim Kampanj

    3/21

  • 8/14/2019 Description of Assignment Three

    4/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Fifth: dim Kund:

    Sixth: dim Sljare

    4/21

  • 8/14/2019 Description of Assignment Three

    5/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Seventh: dim Produkt

    Task Two:

    Create and configure a data cube as direction.

    5/21

  • 8/14/2019 Description of Assignment Three

    6/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Task Three:

    After creating the Cube of Elektronikkedja,what we need to do is

    to select dimensions and Measures to answer the questions.

    3.1

    Which salesperson has sold the most products during the

    year 2006 this far?

    According to the description of question, year 2006, so getting thehierarchy r mnad dag of dim_detum and click the small

    pane of 2006. Then choose the hierarchy personnr of Dim_Sljareand chick to show the sub attribute of this dimension so that thename of sale person could be showed. Now we have two conditionsof this question, next step is to get total count from Fact Kop andchick the right button of mouse to choose sort descending. As thefollowing picture shows, the first row is salesperson who sold themost products during 2006. ,

    6/21

  • 8/14/2019 Description of Assignment Three

    7/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 hgtalarpaket?There are two conditions in this question,the one is productcategory hgtalarpaket ,another is shop Electronics Bothell.So wecould get One hierarchy kategori tillverkare beskrivning fromdim_Produkt and choose the category hgtalarpaket,then selectone hierarchy beskrivning from dim_Kampanj and chooseElectronics Bothell simultaneity.the final step is to get total profitfrom Fact Kop.as is showed in the following:

    7/21

  • 8/14/2019 Description of Assignment Three

    8/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    3.3

    How many purchases of products from Apple were made by

    women in august 2006?

    As it is described blew,first thing is to identify the condition of

    question. Here there are three conditions, first one is August 2009

    which we could get from dim_datum, next one is women which

    could be selected from dim_demografi and the third one could be

    chose hierarchy from dim_product .After these, the final part is to

    get total profit from Fact Kop.

    8/21

  • 8/14/2019 Description of Assignment Three

    9/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    3.4

    During which month was the sales amount highest this far?

    Here ,get one hierarchy mnadsnamn from dim_datum and gettotal sum from Fact Kop .then sort descending with total sum. Thenwe could find which month is the highest amount.

    9/21

  • 8/14/2019 Description of Assignment Three

    10/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    3.5

    Which salesperson has sold the most of the product LCD-TV thisfar?

    Like the same way we did before, confirm the conditions of thequestion. 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_Sljare.The final stepis 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

  • 8/14/2019 Description of Assignment Three

    11/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    And we have tried to test the result using sql script in

    Elektronikkedja DW:

    4.2

    Display using drillthrough a selection of 10 of the rows that

    generated the value from 4.1.

    4.3

    Display the number of purchases that were made by women per

    year where years are displayed by column.

    11/21

    select [Measures].[Total profit] on 0,[Dim Demografi].[civilstnd kn rsln].[Cilvilstnd].&[married] on 1from [Elektronikkedja DW]

    selectsum(vinst)from dbo.Fact_Kpwhere demo_id in(select id from dbo.Dim_Demografi where cilvilstnd ='married'

    )

    drillthroughmaxrows 10select [Measures].[Total profit] on 0,[Dim Demografi].[civilstnd kn rsln].[Cilvilstnd].&[married] on 1from [Elektronikkedja DW]

    select [Measures].[Total Count] on 1,[Dim Datum].[r - Mnad -Dag].[r] on 0from [Elektronikkedja DW]where [Dim Demografi].[kn civilstnd rsln].[Kn].&[female]

  • 8/14/2019 Description of Assignment Three

    12/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    We have also tested using sql script:

    4.4

    Display the number of purchases and total profit for the period May

    to September 2006 (each month by its own) made by customersliving in Seattle.

    We have also tested using sql script:

    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

    selectcount(*)from dbo.Fact_Kp, dbo.Dim_Datumwhere demo_id in(select id from dbo.Dim_Demografi where Kn=female) and dag = datum_id Group by r

    select{( [Dim Datum].[r - Mnad - Dag].[Mnad].&[200605] ):( [Dim Datum].[r - Mnad - Dag].[Mnad].&[200609] )} on 0,{[Measures].[Total Count] ,[Measures].[Total profit]} on 1from [Elektronikkedja DW]where [Dim Kund].[postort gatuadress].[Postort].&[Seattle]

    select mnad,count(*),sum(vinst)from Fact_Kp , dbo.Dim_Datumwhere kund_id in(select id from dbo.Dim_Kund where postort ='Seattle')and datum_id >= 20060501 and datum_id

  • 8/14/2019 Description of Assignment Three

    13/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    salesperson.

    Task five:

    5.1

    [Profit_Per_Product]

    According to the requirement, we add a new calculation namedProfit_Per_Product and write expression like following:

    Then test it in the browser:

    13/21

    WITH

    MEMBER [Sljare namn] as [Dim Sljare].[Personnr].Properties( "Namn" )MEMBER [Measures].[Bonus] as [Measures].[Total sum] * 0.01SELECT [Dim Datum].[Mnadsnamn].[Mnadsnamn] ONCOLUMNS,

    [Dim Sljare].[namn].[namn].membersONROWSFROM [Elektronikkedja DW]where [Measures].[Bonus]

    [Measures].[Total Profit]/[Measures].[Total Count]

  • 8/14/2019 Description of Assignment Three

    14/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    5.2

    [Profitability_Status]

    Add new calculation named as Profitability_Status and write theexpression:

    14/21

    casewhen [Measures].[Total Profit]/[Measures].[Total Count]> 2000then'Very profitable'when [Measures].[Total Profit]/[Measures].[Total Count]> 1500then'Profitable'when [Measures].[Total Profit]/[Measures].[Total Count]> 1000then'Slightly profitable'else'Not profitable'end

  • 8/14/2019 Description of Assignment Three

    15/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Display in the browser:

    5.3

    [Average_Sum_Per_Month]The operation of adding new calculation is same with before.

    15/21

  • 8/14/2019 Description of Assignment Three

    16/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    5.4

    [Profit_Development]

    16/21

    [Measures].[Total Summa]/[Measures].[Total Count]

  • 8/14/2019 Description of Assignment Three

    17/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    We should pay attention to the first month .

    17/21

    CaseWhen [Dim Datum].[r - Mnad - Dag].CurrentMember.LevelIs

    [Dim Datum].[r - Mnad - Dag].[(All)]ThenWhenIsEmpty((ParallelPeriod([Dim Datum].[r - Mnad - Dag].[Mnad],1,[DimDatum].[r - Mnad - Dag].CurrentMember),[Measures].[Total Summa]) )then''

    Else (( [Dim Datum].[r - Mnad - Dag].CurrentMember,[Measures].[Total Summa] )

    -(ParallelPeriod(

    [Dim Datum].[r - Mnad - Dag].[Mnad],1,[Dim Datum].[r - Mnad - Dag].CurrentMember

    ),[Measures].[Total Summa]

    )

    )/(ParallelPeriod(

    [Dim Datum].[r - Mnad - Dag].[Mnad],1,[Dim Datum].[r - Mnad - Dag].CurrentMember

    ),[Measures].[Total Summa]

    )End

  • 8/14/2019 Description of Assignment Three

    18/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    5.5

    [Sales_Deviation]

    18/21

  • 8/14/2019 Description of Assignment Three

    19/21

  • 8/14/2019 Description of Assignment Three

    20/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    Task six:

    Create new action:select target type as cell, target object as All

    cells, condition like

    Action type :URL. Action Expression like following:

    The following picture is the detail about configuration of actions.

    20/21

    "http://www.google.se/search?q=" +[Dim Produkt].[Tillverkare].currentmember.name+ " " +[Dim Produkt].[Beskrivning].currentmember.name

    Not isempty([dim product].[tillverkare].currentmember.name

    [beskrivning]) and Not isempty([dim product].

    [beskrivning].currentmember.name)

  • 8/14/2019 Description of Assignment Three

    21/21

    Data warehouse ASSIGNMENT 3 OLAP Group 18

    After finishing the configuration of action, using browser to test .as

    the following shows :click the button of action would open the

    search information of this product on the google website.

    21/21