SAP BusinessObjects Reporting Cookbook
上QQ阅读APP看书,第一时间看更新

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 a meaningful name, as shown:

Now that both of the queries have a meaningful name, it will be much more organized and it will be easy to work with several queries.

There's more...

Besides renaming, there are several additional actions that can be performed as well:

  • Move: The query can be moved left or right. When working with several queries, it can be useful to order them according to the data subjects.
  • Duplicate: This option duplicates the query and is extremely helpful when we are building several queries that are similar to each other.
  • Delete: When a query is no longer required, it can be deleted.

    Note

    Note that there is no undo option for this action or for the other actions in the Query panel.

If we want to monitor all the query statistics, we should use the Data view in the report level. Here, we can see all the queries and their basic statistics such as duration, number of rows retrieved, and so on:

This panel is very important because it enables us to get all the query statistics in one place as well as manage them by right-clicking on one of the query names.

By double-clicking on the query name, we will switch to raw data display, which is similar to the preview pane in the Query Panel.

See also

  • For more on how to manage each query property, refer to the next recipe, Working with the query properties