You are on page 1of 64

November 2003 Version 1.

Table of Contents
1. 2. INTRODUCTION ............................................................................................................................... 1 STARTING BEX QUERY DESIGNER ............................................................................................ 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3. BEX QUERY DESIGNER FUNCTIONS............................................................................................... 2 INFOPROVIDER IN THE QUERY DESIGNER ...................................................................................... 4 CREATING A QUERY ...................................................................................................................... 5 SEARCHING FOR A QUERY ............................................................................................................ 7 CHANGING A QUERY ..................................................................................................................... 7 DATA FILTERS IN QUERY DEFINITION ........................................................................................... 8 INSERTING TEXT ELEMENTS IN BEX ANALYZER REPORTS ...........................................................10

RESTRICTED AND CALCULATED KEY FIGURES ..................................................................12 3.1 3.2 3.3 3.4 3.5 3.6 DEFINING RESTRICTED KEY FIGURES ...........................................................................................12 SELECTION CONDITIONS FOR THE SELECTION OF FILTER VALUES ................................................16 FORMULATING SELECTION CONDITIONS.......................................................................................17 CALCULATED KEY FIGURES .........................................................................................................20 BOOLEAN OPERATORS ..................................................................................................................26 PROPERTIES OF KEY FIGURES .......................................................................................................27

4.

CHARACTERISTICS........................................................................................................................29 4.1 4.2 CHARACTERISTICS PROPERTIES ....................................................................................................29 ATTRIBUTES .................................................................................................................................30

5.

HIERARCHIES ..................................................................................................................................31 5.1 5.2 5.3 HIERARCHICAL POSITION OF CHARACTERISTICS AND KEY FIGURES ............................................31 SELECTING EXTERNAL HIERARCHIES ...........................................................................................31 INCLUDING HIERARCHIES IN REPORTS ..........................................................................................32

6.

VARIABLES .......................................................................................................................................35 6.1 6.2 6.3 6.4 6.5 6.6 6.7 CHARACTERISTIC VALUE VARIABLES ..........................................................................................35 TEXT VARIABLES..........................................................................................................................38 FORMULA VARIABLES ..................................................................................................................39 VARIABLE PROCESSING TYPES .....................................................................................................39 CREATING VARIABLES..................................................................................................................40 CHANGING VARIABLES IN THE VARIABLE EDITOR .......................................................................45 USING THE VARIABLE OFFSET ......................................................................................................47

______________________________________________________________________________ Page i

7.

QUERY DEFINITION PROPERTIES ............................................................................................48 7.1 7.2 7.3 QUERY PROPERTIES ......................................................................................................................48 QUERY WHERE-USED LIST ...........................................................................................................52 DELETING QUERY OBJECTS ..........................................................................................................52

8.

EXCEPTIONS ....................................................................................................................................53 8.1 8.2 CREATING EXCEPTIONS ................................................................................................................53 CHANGING AND DELETING EXCEPTIONS ......................................................................................56

9.

CONDITIONS.....................................................................................................................................58 9.1 9.2 DEFINING CONDITIONS .................................................................................................................58 CHANGING AND DELETING CONDITIONS ......................................................................................61

______________________________________________________________________________ Page ii

Introduction

1. Introduction
The purpose of this document is to provide analysts with a guide to the functions available in the BEx Query Designer tool. Please refer to the Business Warehouse End-User Reporting V1.0 document for more information on the basic navigational functions within the BEx Analyzer. The primary tools available in SAP BW for reporting are the BEx Browser, BEx Analyzer and the BEx Query Designer. The BEx Browser organizes the reports available to the user in folders based on their roles in the organization. Once a report has been located it is then executed in the BEx Analyzer, which is an add-in to MS Excel. The reports are composed of at least one query which can be executed in a web browser in addition to the BEx Analyzer. The queries are created using BEx Query Designer. When a query definition is executed, the subset of data needed by the query is selected from the InfoCube. This subset of data is known as the Query Cache or Query Cube and is created in memory for performance reasons. As the analysis is carried out, different views of the data from the Query Cube are supplied to the reporting tool as requested by the user. These views represent different drilldowns, filter selections, and so forth. The following sections describe the different features and functionalities available within the BEx Query Designer for creating analysis queries.

______________________________________________________________________________ Page 1

Starting BEx Query Designer

2. Starting BEx Query Designer


2.1 BEx Query Designer Functions

The following diagram shows the functions available within the BEx Query Designer. The individual functions are explained below.

Quit and Use Query Exit the Query Designer to use the defined query Exit Query Leave the Query Designer Display Query on the Web Displays the defined query in a standard view on the web New Query Creates a new query by starting the BEx Open dialog Open Query Opens the BEx Open dialog to access existing queries from History, Favorites, or Roles listings Save Query Stores a modified query under the same current technical name. If the query has not been given a technical name, then the system automatically prompts for a technical name and description before saving the query definition. Save Query As Saves a query under a new technical name. The query can be saved into Favorites or the Roles folder. Delete Query Deletes a query. The query may be deleted only if it is not used in working folders, Web Templates, Crystal Reports or Reporting Agent settings. Exception Defines a query exception. Exceptions are defined for key figure values, which are color coded in the query results. Clicking on the small arrow beside the exception symbol allows changes to exceptions and / or define new exceptions. Condition Allows selection of data based on key figure value limits, e.g. all turnover figures under or over a specified limit value. In the query the selected characteristics with filtered or limited key figure values are indicated. Clicking on the small arrow beside the condition symbol allows changes to conditions and / or define new conditions. Define Cells Defines explicit formulas and selection conditions for cells. This overrides the values of cells which result at the junction of the root elements, making it ______________________________________________________________________________ Page 2

Starting BEx Query Designer possible to assign special values to individual cells. This function is available only for queries with two key figure structures defined. Query Properties Changes the description of the query or make changes to the format of results, various indicator options, number representation and zero suppression. Check Query Checks the Query definition for errors before saving a new or changed query. Query Where-Used List Determines in which objects (working folder, Web Template, Crystal Report or report agent settings) this query is used. Query Display <> Change Switches between Display Mode and Change Mode Change Query (Global Definition) Switches to the Global Definition from the Local Query Definition mode. Table Display Switches a query between OLAP reporting and tabular reporting. It can only be used in queries containing one key figure structure. Queries with two structures can only be shown using OLAP reporting. Technical Name Turns the display of the query components technical names on and off. Context Menu Makes possible the display of the context menus without using the right mouse button (e.g. for use with a touch screen display). Help Displays the online documentation of Business Information Warehouse with the Business Explorer section.

______________________________________________________________________________ Page 3

Starting BEx Query Designer

2.2

InfoProvider in the Query Designer

InfoProviders are objects for which SAP BW queries can be created. Objects include InfoCubes, ODS Objects and InfoObjects (characteristics with attributes or texts). 1. InfoCubes An InfoCube is the central analysis object for reports against aggregated (consolidated) data. An InfoCube is defined (from a reporting viewpoint) as a closed volume of data e.g. an independent set of data that is time specific. This volume of data can be evaluated with BEx query. 2. ODS Object The ODS object contains consolidated and cleansed data on a detailed (atomic level). For reporting purposes, the ODS object can provide information at the individual transaction document level. ODS objects are available both for transaction data and for master data. The data can be evaluated with BEx query. 3. Characteristic InfoObject Characteristic InfoObjects can have tables into which the master data information (attributes, text, hierarchies) from the source systems are loaded. 4. MultiProvider A MultiProvider unites data from several InfoProviders and makes it available for reporting. The MultiProvider contains no data itself. The data comes exclusively from the underlying InfoProviders. It can consist of arbitrary combinations of InfoProviders. 5. InfoCube Elements According to its multi-dimensional structure key figures are defined in an InfoCube, and are accessible from their own folder in the Query Designer. Characteristics are found grouped in their associated Dimensions.

A characteristic will have further entries in the selection tree for compounding information if the characteristic is compounded with another characteristic. From the listings for Attributes, Characteristic Value Variables and drag other elements into the query definition. Values, you can

______________________________________________________________________________ Page 4

Starting BEx Query Designer

2.3

Creating A Query
to define a new query in Query Designer.

1. Select New Query

2. In the dialog window New Query: Select InfoProvider select the desired InfoProvider. 3. After selecting the InfoProvider, the Query Designer is displayed with the selected InfoProvider.

______________________________________________________________________________ Page 5

Starting BEx Query Designer

C A

4. The Query Designer is arranged into six windows: A Content tree of the selected InfoProvider. After selecting the desired InfoProvider, all available objects (dimensions, key figures, structures) are represented as a tree structure in the left column of the Query Designer. B Defines the Columns of the report C Defines the Rows of the report. D Free Characteristics are characteristics that are not included in the initial display of query results. These characteristics can be integrated into the query results by using interactive navigation functions. They can also be used for selection by filter values in the report. E The characteristics placed in the filter window do not appear in the initial view or in the navigational area of the query results. They serve as global filters used exclusively for filtering the data from the InfoProvider. F Preview shows a preview of the query result format. 5. After a query has been defined, the definition can be saved with either Save Query or

Save Query As buttons on the toolbar. If you have not already saved the query definition, you are prompted to supply the query description and a unique technical name. In addition, you can select the storage area (Roles, Favorites). With existing query under another name. Save Query As you can save an

6. You can execute a query immediately by selecting Quit and Use Query. If you did not save the query before yet, you are prompted for the query description and technical name.

______________________________________________________________________________ Page 6

Starting BEx Query Designer 7. After you have saved the query, you can: Execute the query using the BEx Analyzer by selecting Quit and Use Query

View the query result in a standard view using a Web browser by selecting Display Query on the Web Use the query as a Data Provider for Web items in the Web Application Designer Use the tabular representation as data source for formatted reports in Crystal Report

2.4

Searching For A Query


Search button to search for a specific

1. On the Select Query dialog box, click on the query.

2. Enter the technical name or the description of the query in the dialog Search for Queries. When you use the Search Function: If you are in the BEx Analyzer and while in the dialogue Select Query the search function is called, the query result is represented as a BEx Analyzer report. If you call the search function from the Query Designer, the query definition of the query you searched for is shown.

2.5

Changing A Query

Different options are available to change a query: 1. If you execute the Query Designer, you may select a query in the dialogue SAP BEx Query: Select Query. You can select a query based on the technical name or the description of the

______________________________________________________________________________ Page 7

Starting BEx Query Designer query. In addition, the Queries are listed by InfoArea under the respective InfoProvider, to which the query was defined. 2. In order to change the query definition from the BEx Analyzer, two possibilities are available: Select Change Query (Global Definition) Select Change Query (Local View) The changes only affects the current display of the query results and do not alter the query definition.

2.6

Data Filters In Query Definition

Limiting selections of a characteristic can be done anywhere the characteristic is used in the query definition. There are two ways to limit the selections of characteristic values: 1. By choosing a characteristic of the InfoProvider (in the tree structure shown on the left column of the Query Designer screen) and double clicking the values symbol, you will access the selection menu for fixed values. There you can select individual values or a range of values. The selected fixed values will then appear in the tree structure under the characteristic and can be dragged and dropped into the query definition.

Select individual or range of values from Value List

______________________________________________________________________________ Page 8

Starting BEx Query Designer 2. A characteristic that is already in the query definition can be restricted as well. Right click on the characteristic to call the context menu and select Restrict. You will be prompted with the selection dialogue for the characteristic.

3. In the left window are all available characteristic values that can be selected, while in the right window are the selected characteristic values for limiting the characteristic. To select the characteristic, mark the appropriate values in the left part of the selection window. The lower left part of the selection window allows search for certain characteristic values with either the description or the technical name. The found values are then marked automatically.
Selection of Individual or Range of Values Definition of Value Range Value selection by Drag&Drop or selection of the marked values with the help of the arrow icons Multiple selection with CTRL + left mouse button

Search by technical name and/or description

Process the selected values

______________________________________________________________________________ Page 9

Starting BEx Query Designer You can either drag the selected value to the right side window or click on the arrow icon. Restrictions on characteristics in the Free Characteristics area still affect the query results, even if the free characteristic is not being used. Characteristics in the global filter do not appear in the initial view of the query results or as free characteristics. Restrictions placed on characteristics in the Filter area cannot be changed or navigated on in the analysis. They serve exclusively to filter the data from the InfoProvider.

2.7

Inserting Text Elements in BEx Analyzer Reports

An option is available to insert different text elements into the query results (e.g. author, last change date, InfoProvider, generation time, etc) to add additional information. These text elements are called header information of the query. To insert text elements: 1. Choose Layout in BEx Analyzer and Display text elements

2. You can choose to either display All text elements or General, Filter, or Variables text elements. 3. Description of Text Elements Author The user who defined the query originally Last Changed by User who last changed the query definition. Navigation steps are not logged as a change of the definition. Query Technical Name Technical name of the query, assigned when the query was first saved. Key date The key date is the date for which time-dependent master data are selected. The key date is specified either in the query definition (Query characteristics) or ______________________________________________________________________________ Page 10

Starting BEx Query Designer supplied by a variable. If no key date is specified, the system date becomes the key date automatically. Changed at Indicates the date and time when the query definition was last changed. Status of Data The date and time on which the last data requests from the InfoProvider were booked that can be evaluated for reporting. Current User The user who has currently opened this query or inserted it into a working folder. Last refreshed The time when the data of the query was last refreshed. Variables, Filters, Conditions, Exceptions Further text elements can be displayed as a function of variables, filter values, conditions and exceptions

______________________________________________________________________________ Page 11

Restricted And Calculated Key Figures

3. Restricted And Calculated Key Figures


Restricted key figures are (basic) key figures in the InfoProvider that are restricted (filtered) by one or more characteristic selections. The key figure that is restricted by one or more characteristic selections can be a basic key figure, a calculated key figure, or a key figure that is already restricted. Using restricted key figures allows focusing the query result on certain values. Unlike a filter, whose restrictions are valid for the entire query, in the case of a restricted key figure, only the key figure in question is restricted to its allocated characteristic value or characteristic value interval.

3.1

Defining Restricted Key Figures

Restricted Key Figures can be created at InfoProvider level, or locally in the query definition. Restricted Key Figures that are defined at the InfoProvider level are available in every query definition of the InfoProvider. To define a restricted key figure at the InfoProvider level: 1. From the Query Designer choose Restricted Key Figure in the context menu on the left-hand side under Key Figure.

Select Restricted Key Figure

______________________________________________________________________________ Page 12

Restricted And Calculated Key Figures 2. Enter a technical name in the dialog box, and confirm the entry by choosing OK. The newly defined key figure can be found in the Restricted Key Figures directory.

3. To define a restricted key figure at query level, use Drag&Drop to drag the key figure to be restricted into a Query Designer directory. In the context menu, choose Edit, or select the title of the Rows or Columns directories and use the right mouse button to choose New Structure. Select the structure directory and use the right mouse button to choose New Selection from the context menu.

______________________________________________________________________________ Page 13

Restricted And Calculated Key Figures 4. The New Selection dialog box displays.

Key Figure to be restricted Open Quantity to be restricted by Calendar Year/Month

Enter a description of the restricted key figure into the text field. Use Drag&Drop to choose the key figure of the InfoProvider, and place it on the right-hand side of the Selection window. Use Drag&Drop to move the characteristic whose characteristic value you want to use to restrict the key figure to the right-hand side of the Selection window.

______________________________________________________________________________ Page 14

Restricted And Calculated Key Figures 5. From the context menu of the characteristic, choose Restrict.

6. Select the characteristic values you require for the restriction.

7. Confirm the entries by choosing OK.

______________________________________________________________________________ Page 15

Restricted And Calculated Key Figures

3.2

Selection Conditions for the Selection of Filter Values

1. When defining a restricted key figure, the restricting characteristics, individual characteristic values, value ranges, hierarchy nodes, or characteristic variables are selected. 2. When selecting value ranges, the following operations are available: Between Greater than or equal to Less than or equal to Greater than Less than

3. Including values in the selection or excluding values from the selection can be defined by selecting these options in the context menu of the relevant filter value.

______________________________________________________________________________ Page 16

Restricted And Calculated Key Figures

3.3

Formulating Selection Conditions

1. You can select individual values and value ranges from a list or from a selected hierarchy in the selection dialog box. The values available in the left-hand window are restricted to 100 values. The following are the instructions to list only characteristic values that match your specific criteria to be offered in the selection dialog. 2. After you have selected a characteristic for which you want to use characteristic values for restriction, choose the pushbutton with the yellow arrow in the bottom left-hand corner (Display Other Value). You can formulate selection conditions here, and deactivate the restrictions to 100 values.

Use Display Other Values

______________________________________________________________________________ Page 17

Restricted And Calculated Key Figures 3. The Selection Condition dialog box displays.

Restrict by Cal. year/month

Operator selection

Value Selection Help

If you set the Number of Displayed Values to (All), and there are a large number of characteristic values, this may cause a long wait when selecting values. 4. In the Restriction(s) window on the left-hand side, choose the attribute to use to restrict the selection. 5. Choose the required operator Equal to Greater than or equal to Less than or equal to Greater than Less than Between Contains Pattern 6. Enter a characteristic value. Choose the pushbutton with the three periods to use the value selection help function.

______________________________________________________________________________ Page 18

Restricted And Calculated Key Figures 7. To select the restriction, choose the arrow pointing to the right. The dialog box remains open so further restrictions can be added to the selection condition.

8. Choose OK. The list of available values in the left-hand window of the selection dialog box is now restricted according to the formulated selection condition.

______________________________________________________________________________ Page 19

Restricted And Calculated Key Figures

3.4

Calculated Key Figures

In the Query Designer, formulae can be used to calculate key figures that are not in the Info Provider by using basic key figures, restricted key figures, and already calculated key figures in the formula definition.

3.4.1 Percentage Functions


1. Percentage Variance (%) <Operand1> % <Operand2> Gives the percentage variance Operand1 from Operand2 Example Planned Sales Volume % Actual Sales Volume gives the percentage by which the actual sales volume exceeds the planned sales volume. 2. Percentage Share (%A) <Operand1> %A <Operand2> Gives the percentage share of Operand1 from Operand2 Example Sales Volume %A Incoming Orders specifies how high the percentage share of sales volume is made up of incoming orders. 3. Percentage Share of Result (%SR) %CT<Operand> Specifies how high the percentage share is in relation to the result. The result means the result of aggregation at the next level (interim result) Example %SR Incoming Orders specifies how high the share of the incoming orders values of each individual characteristic value (for example of each customer) is, in relation to the characteristics result (for example, customer of a division) 4. Percentage Share of Overall Result (%OR) %OR <Operand> Specifies how high the percentage share is in relation to the overall result. The overall result means the result of aggregation at the next level in the list. In the calculation of the overall result, the dynamic filters (filters that were not already defined in the Query Designer) are included.

______________________________________________________________________________ Page 20

Restricted And Calculated Key Figures

3.4.2 Data Functions


1. Counts Count (<Expression>) Delivers the value 1 for each occurrence of <Expression> 2. NDIV0(x): Is equal to 0 with division by 0, otherwise x NDIV(<Expression>) Delivers 0 if the expression named in <Expression> gives a division by 0 in the calculation. Otherwise the result is the value of the expression. 3. Result SUMCT <Operand> Delivers the result of the operand in all rows or columns 4. Overall Result SUMGT<Operand> Delivers the overall result of the operand 5. Report Result SUMRT<Operand> Delivers the report result of the operand (to distinguish between the overall and the report result)

3.4.3 Mathematical Functions


Mathematical functions include: Maximum Minimum Absolute Value Smallest integer value larger than operand Division (integers)

______________________________________________________________________________ Page 21

Restricted And Calculated Key Figures

3.4.4 Defining Calculated Key Figures


New Calculated Key Figures can be defined by using all basic key figures as well as newly defined restricted and calculated key figures, both at the query and the Info Provider level. At the query level, the calculated key figure is only valid for the query in question. If the Calculated Key Figure is created at the Info Provider level, it can be used in all queries that are based on the Info Provider level. Defining Calculated Key Figures at the Info Provider Level 1. Select the Key Figure directory, and in the context menu, choose New Calculated Key Figure.

2. Enter a description of the calculated key figure into the text field.

______________________________________________________________________________ Page 22

Restricted And Calculated Key Figures

Validate Syntax in Formula Definition

3. Define the required formula using available basic key figures, restricted key figures, formula operators, and functions. 4. Choose Formula Syntax Check to validate the formula definition. 5. Choose OK. In the Properties of the Calculated Key Figure dialog box, assign a technical name, and choose OK.

6. The new calculated key figure is available under Calculated Key Figure, and can be included in the definition using Drag&Drop. ______________________________________________________________________________ Page 23

Restricted And Calculated Key Figures

Defining Calculated Key Figures at the Query Level 1. Include Key Figures needed for the calculation in the definition, and choose New Formula in the context menu of the Key Figure directory.

2. The New Formula dialog box displays for entering Calculated Key Figure definition. These formulas are only available locally in this query definition.

______________________________________________________________________________ Page 24

Restricted And Calculated Key Figures

______________________________________________________________________________ Page 25

Restricted And Calculated Key Figures

3.5

Boolean Operators

Boolean operators constitute a particular example of functions that are available as operators when defining a calculated key figure. Boolean operators enable comparisons within formulas. The following operators are available: Is less than < Is not equal to <> Is greater than > Is less than or equal to <= Is equal to = Is greater than or equal to >= Logical NOT, AND, OR, and logical Exclusive OR XOR

Example IF Revenue > 100000 THEN Revenue X 5% ELSE Revenue X 2%

______________________________________________________________________________ Page 26

Restricted And Calculated Key Figures

3.6

Properties of Key Figures

1. Select Properties from the context menu for the key figure for which you want to define properties.

2. The Properties of the Selection/Formula dialog screen displays.

______________________________________________________________________________ Page 27

Restricted And Calculated Key Figures Description The description for the key figure. The total length of all characters in all line including the line break is limited to 60 characters. Display The key figure can be selected to be highlighted in the report. The key figures can also be hidden if its defined for only calculating formulas, and need not be displayed in the analysis. Marking Selection as Constant makes the selection no longer available for change by navigation and filter at runtime. Number Display Set the scaling factor in the Number Format area and define the number of decimal places and reverse the + / - signs. The reverse + / - signs is only a display function and has no influence on calculation in formulas. Calculations Recalculate result rows and individual values that are displayed in the version according to particular criteria. Currency Translation Set a currency conversion key and a target currency.

______________________________________________________________________________ Page 28

Characteristics

4. Characteristics
4.1 Characteristics Properties

In the Characteristics Properties dialog box, you can make settings for a range of functions that affect the key figures for this characteristic in the query drilldown.

You can define the following properties for characteristics: Description The text description can be changed for display in the query. Display As Determines the form in which the characteristic values are displayed, as long as they were created in the InfoObject maintenance for the characteristic: No Display Key and Name Name and Key Name Key Long or Medium Name Display of Results Suppress Results Rows You can structure the appearance of the report by using this function to determine whether the results rows are displayed Always, Never, or With Only One Value ______________________________________________________________________________ Page 29

Characteristics Normalize to You can use this function to normalize key figure values to a specific characteristic. When values are normalized, the key figures are displayed as a percentage in relation to the chosen result. The Query Result, Overall Result or Result (interim results) can be selected as the reference value. The characteristic is normalized only if it is in the drilldown. Cumulative This function aggregates the values of the characteristic values (the nth value is aggregated with the n+1 value) Sorting You can make settings for sorting within the characteristic. You can use the following: The characteristic itself, sorted by key or name, All attributes of the characteristic, sorted by Key or Name The sort sequence is either Ascending or Descending. You cannot use the attributed that you have selected for sorting in the display. Display Hierarchy You can display the characteristic hierarchically.

4.2

Attributes

Characteristics can be described in more detail through attributes. For example, you can assign the attribute Country to the characteristic Company Code to display the country of the company code. Attributes can be maintained as Display Attributes or Navigation Attributes. Display Attributes can be shown in a report in the drilldown. However, navigation steps are not possible. To include a Display Attribute in the drilldown, open the index for the characteristic. Once in the Attributes index, drag the required attribute into the query definition. To select a display attribute of a characteristic that is already in the query definition, from the context menu of the characteristic, choose Attributes. In the Attribute Properties for a specific attribute for a characteristic, you can set the display functions as key, name, and so on. You can use Navigation Attributes for defining queries in a report in the same way as characteristics. They are displayed in the dimension of the characteristic to which they belong. In order to use an attribute as a navigation attribute, note the following: 1. The attribute has to be flagged as navigation attribute in the InfoObject maintenance of the characteristic 2. The attribute has to be selected from the list of possible navigation attributes in the InfoObject maintenance.

______________________________________________________________________________ Page 30

Hierarchies

5. Hierarchies
There are two options for hierarchical displays in reports: 1. Display the characteristics included in the query definition as a hierarchy 2. Select an external hierarchy as a display hierarchy for a characteristic in the query definition

5.1

Hierarchical Position of Characteristics and Key Figures

Characteristics and Key Figures can be displayed in the rows and in the columns as hierarchies by selecting Display As Hierarchy from the context menu of the row or column header.

5.2

Selecting External Hierarchies

1. You create hierarchies for basic characteristics, for example, Product. 2. They are saved in special master data tables. They behave like master data and therefore, they can be used and modified in all InfoCubes. 3. Several hierarchies can be defined for a characteristic. These hierarchies can then be selected from the display hierarchy. In order to make hierarchies available for a characteristic in BW, you can load characteristic hierarchies from a source system or create them in the Business Information Warehouse. The characteristic is determined to have a hierarchy in the InfoObject maintenance, where properties of the permitted hierarchies are defined.

______________________________________________________________________________ Page 31

Hierarchies

5.3

Including Hierarchies in Reports

1. From the context menu of the characteristic that the hierarchy is to be presented, choose Properties.

2. In the Properties dialog box, choose values from the Display Hierarchy section

Choose hierarchy values

______________________________________________________________________________ Page 32

Hierarchies 3. In the list of Available Hierarchies, select the required fixed hierarchy and choose OK.

4. Each hierarchy has the properties that were determined by the hierarchy definition.

You can override the following hierarchy properties in the query definition for a hierarchy: Sorting Within the hierarchy, the hierarchy values can be sorted in Descending or Ascending order by Key or Name. Expand to Level To determine the hierarchy level to which the hierarchy is expanded to in the report, in the U column (User Settings), put a check in the checkbox and enter the required numerical value. Position of Lower Level Nodes In the U column, put a mark in the checkbox and choose whether the sub-ordinate nodes are positioned above (Up) or below (Down) a super-ordinate node. Values of Posted Nodes In the U column, put a check in the checkbox and choose whether you want to Display or suppress the value of the posted nodes.

______________________________________________________________________________ Page 33

Hierarchies Nodes with Only One Lower-Level Node In the U column, put a check in the checkbox and choose whether you want to Display or Suppress nodes with only one lower level node.

______________________________________________________________________________ Page 34

Variables

6. Variables
Variables are query parameters that are defined in the Query Designer and that are filled with values only when the query is executed.

Variables act as placeholders for: Characteristic values Hierarchies Hierarchy node Texts Formula elements (calculated key values)

Variables are reusable objects. The variables defined in the Query Designer are available in all Info Providers for use in the query definition. Variables are not dependent on the Info Provider, but rather on the InfoObject for which they were created. Variables enable you to set queries more flexibly (query parameterization). When using variables in the Query Designer, you do not choose fixed characteristic values, hierarchies, hierarchy nodes, texts, or formula elements, but rather you set the variables for the placeholders. These are then filled with values at query runtime (when you insert the query into a workbook, when you refresh a workbook or when you launch the query on the Web). If you use variables, a query definition can then serve as the basis for many different queries.

6.1

Characteristic Value Variables

There are different variable types, depending on the object (for example, characteristic, formula) for which the variable is defined as a placeholder. When selecting characteristic values in the query definition, you can select variables instead of fixed values. These act as placeholders and are filled with values when you execute the query. You can use variables to select single values and value ranges.

______________________________________________________________________________ Page 35

Variables 1. Selecting Single Value Variables From the context menu of the characteristic, choose Restrict. The dialog box for selecting characteristic value appears.

2. Select the Variables tab page and transfer the required variables using Drag&Drop or the arrow button.

______________________________________________________________________________ Page 36

Variables 3. Selecting Single Value Variables as Variable Value Area Limits In the dialog box for selecting characteristic values, in the Selection field, choose Value Area and set the required operator (Between, Less than, Greater than, ).

Select the Variables tab page. When using the Between operator, you can restrict both limits using a single value variables or choose a single value variable for one of the interval limits and transfer a fixed value for the other interval limit on the Fixed Values tab page. When using the operators Greater than or equal to, Less than or equal to, Greater than, or Less than, from the list of available variables in the left window, highlight a variable and move this using Drag&Drop or the arrow button into the right Selection window. 4. Selecting Variables with Several Single Values or Value Ranges Depending on how they have been defined, you can not only select single values for variables, but also several single values, intervals, or selection options. Under Single Values select the relevant variable from the variables window and specify the values or interval limits when you execute the query.

______________________________________________________________________________ Page 37

Variables

6.2

Text Variables

Text variables represent a text. You can use text variables in query descriptions, calculated key figures and structural components. 1. To include an existing text variable, choose and search for the required text variable in the list of existing text variables. This appears with its technical name, enclosed by ampersands (&), in the description.

______________________________________________________________________________ Page 38

Variables

6.3

Formula Variables

Formula variables represent numerical values. You can use formula variables in formulas. Numerical values are also used for calculating exceptions and conditions. You can also use formula variables here.

Example To calculate commissions you use a formula variable with the Revenue unit in order to process the current threshold value for Commission calculation when you execute the query.

6.4

Variable Processing Types

The following processing types are available: 1. User Entry/Default Value If User Entry/Default Value is chosen as the processing type for a variable, you can enter the required value for the variable manually in a dialog box when you execute the query. You enter the default value when you create the variable. This default value is then displayed for input-enabled variables in the input field of the variable screen. For fields that are not input-enabled, the default value is used as the variable value. 2. Replacement Path The processing type Replacement Path enables you to specify the value that automatically replace the variable when the query or Web application is executed. ______________________________________________________________________________ Page 39

Variables For example, when you enter a variable as a characteristic value, you do not need to determine the text for the characteristic value straight away, but can let it be filled dynamically to match the characteristic that is used when the query is executed for the variable. 3. Customer Exit If necessary, you have the option of using a customer exit to set up a processing type for variables that is tailored specifically to your needs. The Customer Exit processing type for variables enables you to determine values for variables by means of a function module exit. 4. SAP Exit The SAP exit processing type is contained in variables that are delivered with SAP BW Business Content. 5. Authorization The Authorization processing type enables you to fill the variables automatically with the values from the authorization of a user. If you choose Authorization processing type when you create a variable, the variable is filled automatically with the values in the users authorization. When the user opens a query, the data selection is automatically carried out according to his or her authorizations.

6.5

Creating Variables

The Variable wizard takes you through a step-by-step process for defining a new variable. 1. To display the Variable Wizard, go to the Selection menu for the required field by doubleclicking on the selected field or selecting Restrict from the context menu. Click on the Variables tab.

Select Variables tab to display a list of available variables

Right-click to create New Variable

______________________________________________________________________________ Page 40

Variables 2. Right-Click for the New Variable selection.

3. The Variable Wizard displays.

______________________________________________________________________________ Page 41

Variables 4. Enter the variable name and description, and determine the variable type.

5. The Detail dialog box displays for all types of variables except for variables with replacement path processing type.

______________________________________________________________________________ Page 42

Variables Under Variable Represents, select the display area that the variable is to represent: Single Value The variable represents one value only. Multiple Single Values The variable represents a range of single values. Interval The variable represents a from-value to a to-value. Selection Option The variable represents a combination of single values and intervals of your choice. Pre-calculated Value Set The variable represents a set of values that are stored in a database table by the Reporting Agent.

6. Under Variable Entry, specify whether the variable input is Optional, Mandatory or Mandatory, Initial Value not Allowed.

______________________________________________________________________________ Page 43

Variables 7. Under Ready for input you can determine whether the variable is input-enabled when the query or Web application is executed. If the ready-for-input option is active (= default setting), the variables screen is offered when you execute the query or Web application. You can then enter the required values, confirm the default values, or change the default values. 8. The option Can be changed in query navigation enables you not only to select from values that you entered in the variables screen after you have executed the query, but also use other values as dynamic filters in the query. 9. Copy personalization data from the variable You can personalize variable values for inputenabled variables for each user. These personal values are saved for each variable and for each user. 10. When you define a variable, you enter one or more default values. These then appear in the variables screen when you execute the query.

______________________________________________________________________________ Page 44

Variables 11. Click Finish to save the variable definition.

6.6

Changing Variables in the Variable Editor

The variable editor uses a dialog box to give all of the selection options available for changing an existing variable. 1. Right-click on the variable to select Change Variable

______________________________________________________________________________ Page 45

Variables 2. The individual fields of the dialog box reflect the dialog steps in the variable wizard and show the current settings of the variable. The dialog box is context sensitive, which means that only the fields and options that are relevant for the variable are displayed, depending on the type of variable and the processing type.

______________________________________________________________________________ Page 46

Variables

6.7

Using the Variable Offset

To analyze key figures that have a fixed time-relationship to one another, you can use the variable offset. For example, you want to compare company revenue from the current time period with that of the same time period in the previous year. In your report definition, you can use the same variable several times to restrict the key figures and determine a difference from the input value. You can also use the variable offset to select an interval as a restriction with upper and lower limits that refer to the same variable. 1. On the Variables tab page, select the required variable and move this using Drag&Drop (or using the arrow key pointing to the right) into the right selection window. 2. Use the right mouse button, call the context menu and choose Specify Variable Offsets

3. In the Variable Offset dialog box, enter the required variable offset. When using value ranges, specify the variable offset for the upper and lower limits.

______________________________________________________________________________ Page 47

Query Definition Properties

7. Query Definition Properties


7.1 Query Properties

Default properties can be defined in the query definition. In the toolbar in the BEx Query Designer, choose the Query Properties symbol . 1. In the Query Properties dialog box, the modification options are divided into areas General, Display, Specific, and the Documents button using which you can jump to document definition.

Sequence of the entry variables can be changed

The General tab give information about the technical name of the query definition, the InfoProvider that it is based on, the owner, and the person who last changed the query. The description of the Query can be changed under the Description box, and assigning it text variables (in order to keep the variable restriction in the description at runtime, for example). A key date, which can be required by time-dependent characteristics, attributes, and hierarchies and their nodes for the report display, can be fixed or defined with a variable request at runtime. ______________________________________________________________________________ Page 48

Query Definition Properties The sequence of the entry variables can be changed by selecting the entry variable and clicking on the or buttons.

2. The Display tab is divided into two areas one for the display options and the other for the number format.

The Display options include the following: Adjust Formatting After Refreshing The query format is used to identify the type of data contained in the cell and therefore emphasize the structure of the results. The Refresh Formatting after Refreshing function ensures that the format is adapted to the updated query data when the query is refreshed. This function is activated by default. If you want to deactivate this function (this helps to improve performance when calling a report), or use your own templates, remove the check from the box. Suppress Repeated Key Values This function is also activated by default, which means that when the query is executed, only the first key or description is displayed for each characteristic and any additional identical keys or descriptions are suppressed. ______________________________________________________________________________ Page 49

Query Definition Properties Display Scaling Factors for Key Figures This function enables you to include any scaling factors defined in the row or column header (for example, *100 USD). Display Document Links If you activate this function, you have access to document links using the extra symbol that is displayed in the relevant object within the report. As a prerequisite, a document has to exist already for an object in the Administrator Workbench. The information is displayed in a separate browser window. Display Drag and Relate Links The Drag&Relate function enables you to execute transactions from an SAP R/3 system or an external system from within the Enterprise Portal. The number format area includes the following: Results Position You use this function to define the position in which the results area is displayed: Bottom/Right, Top/Left, Bottom/Left, or Top/Right. Display of +/- Signs This is where you determine how negative values are displayed: With the minus sign before the value -<number>, after the value <number>-, or with the value in parentheses (<number>). Display or Suppression of Zero Rows and Columns You have the following options with regard to the display of zero values: Display Zeros, Zeros Without Currency/Unit, Suppress Zeros, Show Zeros as. With the option Show Zeros as, you can enter your own value or text that is displayed in place of zeros. Alternatively, you can suppress zero rows and columns together.

______________________________________________________________________________ Page 50

Query Definition Properties 3. The Specific tab allows you to release OLE DB for OLAP here by setting the flag, if you want to evaluate data from the BW using 3rd party tools. All characteristics and key figures are then transferred since the release of this interface offers a normalized method for accessing BW data using a relevant Frontend presentation tool.

4. The Document button can be used to launch the Document Query Element dialog box, from where you can display an existing document, or create or import a new document (from Microsoft Word, Microsoft Excel, etc). You can find these documents in the metadata repository of the Administrator Workbench. They are displayed there provided they were created with an editor and marked as being online documentation.

______________________________________________________________________________ Page 51

Query Definition Properties

7.2

Query Where-Used List

You have the option in the Query Designer of displaying a where-used list for the query definition in workbooks and views. To do this, choose the Query Where-Used List symbol from the Query Designer toolbar.

7.3

Deleting Query Objects

By choosing Delete , you can remove the query definition from SAP BEx, the BEx Query Designer, and also from the SAP menu. You will be prompted to confirm the deletion.

______________________________________________________________________________ Page 52

Exceptions

8. Exceptions
The functions in exception reporting enable you to select and highlight unusual deviations of key figure values in a query. You can see deviations from pre-defined threshold values or intervals in the query result displayed in different colors if the exception is active. Spotting these deviations early provides the basis for timely and effective reactions.

8.1

Creating Exceptions
and selecting New

1. You create an exception in the Query Designer using the symbol Exception.

2. In the Defining Exceptions dialog box, a meaningful Description can be specified and the defined exception can be set to Active. The exception is applied as soon as the query is executed. If the active flag is not set, the exception can be activated in the report itself. In the BEx Analyzer, from the BW toolbar Layout Display Exceptions theres an option for adding an additional line between the filter and the results areas for each exception and activating or deactivating the exception from there. 3. Exceptions can be used to evaluate one or all key figures in the query definition. If exceptions were to be used selectively on specific key figures in the query definition, an exception has to be defined for each key figure accordingly.

______________________________________________________________________________ Page 53

Exceptions 4. On the Exception Values tab, enter the values by first choosing New. An alert level row always consists of a From field, a To field and an Alert Level field. If the From or the To field values are left empty, this gives an infinite value definition. Choose Transfer to add the entries to the list of threshold values.

An apostrophe after the value means multiply by a thousand, two mean multiply by a million and three mean multiply by a million (for example: 1 = 1,000 and 1,5 = 1,500,000) 5. By defining variables as threshold values, you can influence defined exceptions flexibly. You can allocate the available alert levels as you wish. You can set the alert colors red, yellow and green, each in three shades, as required. The colors relate to the color characteristic values of the format templates delivered by SAP and symbolize traffic light colors. 6. On the Cell Restrictions tab page, you can specify whether a restriction with regard to the use of the exception applies Only to the Totals (default setting) or to All values (therefore not a restriction).

______________________________________________________________________________ Page 54

Exceptions You can choose New to define an operator for each characteristic in the query definition, and a value for each operator. You also choose Transfer here to add your restriction to the list. 7. You have the following selection options for the operators:

Everything The cell context is not restricted. The exception applies for every drilldown state of the characteristic. Totals Only The exception affects only the aggregated values of the characteristic. Everything Except Totals The exception affects all values except for the aggregated values of the characteristic. Fixed Value The exception applies only to a specific characteristic value of the characteristic, which you can determine in the search help in the value field. You can also use a characteristic value variable here. To do this, select Variables Entry. You are then given the option of using or creating a new one. Level The exception applies only to specific hierarchy levels of the characteristic. You enter the required hierarchy level in the value field here. Note that you have to list all characteristics that you defined in the Cell Restrictions in the drilldown of the report, since the exception takes effect only then. If there is a characteristic in the drilldown that is not recorded in the cell restrictions, the effect that the exception has depends on whether you selected Totals Only or All on the Cell Restrictions tab page. If you selected All, it does not matter where you integrate the characteristic in the drilldown, the exception is applied accordingly. However, if you selected Totals Only, you have to place this characteristic at the end of the drilldown, otherwise the exception does not take effect.

______________________________________________________________________________ Page 55

Exceptions

8.2

Changing and Deleting Exceptions


and selecting Change

1. You can change exceptions in the Query Designer using the symbol Exception.

______________________________________________________________________________ Page 56

Exceptions 2. If you want to delete or change a list query, highlight the entry using the cursor and choose Delete, or OK if you want to make changes.

______________________________________________________________________________ Page 57

Conditions

9. Conditions
By defining conditions you have the option of analyzing the query results in more detail. You can analyze combinations of characteristics using ranked lists, thereby displaying the ten best customers by sales revenue, for example. By defining value limits you can display all key figure values above or below a certain value. The data is restricted accordingly in the results area of the query, so that you only see the area that interests you. You can define multiple conditions for a query, and then activate or deactivate them in the report itself to create different views of the data.

9.1

Defining Conditions

1. You can make restrictions to the Query Designer, using Condition . As a prerequisite, you have to have created a query definition for which one or more conditions can be defined.

2. In the Define Condition dialog box, you can specify a meaningful Description and set the condition to Active. If the condition has the status Active, it is used in the report as soon as you execute the query. If you do not set the active flag, you can activate the condition in the report itself. In the BEx Analyzer, from the BW toolbar Layout Display Conditions you also have the option of adding an additional line between the filter and results areas for each condition and activating or deactivating the condition from there. If you restrict conditions for a report to Single Characteristic or Combinations of Characteristic, you have to ensure that the characteristic or the combination of characteristics is integrated into the report drilldown for the defined restrictions to take effect.

______________________________________________________________________________ Page 58

Conditions

Determine conditions for threshold values or ranked lists

3. In the Display all values for which at least one of the following condition applies, choose New to select a Key Figure for which a condition is to be used. In the second field, you can see the operators for specifying value definitions. Choose Transfer to add your entries to the list of conditions and choose New to define more conditions. Save your conditions by choosing OK and you can then display your report in the BEx Analyzer or in the browser. A condition row consists for a key figure, an operator, and a value for the operator. In query definitions that contain two structures, there is an additional field for defining a structural component.

______________________________________________________________________________ Page 59

Conditions The following operators can be used for threshold value conditions: Equal to Example: Incoming orders equals 1000 Not Equal to Example: Line Item not equal to 5 Less than Example: Revenue less then $100,000 Greater than Example: Incoming orders greater than 1,000,000 Less than or equal to Example: Revenue less than $100,000 Between Example: Sales from/to, with the option of defining these using a variable request Not Between Example: Sales from / to excluded from display, with the option of defining these values flexibly at runtime In the variable definition, select Variable Entry. You are then given the option of choosing an existing variable from the dropdown box, changing the variable or creating a New Variable. 4. The following operators for ranked list functions can be used to define variable threshold values: Top N Example: Display Revenue of top 5 customers Bottom N Example: Display the bottom 3 (lowest) incoming orders Top % - Example: Restriction to 20% of the best revenue, in order Bottom % - Example: List of 15% of the customers with the lowest sales revenue, in order Top Sum Example: A list of products with the highest sales revenues where the total sales revenue makes up $20,000. All sales revenues are sorted in descending order and then the sum is calculated until the threshold value of $20,000 is exceeded. All products, including the product that takes the sales volume over the $20,000 mark, are listed. Bottom Sum Example: As with Top Sum, a ranked list is sorted in ascending order of products with the lowest sales revenue until a sum greater than or equal to $20,000 is reached. All products, including the product that takes the sum over the $20,000 mark are also listed here.

______________________________________________________________________________ Page 60

Conditions

9.2

Changing and Deleting Conditions


Change

1. To change existing conditions, in the Query Designer, choose Condition Condition.

______________________________________________________________________________ Page 61

Conditions 2. The Selection dialog displays. Highlight the required condition and confirm with OK. In the Define Condition dialog box, new conditions can be added to the list by selecting the New Condition option, or highlight existing conditions and select the OK button to change or the Delete button to delete them.

______________________________________________________________________________ Page 62

You might also like