You are on page 1of 5

Assignment No 2

Name: Waleed Zaman


Shehryar Malik
Osama Mushtaq
Sidra Hanif Gillani
Enrollment: 01-235161-068
01-235161-083
01-235161-066
01-235161-055

Q1.Process to Create a Pivot table in Excel.


To insert a pivot table, execute the following steps.
 Click any single cell inside the data set.
 On the Insert tab, in the Tables group, click PivotTable.
The PivotTable Fields pane appears. To get the total revenue exported of each salesperson, drag
the following fields to the different areas.

After dragging the fields in the respective columns a Pivot table will be generated.
The following Pivot table shows the sum of revenue of sales made by
every Salesperson along with a Pivot Chart.

The following Pivot table and Chart show the sum of revenue generated
from every city.

The following Pivot Table shows the products sold in USA and the
amount of revenue generated from them.
Q2. Three Different Pivot Table using Web Pivot Table and
Corresponding MDX queries.

The following Web Pivot Diagram shows the amount spend in the
respective Fiscal Year.
MDX Query:
WITH

SET [~0] AS {[Measures].[Amount], [Measures].[Average Rate]}

SET [~1] AS {[Organization].[Organizations].[Organization Level 01].Members}

SET [~2] AS Exists({[Organization].[Organizations].[Organization Level 02].Members}, [~1])

SET [~3] AS Exists({[Organization].[Organizations].[Organization Level 03].Members}, [~2])

SET [~4] AS Exists({[Organization].[Organizations].[Organization Level 04].Members}, [~3])

SELECT

NON EMPTY {Hierarchize({[~0]})} ON COLUMNS ,

NON EMPTY {Hierarchize({[~1],[~2],[~3],[~4]})} ON ROWS

FROM [Finance].
The following Web Pivot table Shows the Amount spend in every
department.
MDX query:
WITH

SET [~0] AS {[Date].[Fiscal Year].[Fiscal Year].Members}

SET [~1] AS {[Department].[Departments].[Department Level 01].Members}

SET [~2] AS Exists({[Department].[Departments].[Department Level 02].Members}, [~1])

SELECT

NON EMPTY {[Measures].[Amount]} ON COLUMNS ,

NON EMPTY Hierarchize(Union(CrossJoin([~0],[~1]), CrossJoin([~0],[~2]))) ON ROWS

FROM [Finance]

The following Web Pivot Diagram show the amount spend in the
respective currency in the respective Year.
MDX Query:
WITH

SET [~0] AS {[Date].[Fiscal Year].[Fiscal Year].Members}

SET [~1] AS {[Department].[Departments].[Department Level 01].Members}

SET [~2] AS Exists({[Department].[Departments].[Department Level 02].Members}, [~1])

SELECT

NON EMPTY {[Measures].[Amount]} ON COLUMNS ,


NON EMPTY Hierarchize(Union(CrossJoin([~0],[~1]), CrossJoin([~0],[~2]))) ON ROWS

FROM [Finance]

You might also like