Show TOC

Defining QueriesLocate this document in the navigation structure

You define a query in order to analyze the dataset of the SAP Business Warehouse and to build planning applications based on this query.

Prerequisites

You have created a BW project in the BW Modeling perspective and connected it with a BW back end system.

Context

The main parts of the query definition are navigation and filters:

  • For navigation, you select free characteristics and define the content of the rows and columns in the query. You use this selection to specify which data areas of the InfoProvider you want to navigate through. The alignment of row and column content determines the initial view for the query.

  • The selections in the filter apply to the query in its entirety. When defining the filter, you select characteristic values from one or more characteristics. You can also set a key figure as a filter. If you do this, the query only has characteristics in the rows and columns. All the InfoProvider data is aggregated using the filter selection for the query.

You can parameterize queries by using variables for characteristic values, hierarchies, hierarchy nodes, formulas and texts, or by defining new variables where necessary.

To make the selection of InfoObjects more precise, you have the following possibilities:

  • You can restrict characteristics to characteristic values or hierarchy nodes.

  • You can define selections.

  • You can define formulas.

  • You can define Exception Cells and Help Cells.

  • You can use local structures.

  • You can define conditions.

  • You can define exceptions.

  • You can define calculated and restricted key figures as reusable query components.

Procedure

  1. In the Project Explorer view, you can create a query either for a BW project or for an InfoProvider. You can also create a query as a copy of an existing query.
    1. To do this, open the context menu for a BW project or an InfoProvider and choose Start of the navigation path New Next navigation step BW Query End of the navigation path, or open the context menu for the query you want to use as a template and choose Start of the navigation path Copy To ... End of the navigation path. The New BW Query dialog box appears. Depending on your point of entry, the system will have already preselected certain objects.
    2. The system preselects the current BW project at the very least. By choosing Browse, you have the option of selecting a different BW project.
    3. If you have created a query for a BW project, you also have to select the required InfoProvider. Enter its technical name or a corresponding search term instead. The system helps you when searching for the technical name, and returns a list of results under Matching items.
    4. If you have created a query for an InfoProvider, the system preselects this InfoProvider. By choosing Browse, you have the option of selecting a different InfoProvider.
    5. To add your query to your local favourites, choose Add to Favorites.
    6. Enter a unique technical name and a description for your query.
    7. If you have created a query as a copy of an existing query, the system preselects this query. By choosing Browse, you have the option of selecting a query as the template.
    8. Choose Finish.
    The system opens the new query in the Eclipse Editor. The General tab opens, together with all query settings that you have made so far.
  2. Choose the Sheet Definition tab.
  3. Press the Show InfoProvider View button.
    The available objects for the InfoProvider you selected are displayed as a directory tree in the InfoProvider view:
    • Key Figures
    • Characteristics
    • Reusuable objects Reusable Components): Calculated Key Figures, Restricted Key Figures, filters and structures.
    Note

    You can drag the InfoProvider View to another location of your choosing.

  4. Specify which characteristics, key figures, or structures you want to be available for navigating through the query data.
    1. In the BW Repository, choose the required characteristics and drag them to the relevant part of the query:
    2. Define the required selections - with and without key figures.

    If you select an InfoObject, you can view and edit its properties on the right of the Sheet Definition tab.

  5. Define the required formulas, conditions and exceptions.

Results

To view the query in the preview, choose Start of the navigation path File Next navigation step Refresh End of the navigation path and then Show Preview.

Next Steps

Define any filters, conditions and exceptions that you require, and then save your query definition.