Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By : Abolfazl Radgoudarzi, Reza Rad
Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By: Abolfazl Radgoudarzi, Reza Rad

Overview of this book

Table of Contents (19 chapters)
Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – applying ordering and grouping on the data rows


In this example, we will modify the customers' report generated in the previous example. We will add a SalesAmount column for each customer. We will apply sorting on the report and we will add a group for NumberChildrenAtHome. We will also add a subtotal for each group item. Perform the following steps:

  1. In the Customers report, go to the Report Data pane and change the query of DataSet1 to the following script:

    SELECT        FirstName, LastName, BirthDate, MaritalStatus, Gender, TotalChildren, NumberChildrenAtHome, EnglishEducation, NumberCarsOwned
    ,sum(FactInternetSales.SalesAmount) as SalesAmount
    FROM            DimCustomer
    left outer join FactInternetSales
    on DimCustomer.CustomerKey=FactInternetSales.CustomerKey
    group by FirstName, LastName, BirthDate,
      MaritalStatus, Gender, TotalChildren, NumberChildrenAtHome, EnglishEducation, NumberCarsOwned
  2. Now you will see the SalesAmount column under DataSet1. Drag-and-drop this column...