Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
SAP BusinessObjects Reporting Cookbook
SAP BusinessObjects Reporting Cookbook

SAP BusinessObjects Reporting Cookbook: Over 80 recipes to help you build, customize, and distribute reports using SAP BusinessObjects

eBook
€24.99 €36.99
Paperback
€45.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

SAP BusinessObjects Reporting Cookbook

Chapter 2. Creating New Queries

In this chapter, we will cover the following recipes:

  • The universe structure
  • Creating a simple query
  • Editing the query
  • Filtering the query results
  • Using prompts
  • Using AND/OR logic in conditions
  • Creating nested filters
  • Using a subquery
  • Using combined queries
  • Adding another query
  • Working with several queries
  • Working with the query properties
  • Using the data preview
  • Viewing the SQL
  • Using other query results
  • Scope of analysis
  • Using database ranking
  • Using BEx queries

Introduction

Creating queries is considered in many ways the core functionality of the Web Intelligence application. The source for every report is a query that is based on a database (relational or operational), a data warehouse, an OLAP cube, a BEx query, a web service, or even an Excel or a text file.

The general idea and main theme when building a query is that we create a structure that can access our data sources and fetch relevant, meaningful, useful data to our report presentation layer, according to the user requirements.

Creating queries is the first step in creating a report and it is important because it defines the context of the data we are analyzing as a well as its accuracy.

A good query would be one that retrieves only the data slice that is relevant to the report consumer.

In terms of efficiency, query running time, and performance, we are more dependent on the way and type the database is structured. However, for the end user (the report builder), what matters is the fact...

The universe structure

A universe is a semantic layer that maps a specific data area or several areas in the data warehouse or in any database such as SQL Server, DB2, Oracle, and many others. The universe uses a connection in order to connect to the database, and once it's set, users can navigate to the universe, build queries, and connect through the universe connection to the database, retrieving the most updated data according to the data update date in the database.

The universe represents the data in a lucid manner, so business users don't require database programming knowledge or an understanding of how the database is structured.

What the user does need to know is how the universe is structured: its main business purposes, what kind of queries can be built using it, and what kind of objects can be used to build his reports and where can he find them in the universe.

Traditionally, a universe maps a specific data subject such as Sales, Marketing, Human Resources, Logistics...

Creating a simple query

Our first step will be to create a simple query based on a universe called motors.

This universe is used for ad hoc reporting about a car rental and sales company.

The core data in this universe is the car rental and sales figures that can be sliced by customer, time, type of car, and geographical data.

Getting ready

We want to create a query that will display the sales revenue for each car category.

How to do it...

First of all, we will be required to access the motors universe.

We will launch the Web Intelligence application through the main launch panel in the home screen. In the empty tab that has opened, we will click on the New button that is located to the left of the Open file icon, as shown in the following screenshot:

How to do it...

The next screen will prompt us to choose the data source we want to use in order to create our query. The options are as follows:

  • No data source: This enables us to preformat the report without creating or running a query
  • Universe: As discussed earlier...

Editing the query

Queries can be edited in order to adjust to the evolving requirements of the report. Through my work, I have come to know a simple fact: most reports are edited at one stage or another.

Editing is easy and is conducted in the same way a query is created, that is, by adding objects to the query or by removing some of them.

Getting ready

We want to extend the current query definition and add the model dimension to it so that we can analyze the sales data at a more detailed level.

How to do it...

On the report screen, we will click on the Edit button under the Data Access ribbon; this will open the Query Panel.

We will drag-and-drop the Model object and run the query.

The result table will remain the same. In order to present the additional object that we added to the query, we will drag Model from the Available Objects panel to the existing table, as shown in the following screenshot:

How to do it...

The final table will now display the new object as well, showing for each category the model and...

Filtering the query results

Every query is built to retrieve a specific set of results.

When we define a query, the data can be processed and analyzed in several possible contexts:

  • Time: This gives information about when an event occurred; for example, the sales for the current week (a "when" business question)
  • Data type and specification: This gives the model specifications of the cars that were rented or sold (a "which" business question)
  • Measure: This gives a range or a value that is greater or less than (a "how much" business question)

Without a filtering context, a query is somewhere between serving a meaningless purpose and answering a very general question. The main idea when creating query filters is to fetch only the data that is relevant to the business question. The rule of "garbage in garbage out" applies here. By defining all the relevant conditions, we ensure that we will get accurate results as well as better performance.

Every condition...

Introduction


Creating queries is considered in many ways the core functionality of the Web Intelligence application. The source for every report is a query that is based on a database (relational or operational), a data warehouse, an OLAP cube, a BEx query, a web service, or even an Excel or a text file.

The general idea and main theme when building a query is that we create a structure that can access our data sources and fetch relevant, meaningful, useful data to our report presentation layer, according to the user requirements.

Creating queries is the first step in creating a report and it is important because it defines the context of the data we are analyzing as a well as its accuracy.

A good query would be one that retrieves only the data slice that is relevant to the report consumer.

In terms of efficiency, query running time, and performance, we are more dependent on the way and type the database is structured. However, for the end user (the report builder), what matters is the fact...

The universe structure


A universe is a semantic layer that maps a specific data area or several areas in the data warehouse or in any database such as SQL Server, DB2, Oracle, and many others. The universe uses a connection in order to connect to the database, and once it's set, users can navigate to the universe, build queries, and connect through the universe connection to the database, retrieving the most updated data according to the data update date in the database.

The universe represents the data in a lucid manner, so business users don't require database programming knowledge or an understanding of how the database is structured.

What the user does need to know is how the universe is structured: its main business purposes, what kind of queries can be built using it, and what kind of objects can be used to build his reports and where can he find them in the universe.

Traditionally, a universe maps a specific data subject such as Sales, Marketing, Human Resources, Logistics, Billing,...

Creating a simple query


Our first step will be to create a simple query based on a universe called motors.

This universe is used for ad hoc reporting about a car rental and sales company.

The core data in this universe is the car rental and sales figures that can be sliced by customer, time, type of car, and geographical data.

Getting ready

We want to create a query that will display the sales revenue for each car category.

How to do it...

First of all, we will be required to access the motors universe.

We will launch the Web Intelligence application through the main launch panel in the home screen. In the empty tab that has opened, we will click on the New button that is located to the left of the Open file icon, as shown in the following screenshot:

The next screen will prompt us to choose the data source we want to use in order to create our query. The options are as follows:

  • No data source: This enables us to preformat the report without creating or running a query

  • Universe: As discussed earlier...

Editing the query


Queries can be edited in order to adjust to the evolving requirements of the report. Through my work, I have come to know a simple fact: most reports are edited at one stage or another.

Editing is easy and is conducted in the same way a query is created, that is, by adding objects to the query or by removing some of them.

Getting ready

We want to extend the current query definition and add the model dimension to it so that we can analyze the sales data at a more detailed level.

How to do it...

On the report screen, we will click on the Edit button under the Data Access ribbon; this will open the Query Panel.

We will drag-and-drop the Model object and run the query.

The result table will remain the same. In order to present the additional object that we added to the query, we will drag Model from the Available Objects panel to the existing table, as shown in the following screenshot:

The final table will now display the new object as well, showing for each category the model and...

Filtering the query results


Every query is built to retrieve a specific set of results.

When we define a query, the data can be processed and analyzed in several possible contexts:

  • Time: This gives information about when an event occurred; for example, the sales for the current week (a "when" business question)

  • Data type and specification: This gives the model specifications of the cars that were rented or sold (a "which" business question)

  • Measure: This gives a range or a value that is greater or less than (a "how much" business question)

Without a filtering context, a query is somewhere between serving a meaningless purpose and answering a very general question. The main idea when creating query filters is to fetch only the data that is relevant to the business question. The rule of "garbage in garbage out" applies here. By defining all the relevant conditions, we ensure that we will get accurate results as well as better performance.

Every condition is structured from the following three...

Using prompts


Prompt is an operand that enables a dynamic value insertion into the condition's last section. When we think about it, most reports use prompts as they require dynamic values in the conditions. The best example is a time-ranged report that requires the picking of different date values every day.

Getting ready

We need to edit our existing query filter so that business users will be able to choose country values dynamically.

How to do it...

First, we will change the operand type to Prompt, as shown in the following screenshot. Note that generic text is added to the prompt area that says Enter values for Client.

We will click on the Run query button. A prompt window will appear. In this prompt window, we will be asked to pick a value from the existing list of values, as shown in the following screenshot. As long as a value isn't picked, a red arrow will appear next to the prompt text.

We will pick the country Japan. The red arrow will change to green, confirming that the prompt has...

Using AND/OR logic in conditions


Using several conditions in a query is a very common scenario because, in many cases, we are required to build a query with a set of filters to get the most accurate results.

Conditions in queries can use the AND or OR operators.

A relation that creates an intersection between conditions is called an AND relation. This means all the common rows for Filter A and Filter B will be retrieved.

Have a look at the following figure. Here, the data retrieved by the AND operator can be described as the dark area in the middle. It is the common intersected area.

For instance, if our query has a set of two conditions: year equal to 2014 AND product name equal to smart phones and no smart phones were sold in 2014, the query won't return any results since the conditions didn't have common rows.

The relation between conditions using an OR operator is a relation that uses a union operator, meaning there is no need for the conditions to have common rows. If any one of the conditions...

Creating nested filters


Nested filters are used when the query requires a more complex set of conditions.

Nested filters mean there is a priority set to a group of conditions while the other group or groups are set with a different priority.

The most basic rule is that the AND operation is prioritized before the OR operation.

Nesting filters allow us to ask more complex questions but implement them easily with the drag-and-drop method.

Getting ready

We are required to set these conditions in the query: retrieve the sales revenue for USA for the car maker Leep (there is an AND relation between the first two conditions) OR retrieve Model Colours that equal BLACK.

How to do it...

We will create the three conditions by dragging-and-dropping the relevant objects from the universe structure to the Query Filters pane:

  1. In order to create a nested filter between the first and the second filter, we will drag-and-drop the Country filter on the Maker filter, as shown in the following screenshot:

  2. The result will...

Using a subquery


A subquery is a querying technique designed for more complex business questions that require us to analyze them further and additional information based on the data retrieved.

The subquery technique is used to return data that will be used by the main query. For example, we want to generate a better analysis for the sales team and understand which types of cars were bought by the same client.

The goal of this business question is to investigate whether a specific combination of car types are being bought by clients: did clients who bought Austin Martini cars buy other types of cars as well?

By analyzing this data, we will be able to make better marketing and sales offers to the customers as well as get some basic information about sales trends and customer behavior.

Getting ready

We want to analyze the client's car sales combinations; we will drag the Client Name, Maker, and Sales Revenue objects.

Here comes the catch. Creating a query filter based on the model object with the...

Using combined queries


Combined queries are a form of advanced querying technique that uses several queries for comparison in order to return a single dataset.

Using combined queries enables us to retrieve results from more than one query into a single table by comparing the rows of each query while a subquery compares a single object result.

Combined queries can use the following operators:

  • Union: This will include the rows from both queries (this is also the default operator and is similar to the OR operator between query filters)

  • Intersection: This includes the rows that are common to both queries (just like the AND operator between query filters)

  • Minus: This includes the rows from the first query minus the rows from the second query

When building combined queries, the order, data type, and number of result objects has to be the same; however, there is no limitation to the number of query filters.

Getting ready

We are required to use the Island Resorts Marketing universe this time as our data...

Adding another query


Building several queries in the Query Panel is a core functionality of Web Intelligence.

The ability to centralize several data aspects in the same report is considered in many ways the heart of reporting and analysis.

There are many scenarios where we would be required to build more than one query; the main reasons are presented as follows:

  • The report needs to present different queries with different filters that can't be unified into one query (will create contradiction in the filters)

  • There are also several contexts in the universe that require separation between the queries

    Note

    Contexts are structures that can be created in universes when a business question can be asked in several different contexts. For example, in the Motors universe, we can analyze the customer data in the sales context (who bought a car) and we can analyze the customer data in the rental context (which customer rented a car).

    Contexts are also created when there are data areas in the universe that...

Working with several queries


When working with several queries, it is recommended to work with conventions.

First of all, we would like to give a meaningful name to each query. This is important for several reasons, as follows:

  • When the report consumes several queries, it is easier to know which query should be edited.

  • Reports travel through time and users. They are changed over time and can lose track of their initial purpose. Working with conventions will keep the report as clear as possible.

  • Theoretically, when running a report that is a combination of several queries, one or more queries can fail to retrieve results. By giving each query a name, it would be easier to identify which query is the problematic one. This is why it is recommended to not give generic names such as query 1, query 2, and so on.

How to do it...

We will be able to edit the query by right-clicking on the Query tab, as shown in the following screenshot:

The Rename query pane will pop up and we will be able to give the query...

Working with the query properties


We can also manage query properties by navigating to the query options located on the Query Panel.

Getting ready

We want to edit the query properties as well as discover the available options.

How to do it...

In the main Query Panel toolbar, we will click on the query properties button located to the right of the combined query icon, as shown in the following screenshot:

The Query Properties panel will appear, enabling us to change the query properties, as shown:

We can find the following options in this panel:

  • Name: This is similar to the previous recipe's discussion.

  • Universe This is the query source name.

  • Limits: Using this, the number of rows in the query and the maximum retrieval time(s) can be limited; these limits can't exceed the universe definitions.

    This feature is mainly good for QA purposes and when we want to quickly apply formatting on a small amount of data while keeping the running time as short as possible. This option can't override the universe...

Using the data preview


The data preview is a useful option in the Query Panel when we want to get a preview of the data; that is, see the raw data before it gets fetched and formatted in the table.

This option is great for getting a "sense" of the data, if the values we expect to be returned are actually these.

This feature can also be useful when we want to make sure a specific value was returned by the query but isn't shown in the report results for some reason, for example, a local report filter.

Getting ready

We want to get the data preview before we run the report and get the results.

How to do it...

We will click on the Refresh option located to the upper-right corner of the Data Preview window.

Now, we will be able to see that this pane is populated with the row data, as shown in the following screenshot:

How it works...

Data preview is another feature in the Query Panel that we can use to our benefit. Seeing the row data before it's formatted, filtered, and so on in the report level can be...

Left arrow icon Right arrow icon

Description

If you are a business analyst, BI developer, or an IT professional who wants to learn the A to Z of how to work with Web Intelligence reporting tools and different types of data, then this book is for you. The only thing you need is a basic understanding of what Business Intelligence is and data concepts.

What you will learn

  • Master advanced report building techniques using SAP BusinessObjects
  • Discover tools to work efficiently in a BI environment
  • Learn using real scenarios, varied examples, and systematic execution of the solutions
  • Build variables and formulas to enhance the report calculation functionality such as ifthen statements
  • Use drilldown and drillthrough tasks to perform detailed analysis
  • Filter data using simple and advanced filters and advanced features such as input controls

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 26, 2014
Length: 380 pages
Edition : 1st
Language : English
ISBN-13 : 9781782172444
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Aug 26, 2014
Length: 380 pages
Edition : 1st
Language : English
ISBN-13 : 9781782172444
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 133.97
SAP BusinessObjects Dashboards 4.1 Cookbook
€41.99
SAP BusinessObjects Reporting Cookbook
€45.99
Creating Universes with SAP BusinessObjects
€45.99
Total 133.97 Stars icon
Banner background image

Table of Contents

15 Chapters
1. Working with the BI Launch Pad Chevron down icon Chevron up icon
2. Creating New Queries Chevron down icon Chevron up icon
3. Working Inside the Report Chevron down icon Chevron up icon
4. Working with Tables Chevron down icon Chevron up icon
5. Working with Charts Chevron down icon Chevron up icon
6. Formatting Reports Chevron down icon Chevron up icon
7. Filtering the Report Data Chevron down icon Chevron up icon
8. Merging Data Chevron down icon Chevron up icon
9. Using Formulas and Variables Chevron down icon Chevron up icon
10. Using Hyperlinks Chevron down icon Chevron up icon
11. Using Drill Chevron down icon Chevron up icon
12. Scheduling Reports Chevron down icon Chevron up icon
13. Working with BI Workspaces Chevron down icon Chevron up icon
14. Web Intelligence Rich Client Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(9 Ratings)
5 star 77.8%
4 star 11.1%
3 star 0%
2 star 0%
1 star 11.1%
Filter icon Filter
Top Reviews

Filter reviews by




KElyse Dec 13, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Perfect even for someone that has a little experience.
Amazon Verified review Amazon
Ritam Das May 01, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Learning the SAP BO Reporting. I can recommend this book
Amazon Verified review Amazon
AS Jan 18, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I love this book because it puts a strong focus on SAP BusinessObjects Web Intelligence. And let's be honest, Web Intelligence is the swiss army knife of the SAP BI Platform reporting package. That being the case, there aren't that many books out there that go into depths with Web Intelligence, but this one does. There are over 80 recipes for calculations and formulas that can be done with SAP Web Intelligence. This is a step-by-step book and can be put into action right away. Make this book part of your collection right away.
Amazon Verified review Amazon
Demik Oct 05, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very informative book. Arrived on time and in great condition.
Amazon Verified review Amazon
Faisal Zeeshan Sep 25, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Love this book, Yoav covered all the aspects in detailed with clear explanations. PACKT publishing books are generally great, this book is excellent.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.