Você está na página 1de 111

Understanding BEx Query Designer: Part-1 Screen Appearance

Applies to:
SAP NetWeaver BW.

Summary
This document is the first installment of a 6 part Query Designer Training guide for Beginners. It deals with understanding first thing you see in the query designer the menu, the buttons, the screen sections etc. This document will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio
Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-1 Screen Appearance

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 3 Screen Layout ..................................................................................................................................................... 5 A First look at the Query Designer .................................................................................................................. 5 Screen Sections .............................................................................................................................................. 5
InfoProvider.................................................................................................................................................................. 5 Filter ............................................................................................................................................................................. 5 Rows/Columns ............................................................................................................................................................. 6 Tasks ........................................................................................................................................................................... 8 Properties..................................................................................................................................................................... 8 Messages..................................................................................................................................................................... 8

Toolbar Options .................................................................................................................................................. 9 Menu Bar ......................................................................................................................................................... 9 Standard Toolbar ............................................................................................................................................ 9 View Toolbar ................................................................................................................................................. 10 Related Content ................................................................................................................................................ 12 Disclaimer and Liability Notice .......................................................................................................................... 13

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-1 Screen Appearance

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures

Defining exceptions Defining conditions

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-1 Screen Appearance

The most significant components of the query definition are the filter and navigation: The selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For the navigation you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-1 Screen Appearance

Screen Layout
A First look at the Query Designer On opening the query designer, the following default screen appears.

As you can see in the screenshot above, the screen layout is divided into several sections such as InfoProvider, Characteristic restrictions etc. These sections will be discussed in detail in this document. Screen Sections InfoProvider This pane displays the elements of the InfoProvider in consideration used to develop the query. You can drag and drop the Key figures, characteristics, attributes, etc. from the InfoProvider pane to the query definition. Filter If the filter has to be restricted on some specific characteristics, then those restrictions are defined in the filter area of the query designer. It is further subdivided into 2 different panes: Characteristic Restrictions The static filters are defined in this pane. Default Values The default values for which the query should be first executed is defined in this pane

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-1 Screen Appearance

Rows/Columns Press the Rows/Columns tab circled in red below to bring up this pane.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-1 Screen Appearance

The following screen appears

The layout of the query is defined on the Rows/Columns tab of the Query Designer. Rows/Columns area of the query designer is further subdivided into 4 different panes: Rows Includes the characteristics and key-figures to be included as rows. Columns Includes the characteristics and key-figures to be included as columns. Free Characteristics If you want some characteristics to not be included in the default view of the query, but still be available for drilldown if needed, place them in this pane. Preview This pane provides a preview of the query structure and layout.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-1 Screen Appearance

Tasks You will find this pane on the right side of the screen (as circled in red below).

For different components of a query, there are different tasks or actions that can be performed depending on the element selected. In case of errors, the possible corrective actions and error help are also visible in the Task area. Properties Click on the Properties tab to switch from the Task Tab explained above. All elements of the query have their own sets of properties and settings which determine the behavior of that element. These properties and settings are visible in this pane. Messages Errors, warnings and other information related to the query are displayed in the Messages screen area.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-1 Screen Appearance

Toolbar Options
The following image shows the menu bar and the other toolbars of BEx Query Designer

Menu Bar Following are the five menu options available in the menu bar: Query The functions under this menu options allow you to create, save, open, check, execute, and delete a query. Edit You can perform different edit functions using this menu option. Also, you can toggle between the display only and edit mode of the query. View The functions under this menu option allow you to display different screen areas as well as toolbars. You can also toggle between different options to display the technical name and description of query elements. Tools The Save All function under this menu option saves the query definition as well as all the other reusable components that are created while working on the query. Help Functions under this menu option provide error help and also provide help to SAP online documentation Standard Toolbar The Icons available on the Standard toolbar is explained below: New Query If you want to create a query, select the symbol for New Query. You reach the BEx Open dialog where you choose the InfoProvider whose data you want to use as the basis for your query. You can select the InfoProvider either from the InfoProviders in your history or from the list of all available InfoProviders under InfoAreas. Open Query Choose Open Query to get to the BEx Open dialog. Here, all existing queries are available in your history, favorites, roles or listed according to InfoArea. Under InfoAreas you get a list of all existing queries in the Business Information Warehouse for which you have display authorization. Save Query You can save a query that you have changed under its current name using the function Save Query. If the query does not yet have a technical name, the system offers the function Save Query as automatically. Save All

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-1 Screen Appearance

It saves the query definition as well as all the other reusable components that are created while working on the query. If you want to save the query under a new technical name, choose Save Query As. Enter the new technical name. You can save the query in your favorites or roles. Execute Executes the query in portal. Check Query Checks the query design for possible errors/warnings. Query Properties All elements of the query have their own sets of properties and settings which determine the behavior of that element. Click this option to view these properties. Cut Cuts a query element. Copy Copies a query element. Paste Pastes a query element. View Toolbar The Icons available on the View toolbar is explained below: InfoProvider Open/Move the focus to the InfoProvider Pane. Filter Open/Move the focus to the Filter Pane. Usage has already been explained earlier in the document. Cells You can define formulas and selection conditions explicitly for cells in queries with two structures. In this way you can override the cell values that are created implicitly from the intersection of the structure components. This function allows you to design much more detailed queries. This option is only available for queries with two structures. For queries with only one structure, the symbol is deactivated. Condition Choose Condition, if you want to define conditions for a query. You can specify threshold value conditions for the key figure values in every characteristic. For example, you can specify all sales

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-1 Screen Appearance

figures under or above a certain threshold value. In the query, the selected characteristics are displayed with the restricted key figures. Exceptions You can define exceptions for a query. Exceptions are variations in key figure values that you define yourself. They are displayed in a different color in the query view. This allows you to see, at a glance, any unusual deviations from the results you expect to get. Properties Open/Move the focus to the Properties Pane. Usage has already been explained earlier in thee document. Tasks Open/Move the focus to the Tasks Pane. Usage has already been explained earlier in thee document. Messages Open/Move the focus to the Messages Pane. Usage has already been explained earlier in thee document. Where-Used List With the Query Where-Used List, you can see the objects (workbooks, Web templates, Crystal Reports or Reporting Agent settings) in which the query is used. Documents Provides help from SAP online documentation. Technical Names You can show or hide the technical names of the query components (InfoObjects, structures, variables, and so on) using this function.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-1 Screen Appearance

Related Content
http://help.sap.com/saphelp_nw04/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-1 Screen Appearance

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Applies to:
SAP NetWeaver BW.

Summary
This document is the second installment of a 6 part Query Designer Training guide for Beginners. It deals with understanding designing the basic elements of a query, i.e. Structures, Selections, and formulas. This document will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio
Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 3 Structures............................................................................................................................................................ 4 Key Figure Structures ..................................................................................................................................... 5 Characteristic Structures ................................................................................................................................. 5 Reusing Structures .......................................................................................................................................... 9 Selections and Formulas............................................................................................................................... 11
Selections .................................................................................................................................................................. 11 Formulas .................................................................................................................................................................... 15

Related Content ................................................................................................................................................ 18 Disclaimer and Liability Notice .......................................................................................................................... 19

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures

Defining exceptions Defining conditions

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

The most significant components of the query definition are the filter and navigation: The selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For the navigation you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

Structures
Structures are objects that appear in the Query Designer and can be defined freely. A structure forms the basic framework of the axes in a table (rows or columns). It consists of structural components. We differentiate between key figure structures and characteristic structures. Structural components of key figure structures are always based on the key figure selections (basic key figures, restricted key figures, and calculated key figures). Characteristic structural components cannot contain key figure selections. The set up of the structure determines the sequence and number of key figures or characteristic values in the columns and rows of the query. You can navigate through the structure in the executed query and set filters for it. If you are using two structures (for example, a key figure structure in the columns and a characteristic structure in the rows), a table with fixed cell definitions is created. There are two types of structures based on the types of components contained in the structure. Key Figure Structures Characteristic Structures

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Key Figure Structures Key figure structures include the components that are based on a key figure such as basic, formula, restricted, and calculated key figures. A key figure structure is automatically created in a query when you drag and drop key figures from the InfoProvider screen to the query rows/columns. Each component included in a key figure structure should include a key figure. This means that you can include key figures, formula key figures, selection with key figures, restricted key figures (RKFs), and calculated key figures (CKFs) in a key figure structure. But a characteristic or a selection without a key figure cant be included in the key figure structure. A structure appears in the Query Designer automatically if you move a key figure from the left selection window for InfoProvider objects into the rows or columns of the query definition. The structure that the system creates automatically is identified by the proposal. symbol and contains the default name Key Figures as a

A maximum of 2 structures are allowed in a query definition, and only one of those can be a key figure structure. Characteristic Structures Characteristic structures are optional in query definition and are used if you want to display a specific number of characteristic values in a specific sequence. To create a new structure, select Create New Structure from the context menu of the Rows area.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Add structural components to the structure by selecting an option from the context menu.

The new selection will appear.

Now, we have to define the new selection. For that, double click and open it. The following pop-up appears.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Now drag and drop the required Characteristics to the Details of the Selection Pane and press OK to confirm.

You will see that the new structure has been created.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

When you use 2 structures in a query, you can additionally define a separate logic for each cell formed due to the intersection of the 2 structures. This logic will override the cell values generated implicitly from the intersection of the structures. Click on the cell definition button (circled in red below) or use menu path View Cells. This option is activated only when there are 2 structures in the query.

When cell definition is enabled, an additional Cells tab (circled in blue above) area is visible on the query designer layout.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Reusing Structures Consider a scenario where an Organization uses a particular set of key figures most commonly in all the queries. You have used these key figures in a query and they are part of a KF structure. You can save this structure as a reusable component, which can be included in other queries on the same InfoProvider. To save a structure, select Save As from the context menu as shown below.

You will get the following pop-up

Save it after providing the appropriate technical name and description

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Now, when you create a new query on the same InfoProvider, this saved structure is visible under the Structures folder in the InfoProvider Tab as shown below.

This can be directly pulled into the Rows/Columns area to use in the new query. However, if you make changes to this structure, those will be reflected in all the queries that use it. So if you want to make some changes to this structure that are specific to only one query, you should detach the definition in the query by selecting Remove reference from the context menu as shown below.

Reusable structures built for commonly used collections of key figures or characteristics can make query development easier and faster due to its reuse in multiple query.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Selections and Formulas The characteristics and key figures from the InfoProvider can be directly dragged into the Rows/Columns area to define a query. But sometimes using the elements just as available in the InfoProvider isnt enough. We will explain selections and formulas using the following example scenario: There have to be two columns in the query depicting the revenues for the financial year 2001 and2002. Also, we need to add another column showing the percentage increase/decrease in revenue over the previous financial year. These requirements can be addressed only by using formulas in the query key figure structure. Selections To begin, get all of the characteristics needed to define the query in the rows and the key figures in the columns.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Now, to create a new selection, use the New Selection option from the context menu.

This will create a new selection component in the key figures structure as shown below. You will get the following pop-up

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

In this case, we will drag and drop Revenue key figure and Calendar Year Characteristic.

Now we will restrict the Revenue on year 2001. To do this, Right click on Calendar year and select restrict from the context menu as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

You will get the following pop-pop. Move the Year 2001 to the Chosen Selections as shown below.

Press Ok and the restriction will be complete as shown below.

Save the selection after adding Revenue-2001 as the description. The result is as shown below

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Similarly create another selection restricting Revenue key figure on year 2002. The result is as shown below.

Formulas The next requirement is to add a column to display the percentage growth from 2001 to 2002. This computation can be done using the formula component in structure. Continuing from the previous example, to create a new formula, select the option- New Formula from the context menu as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

A new formula component appears as circled in red below.

Double click on the formula component to bring up the following pop-up where we will define it. The formula that will be used for calculating the growth percentage is : ( ( Revenue 2002 Revenue 2001 ) / (Revenue 2001) ) * 100 as shown below. Use the NDIV0 function to handle the divide by 0 scenarios and return 0 as output in such cases.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Press ok and you will see the new fully defined formula component (circled in red below)

The query output is as follows:

Thus we have implemented and analyzed the concept of Selection and formulas.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 17

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Related Content
http://help.sap.com/saphelp_erp2004/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 18

Understanding BEx Query Designer: Part-2 Structures, Selections and Formulas

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 19

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Applies to:
SAP NetWeaver BW.

Summary
This document is the third installment of a 6 part Query Designer Training guide for Beginners. It deals with understanding more advanced elements in the query designer i.e. Calculated Key Figures and Restricted Key Figures. This document will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio
Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 3 Calculated Key Figures ....................................................................................................................................... 4 Use ............................................................................................................................................................... 4 Procedure to Define a New Calculated Key Figure ........................................................................................ 4 Illustrated Implementation of Calculated Key Figures ........................................................................................ 6 Restricted Key Figures ....................................................................................................................................... 9 Use ............................................................................................................................................................... 9 Procedure ........................................................................................................................................................ 9 Illustrated Implementation of Restricted Key Figures ....................................................................................... 10 Transporting Calculated and Restricted Key Figures ....................................................................................... 18 Related Content ................................................................................................................................................ 19 Disclaimer and Liability Notice .......................................................................................................................... 20

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures Defining exceptions Defining conditions

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

The most significant components of the query definition are the filter and navigation: Selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For navigation, you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

Calculated Key Figures


Use You can recalculate the key figures of an InfoProvider for reuse in the Query Designer using formulas. Calculated key figures consist of formula definitions containing basic key figures, restricted key figures or precalculated key figures. Procedure to Define a New Calculated Key Figure In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Calculated Key Figure. If a calculated key figure has already been defined for this InfoProvider, you can also select the Calculated Key Figures entry and, from the context menu, choose New Calculated Key Figure. The New Calculated Key Figure dialog box appears. The upper part of the screen contains a text field in which you enter a description of the calculated key figure. Beneath this is the input field for the formula that you want to use to calculated the key figure. The bottom left screen area contains all of the operands available for the formula definition. These are: The basic key figures calculated key figures and restricted key figures from the relevant InfoProvider.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

All form variables Basic functions Percentage functions Data functions Mathematical functions Trigonometric functions Boolean operators

Between the operands and the functions, the symbols for the basic arithmetic operations are displayed. To the right of the functions, there is a number block. Proceed as follows to define a formula: Choose the operands you want to use, and insert them in the entry field for the formula by doubleclicking or by using Drag&Drop. Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the functions, or using Drag&Drop. Select the numerical values for the formula by clicking on the number block.

2. Define your formula using the available operands and operators. If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight the Formula Variable entry and using the right mouse button on the context menu, choose New Formula. You reach the variable wizard that takes you through a step-by-step process for defining a new variable. If you want to change a formula variable, select the variable and, from the context menu, choose Edit. The variable editor appears. Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect if, for example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless of the unit, use the function Value Without Dimension (Without Units). 3. Check the formula definition and choose Formula Syntax Check The Formula Syntax Check .

function checks only the correctness of the syntax in the formula. It does not

check whether the formula makes sense semantically, for example, if it contains the same units. You make semantic checks using the function Check Query 4. Enter a description for the calculated key figure..

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

5. Choose OK. The new calculated key figure is defined for the InfoProvider.

Illustrated Implementation of Calculated Key Figures


To create a new Calculated Key Figure, Right-Click on the Key Figures Folder and select New Calculated Key Figure option from the Context menu as shown below.

You will notice that a new undefined Calculated key figure is created(circled in red below).

Double click on the newly create created Calculated key figure to define it.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

The following pop-up opens.

Here we will define monthly revenue formula by dividing the Revenue by 12. Also, give a meaningful description to the CKF along with a new technical name.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

The fully filled up pop-up will appear as the following.

Press Ok to confirm. Now, the fully defined CKF can be seen in the InfoProvider pane as shown below.

Now, to use this new CKF, you can simply drag and drop it into the Rows or Columns area as any other Key figure.

Note: The advantage of using a Calculated Key Figure is that the CKF is available for reuse in all the queries that are built on that InfoProvider

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Restricted Key Figures


Use You can restrict the key figures of an InfoProvider for reuse by selecting one of more characteristics. The key figures that are restricted by one or more characteristic selections can be basic key figures, calculated key figures or key figures that are already restricted. Procedure Defining a New Restricted Key Figure In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Restricted Key Figure. If a restricted key figure has already been defined for this InfoProvider, you can also select the Restricted Key Figures entry and, from the context menu, choose New Restricted Key Figure using the right mouse button. The New Restricted Key Figure dialog box appears. The text field, in which you can enter a description of the restricted key figure, is found in the upper part of the screen. Underneath the text field, on the left, is the directory of all the objects available in the InfoProvider. The empty field for defining the restricted key figure is on the right-hand side of the screen. Using Drag&Drop, choose a key figure from the InfoProvider, and restrict it by selecting one or more characteristic values. You can also use variables in place of the characteristic values. However, note that you cannot use the following variable types in restricted key figures for technical reasons. Variables with Replacement with Query process type Variables that represent a precalculated value set

You can use these variable types to restrict characteristics in the rows, columns or in the filter. Choose OK. Editing restricted key figures Note that when you change a restricted key figure, these changes are effective in all queries that use this restricted key figure. You can see where the restricted key figure is used. Choose Where-used List from the context menu of the restricted key figure (secondary mouse click). 1. In the InfoProvider objects display frame, select the restricted key figure and, from the context menu (right-mouse click), choose Edit. 2. 3. Make the required changes. Choose OK.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Determining properties for the restricted key figure


1. ...

1.

In the left display frame for InfoProvider objects, select the restricted key figure and, from the context menu, choose Properties.

2.

Make the required settings for the description, number format and currency translation for the restricted key figure.

Illustrated Implementation of Restricted Key Figures


To create a new Restricted Key Figure, Right-Click on the Key Figures Folder and select New Restricted Key Figure option from the Context menu as shown below.

You will notice that a new undefined Restricted key figure is created (circled in red below).

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Double click on the newly create created Restricted key figure to define it. The following pop-up opens.

Also, give a meaningful description to the RKF along with a new technical name. In this example, we will use the RKF to determine the Revenue restricted on Calendar year input at runtime by the user. The fully filled up pop-up will appear as following. Also, we have dragged and dropped Revenue Key Figure and Calendar Year Characteristic into the Details of selections pane.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Now, to restrict the calendar year based on user input, right click on the Calendar year characteristic and select restrict from the context menu.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Now, in the following pop-up select the Variables option from the Show Drop down menu.

Now click on the Create button (circled in red) below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

You will get the following pop-up

Now, give the variable a meaningful description and Technical name. Also, select the Manual input Processing type.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Now, switch to the Details tab. We will select the single value input and make it Mandatory here by selecting the options shown below.

Press Ok to confirm. You will receive the following pop-up

Press OK to confirm. You will reach the previous pop-up.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

You can see that the new variable has been added (circled in green below). Press the arrow button (circled in Red below) to move the variable to the Chosen selections pane.

Press OK to confirm the selection.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

You can see that the new variable restriction has been added successfully (Circled in red below).

Press OK to confirm Now, the fully defined RKF can be seen in the InfoProvider pane as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 17

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Now, to use this new RKF, you can simply drag and drop it into the Rows or Columns area as any other Key figure.

Note: The advantage of using a Restricted Key Figure is that the RKF is available for reuse in all the queries that are built on that InfoProvider

Transporting Calculated and Restricted Key Figures


To make the calculated and restricted key figures available in various BI systems, transport them. If the transport system is activated, a dialog box for specifying a transport request appears when you save the calculated and restricted key figures. Enter the required transport request. Note: If a fixed standard BEx transport request is specified, the calculated and restricted key figures are automatically written to this request and the transport request dialog box is not displayed. The technical names of the object types (TLOGO) for these key figures in transport requests are as follows: Calculated key figures: ELEM (ELEM.CKF) Restricted key figures: ELEM (ELEM.SEL)

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 18

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Related Content
http://help.sap.com/saphelp_erp2004/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 19

Understanding BEx Query Designer: Part-3 Calculated Key Figures and restricted Key Figures

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 20

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Applies to:
SAP NetWeaver BW.

Summary
This document is the fourth installment of a 6 part Query Designer Training guide for Beginners. It deals with understanding the need and use of Conditions and Exceptions in the Query Designer. This document will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio

Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 3 Conditions ........................................................................................................................................................... 4 Use ............................................................................................................................................................... 4 Integration ....................................................................................................................................................... 5 Prerequisites ................................................................................................................................................... 5 Features .......................................................................................................................................................... 5 Creating a Condition: An Illustrated example.................................................................................................. 7 Exceptions ........................................................................................................................................................ 11 Use ............................................................................................................................................................. 11 Features ........................................................................................................................................................ 11 Possible Validity Areas.................................................................................................................................. 14 Properties ...................................................................................................................................................... 14 Creating a Exception: An Illustrated example ............................................................................................... 15 Related Content ................................................................................................................................................ 21 Disclaimer and Liability Notice .......................................................................................................................... 22

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures Defining exceptions Defining conditions

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

The most significant components of the query definition are the filter and navigation: Selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For navigation, you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

Conditions
Use You can formulate conditions to make data analysis more efficient. In the results area of the query, the data is filtered according to the conditions so that only the part of the results area that you are interested in is displayed. If you apply conditions to a query, you are not changing any numbers. Instead, you are just hiding the numbers that are not relevant for you. For this reason, conditions have no effect on the displayed values of the results rows. The results row of a query with an active condition corresponds to the results row of a query without this condition You can define multiple conditions for a query. Conditions are evaluated independently of each other. In doing so, the results quantity for the evaluation sequence is independent. The result is the intersection of the individual conditions. Multiple conditions are linked logically with AND. A characteristic value is only displayed when it fulfills all (active) conditions of the query

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Integration The conditions function for defining is available in the following areas of the Business Explorer: in the BEx Query Designer in Web Applications in the Ad-hoc Query Designer in the Web item List of Conditions in the toolbar of the standard Web template

Prerequisites You have defined a query, have used this query if necessary as a data provider in a Web application, and would now like to define one or more conditions for this query. Features Conditions help you restrict how you view query data in the following way: Threshold values: An entry is filtered independent of the other entries if its reference value has a specific relationship to a comparison value. For example, an entry is not displayed if its reference value exceeds or goes below a specific threshold value. Ranked List: All entries for the displayed list or all entries for a logical section of the list (with multiple characteristics in the drilldown) are considered here and their relationship to another determines whether the entry is displayed. For ranked lists, the sorting is switched on automatically when the condition is activated. The following operators help you to create rank lists: Top N, Bottom N: The ranked list is arranged according to a particular number. Customers: Top 3 with bottom 5 sales volumes You get a list of the three customers having the strongest sales and the five customers with the weakest sales. This means that you see the set union of both condition rows Top 3 Sales and Bottom 5 Sales. Top percent, bottom percent: The ranked list is arranged according to a particular percentage. Material: Top 25% of sales revenue You receive a list of the strongest materials related to revenue - until 25% of the total revenue is attained. Material: Bottom 25% of sales revenue You receive a list of the weakest materials related to revenue - until 25% of the total revenue is attained.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Top total, bottom total: The ranked list is arranged according to a particular totals value. Products: Top total 20,000 EUR of sales volume You get a list of products with the lowest sales volume, whose combined sales volume makes a total of 20,000 EUR. First, all sales volumes are sorted in descending order and then totals are formed until the threshold value of 20,000 is exceeded. Those products that exceed the 20,000 EUR thresholds are left in the list. The ranked list for this condition might look like this: Product A B C Sales 11,000 EUR 7,000 EUR 5,000 EUR

Product C is included in the list, even though it means the total is greater than 20,000 EUR. All the products that have a lower sales volume than product C are no longer displayed. If you want to create a ranked list of the products with the lowest sales volume whose combined sales total a certain amount, use the Bottom total operator.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Creating a Condition: An Illustrated example Let us assume a scenario where we want to Display all the products that generate a revenue of greater than or equal to 150,000 EUR. To achieve this, first drag the Product Characteristic to Rows and the Revenue Characteristic to Columns as shown below.

To create a new condition, first click on the conditions button circled in red below.

This will open the Condition screen area.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

The Condition screen area screenshot is given below. Right click anywhere inside it and select New Condition to create a new condition.

After selecting New Condition, a new undefined condition will appear in the Conditions pane as shown below.

Double click on Condition 1 to define it.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

You will get the following pop-up

Click on the New button (Circled in red above) to create a new condition. This will cause the drop down menus that were grayed out to become active.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Now use the Drop down menu to define our condition as shown below.

Click on the Transfer button (Circled in red above) to transfer the condition to the Define Condition Parameters Pane. You can see below that the condition has been added. Now give your condition a meaningful description and press OK to save.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

You will see that the new condition has been added as shown below.

The query output below confirms that the design works flawlessly.

Exceptions
Use You can define threshold values (exceptions) for a query. You define exceptions in the BEx Query Designer or in BEx Web applications. Features Defining an exception involves defining the following components: Exception Type You specify whether you want to define a status exception or a trend exception. The type of exception affects, for example, the display of the exception. Status exceptions affect absolute key figures. They describe the current status of a number (such as revenue > 30000). Trend exceptions affect relative key figures. They describe a change to a key figure (such as deviation > 5 percent).

You can only make this setting in the exception wizard, not in the exception editor. Definition of Key Figures You specify which key figures the exception is to affect. The exception can affect all structure elements of a structure or a selected structure element. If a structure element is used in the definition of an exception and the structure is inconsistent, the system displays an information message in the

Messages area and automatically corrects the structure. The

system adds the used structure element to the structure. To activate this change, you must save the structure.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Time of Evaluation You can set whether the evaluation of the exception is to take place before or after a local calculation. Choose Before Local Calculation or After Local Calculation as required. Specifying the Threshold Values Set the required alert level and specify the relevant threshold values and operators. You can choose from the following alert levels: Good 1 Good 2 Good 3 Critical 1 Critical 2 Critical 3 Bad 1 Bad 2 Bad 3

You can choose from the following operators: = Equal To <> Not Equal To > Greater Than >= Greater Than or Equal To < Less Than <= Less Than or Equal To [] Between ][ Not Between

The values for these operators must be floating point numbers. For the operators

[] Between and ][ Not

Between, you must enter a value range, that is, an upper and a lower threshold value.
The input format depends on the country setting for the operating system. In BEx Query Designer, you can use formula variables for the from and to values of the exception. By choosing Entry of Variables, the input help appears and you can select the required formula variable.

When you execute the query, the variable dialog box appears, in which you can choose the from and to values. In addition to selecting a formula variable, you can also define new variables, change variables, and delete them.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

The system interprets the threshold values in the exceptions as numbers. This means for example that is not possible to enter a date directly as a threshold value. In BEx Query Designer, you can specify a date as a threshold value by using a form variable with processing type Customer Exit as the threshold value. The form variable must have the dimension Date. The customer exit provides the required date. The system processes the defined alert level and the associated threshold values sequentially. If you define multiple alert levels and threshold values for a value, the system displays the lowest alert level. Display/Target You can set whether the exception is to affect data cells or characteristic cells. In accordance with your setting, the highlighting for the exception is displayed on the numbers for the selected key figure or the text for the most detailed characteristic value. When you display the exception on data cells, you can choose whether the exception is to be displayed on the evaluated structure element, on another structure element, or on all structure elements. When you display the exception on characteristic cells, you can choose whether the exception is to be displayed on the rows, on the columns, or on both the rows and columns. Table Display You can display the exception in the table in the following ways: Background color: The exception is displayed with the background color of the data cell or characteristic cell. The color shading ranges from dark green for alert level Good 1 through yellow for alert level Critical 1 to dark red for alert level Bad 3. There are a total of nine color shades, corresponding to nine different levels of priority. Icon: The exception is displayed using icons. Icon and value: The exception is displayed with an icon and the value of the data cell or characteristic cell. Value and icon: The exception is displayed with the value of the data cell or characteristic cell and an icon.

Characteristic Restriction/Cell Restriction In the characteristic restriction of the exception, you specify on which cells the exception is to be evaluated. For all characteristics, the exception affects only the results unless you define otherwise. You can choose from any of the free characteristics, or characteristics from the rows and columns used in a query. You cannot use characteristics that are already used in another restriction row in the list. Select the required validity areas for the characteristics and restrict the characteristics as required.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Possible Validity Areas Validity Area All Meaning The validity area is not restricted. The

exception is valid for all drilldown states for the characteristic. Totals Only The exception is valid for aggregated values of the characteristic only. Everything Except Totals The exception applies to all values of the characteristic apart from aggregated values. Fixed Values The exception is valid for only one particular value of the characteristic (such as Spare Parts under Product Group, for example). Select the required characteristic value. In BEx Query Designer, you can also use a characteristic variable here by choosing Entry of Variables and selecting the required characteristic variable from the input help. When you execute the query, the variable dialog box appears, in which you can choose the characteristic value. You can also define new variables, change existing variables, and delete them Level The exception is valid for a particular hierarchy level of the characteristic only. Select the required hierarchy level. Properties Specify whether the exception is active or inactive and enter a description for the condition.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Creating a Exception: An Illustrated example Let us assume a scenario where we want to Display all the products and their associated revenues in a way that Critical range, Bad range and Good range revenues are highlighted in different colors. For this scenario, we will assume Critical range to be less or equal to than 100,000 EUR, bad range to be between 100,000 EUR and 300,000 EUR and good range to be any value above 300,000 EUR. To achieve this, first drag the Product Characteristic to Rows and the Revenue Characteristic to Columns as shown below.

To create a new exception, first click on the conditions button circled in red below.

This will open the Exception screen area.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

The Exception screen area screenshot is given below. Right click anywhere inside it and select New Exception to create a new Exception.

After selecting New Exception, a new undefined Exception will appear in the Exceptions pane as shown below.

Double click on Exception 1 to define it.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

You will get the following pop-up

Click on the new button in the popup defined above to define a new exception.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 17

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

According to our requirement we will define Critical range to be less or equal to than 100,000 EUR as shown below. Click transfer (Circled in red below) to add the new exception. Also add a meaningful description to the exception.

As you can see below, the new exception has been added.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 18

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Similarly, add the other 2 requirements in a similar fashion to reach the result shown below.

Now move to the Definition Tab of the same pop-up. You will see the following options:

We need to define this exception only on revenue, so use the Key Figures Drop down and select revenue as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 19

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Press OK to return to the Main Exception Definition window as shown below. It confirms that the exception has been added.

Save the query. Now we will see the query output in RSRT transaction screen.

You can see that the different t revenue ranges have been highlighted differently. Thus the requirement is met.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 20

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Related Content
http://help.sap.com/saphelp_erp2004/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 21

Understanding BEx Query Designer: Part-4 Conditions & Exceptions

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 22

Understanding BEx Query Designer: Part-5 Query Element Properties

Applies to:
SAP NetWeaver BW.

Summary
This document is the fifth installment of a 6 part Query Designer Training guide for Beginners. It deals with understanding the need and use manipulating the properties of the query elements and the query itself to get the desired result. This document will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio
Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-5 Query Element Properties

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 3 Query Element Properties .................................................................................................................................. 4 Characteristic Query Element Properties ........................................................................................................ 5
Characteristic Properties: General tab ......................................................................................................................... 6 Characteristic Properties: Display tab .......................................................................................................................... 6 Characteristic Properties: Hierarchy tab ...................................................................................................................... 7 Characteristic Properties: Planning tab ........................................................................................................................ 8 Characteristic Properties: Advanced tab ...................................................................................................................... 8

Key Figure Query Element Properties ............................................................................................................ 9


Key figure Properties: General tab ............................................................................................................................. 10 Key figure Properties: Aggregation tab ...................................................................................................................... 11 Key figure Properties: Display tab .............................................................................................................................. 11 Key figure Properties: Advanced tab .......................................................................................................................... 12 Key figure Properties: Conversions tab ...................................................................................................................... 12 Key figure Properties: Planning tab............................................................................................................................ 13 Key figure Properties: Calculations tab ...................................................................................................................... 14

Query Properties ........................................................................................................................................... 15


Query Properties: General tab ................................................................................................................................... 16 Query Properties: Variable Sequence Tab................................................................................................................. 16 Query Properties: Display tab .................................................................................................................................... 17 Query Properties: Rows/Columns tab ........................................................................................................................ 17 Query Properties: Value Display tab .......................................................................................................................... 18 Query Properties: Planning tab .................................................................................................................................. 18 Query Properties: Advanced tab ................................................................................................................................ 19

Related Content ................................................................................................................................................ 20 Disclaimer and Liability Notice .......................................................................................................................... 21

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-5 Query Element Properties

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures Defining exceptions Defining conditions

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-5 Query Element Properties

The most significant components of the query definition are the filter and navigation: Selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For navigation, you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

Query Element Properties


All components of query including the query itself have their own set of properties. These properties determine the behavior of the element. The properties for the selected query element are visible in the properties screen area of the BEx Query Designer. Also, you can select a query element for which you have to define the properties from the dropdown available in the Properties screen area. This document will explain all the settings contained in the Properties pane of the query designer. We will be discussing the following: Characteristic Query Element Properties Key Figure Query Element Properties Query Properties

in detail.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-5 Query Element Properties

Characteristic Query Element Properties We will explain the different properties that correspond to a characteristic query element. Select the characteristic for which you want to define the properties as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-5 Query Element Properties

Characteristic Properties: General tab

In the general tab, you maintain the description of the characteristic of the query which will be displayed in the query output when it is executed. If you use the Use Standard Text checkbox, the description as mentioned in the InfoObject definition is selected. The Technical name of the Characteristic will also be displayed as seen below. Characteristic Properties: Display tab

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-5 Query Element Properties

The Display Tab is divided into the following 3 sections: 1. Value Display Section To select the way the characteristic values should be displayed.( No Display, Key and Text, text, key or text and key) In the text view drop down, you can specify if you want the short, medium or long text to be displayed. 2. Sorting Section In this section, you will define if the characteristic will be sorted in ascending or descending in the query output. 3. Result Rows Section The result rows section allows you to set the display options of the summations in the query output. Characteristic Properties: Hierarchy tab

If the characteristic, for which properties are being maintained, contains hierarchies built on it, then you can set different properties on the Hierarchy tab. On this tab, you can select the hierarchy to be used in the query, and you can define the display sorting settings for the selected hierarchy.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-5 Query Element Properties

Characteristic Properties: Planning tab

The option specific to planning on hierarchy nodes are available on the Planning tab of characteristic properties. This setting is relevant for input-ready queries only. Characteristic Properties: Advanced tab

The properties related to data access and data selection are maintained on the Advanced tab of the characteristic properties. The Advanced Tab is divided into the following 3 sections: 1. Access Type for Result Values In this section you can define what values of the characteristic should be displayed in the query output. These options are:

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-5 Query Element Properties

Posted Value: Upon selection of this option, only posted values of the characteristics are displayed in the query output.

Characteristic Relationships: Upon selection of this option, you can display the data as per characteristic relationships.

Master data: Upon selection of this option, all the characteristic values from the master data are displayed irrespective of whether transaction data exists for those values or not.

2. Filter Value Selection During Query Execution This setting determines the list of values you would get while selecting a filter value during query execution. 3. Refresh Variables Here you can make variable refresh settings using either of the following options available: Refresh Dynamically If you choose this option, the system refreshes the workbook or Web application using the settings from the current navigation view. Refresh as Designed If you choose this option, the system refreshes the workbook or Web application using the hierarchy and filter settings from Query Designer. Key Figure Query Element Properties Now, we will look at the different properties for key figure query elements. Click on the key figure whose properties have to be modified. The properties pane will display the key figure settings as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-5 Query Element Properties

We will now look at the different tabs available under key figure properties pane. Key figure Properties: General tab

You can maintain the description and technical name of the query element in this tab. To maintain the default description, click on the Use Standard Text checkbox. Or else you can uncheck this checkbox and provide your own description to be shown in the query output. You can also edit the definition of this element by clicking the Edit button.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-5 Query Element Properties

Key figure Properties: Aggregation tab

Here you can specify how the aggregation should take place for the key figure when the query is executed. This tab is enabled only for the query elements of type formula or Calculated Key Figures. Key figure Properties: Display tab

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-5 Query Element Properties

Use the settings under the Hide section if you want to hide the key figure in the output. There is also an option available to highlight the key figure value under the Highlight section. Additional settings related to the number of decimal places, scaling factor, and so on, can be set under the display tab. Key figure Properties: Advanced tab

The constant selection setting is available only for the elements of type selections or Restricted key figures. The setting of constant selection is used if you want to keep the characteristic selections mentioned in the definition of the selection/RKF as a constant. It means that during the query execution, the restrictions applied on the key figure do not change. Key figure Properties: Conversions tab

The settings on the Conversions tab are useful if there is a key figure of type amount or quantity included in the query element definition, and you need to convert the amount or quantity in the uniform currency/unit.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-5 Query Element Properties

The currency Translation section of this tab is available for key figures of the type amount. Here, you can define the way the amount needs to be converted by specifying the Conversion type and the Target Currency to which the key figure value is translated. The key figure is of type quantity, the Unit conversion section of this tab is enabled. Similar to the settings for currency translation, here you have to define the Conversion Type and the Target Unit as parameters for unit conversion. Key figure Properties: Planning tab

The Planning tab allows you to set the properties for a key figure included in an input-ready query.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-5 Query Element Properties

Key figure Properties: Calculations tab

The calculations tab allows you to define the way you want the results and the single values to be calculated for the report output. The option you choose in the Calculate Result As area will recalculate the result per the selected option. Similarly, the option you select under Calculate Single Value As will influence the way single values are recalculated for the query output display.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

Understanding BEx Query Designer: Part-5 Query Element Properties

Query Properties Different properties are defined at query level. To display these properties, click on the Query properties button from the menu bar as shown below.

Alternatively open the Query properties by selecting Query Properties as shown below.

There are seven different tabs where you can set the query properties. These tabs will now be explained in detail.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

Understanding BEx Query Designer: Part-5 Query Element Properties

Query Properties: General tab

The general tab of the query properties displays the technical name and allows you to maintain the description of the query. This description is visible to the report user when the query is executed. If the query involves time-dependant master data, then the date specified in the Key Date field is used to derive the values from the time-dependant data. You can maintain any specific date in the query, or you can use a characteristic variable on the date as a more flexible option. If nothing us included I the Key Date settings of the query, then the date of query execution is considered as the key date for that query. Query Properties: Variable Sequence Tab

It displays the list of all the variables that are enabled for user entry. You can change the order in which the variable should appear in the selection screen, when it is executed.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

Understanding BEx Query Designer: Part-5 Query Element Properties

Query Properties: Display tab

The formatting, display of key values, and display of scaling factors settings are done in the Display Options section. When you use the Hide Repeated Key Values setting, the key values that are repeated in successive records are hidden, and only the first record displays the characteristic value, which is repeated. You can also select if you want to provide document links in the query by selecting the relevant Checkboxes. Query Properties: Rows/Columns tab

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 17

Understanding BEx Query Designer: Part-5 Query Element Properties

This tab allows you to maintain settings related to rows and columns displayed in the query result. The position of the result rows and result columns is determined based on the settings maintained under the Result Position section. You can also decide to suppress the zero values from the query output in the Suppress Zeros section. Here, you can decide if you want to apply the suppression either to rows or columns or to both rows and columns in the Effect On section. This tab also displays a preview of the settings chosen on this tab. Query Properties: Value Display tab

The settings related to key figure display, such as display of +/- signs or display of zero values, are maintained on the Value Display tab. Query Properties: Planning tab

The planning tab is relevant only to the input-ready queries where you can make the setting to open the query in change mode. This means users can enter and change the key figure values that are enabled for input.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 18

Understanding BEx Query Designer: Part-5 Query Element Properties

Query Properties: Advanced tab

The Allow External Access to This Query setting on this tab determines if the query can be executed through OLE DB for OLAP.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 19

Understanding BEx Query Designer: Part-5 Query Element Properties

Related Content
http://help.sap.com/saphelp_erp2004/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 20

Understanding BEx Query Designer: Part-5 Query Element Properties

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 21

Understanding BEx Query Designer: Part-6 Simple Query Design

Applies to:
SAP NetWeaver BW.

Summary
This document is the sixth and final installment of a 6 part Query Designer Training guide for Beginners. After going through the first five parts, the reader will have now had a broad level of familiarity with the design and function of the Query Designer. This document provides an insight into applying those concepts into a query development. It will also be helpful to intermediate and advanced level users to learn some usually ignored but helpful facts about the Query Designer. Author: Company: Created on: Shyam Uthaman Accenture Services Pvt. Ltd. 6 Jun 2011

Author Bio

Shyam Uthaman is working as SAP-BI Consultant. He is working simultaneously on multiple projects for different clients in Accenture.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

Understanding BEx Query Designer: Part-6 Simple Query Design

Table of Contents
The BEx Query Designer .................................................................................................................................... 3 Definition ......................................................................................................................................................... 3 Use ............................................................................................................................................................... 3 Integration ....................................................................................................................................................... 3 Features .......................................................................................................................................................... 4 Creating a Simple Query .................................................................................................................................... 5 Business Requirement ........................................................................................................................................ 7 Illustrated demonstration of Query Design ......................................................................................................... 7 Executing the Query ......................................................................................................................................... 14 Related Content ................................................................................................................................................ 15 Disclaimer and Liability Notice .......................................................................................................................... 16

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

Understanding BEx Query Designer: Part-6 Simple Query Design

The BEx Query Designer


Definition It is an Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer. By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports (Crystal Reports 8.5 incl. CR add-ons for SAP)

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

Understanding BEx Query Designer: Part-6 Simple Query Design

Features The BEx Query Designer contains the following functions: You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. You can select InfoObjects more precisely by: Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes Defining formulas Defining selections Defining reusable calculated and restricted key figures. Using local or reusable structures

Defining exceptions Defining conditions

The most significant components of the query definition are the filter and navigation: The selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. For the navigation you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

Understanding BEx Query Designer: Part-6 Simple Query Design

Creating a Simple Query


To create a new query, click on the Create button circled in red below. Or use the menu Query New

The following window pops up asking you to select an InfoProvider. Navigate through the InfoAreas to select the InfoProvider on which you want to create the query and click on the open button to return to the main screen.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

Understanding BEx Query Designer: Part-6 Simple Query Design

The InfoProvider definition will be displayed now in the InfoProvider pane as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

Understanding BEx Query Designer: Part-6 Simple Query Design

Business Requirement
Determine the top five customers with the highest sold quantity for 2002 by applying a condition. Secondly, compare the results with their revenues.

Illustrated demonstration of Query Design


Firstly, we will define the Rows of the Query. To do this, drag the Characteristics/key figures you want to see in the rows to the Rows pane of the Query Designer. Here, we have dragged and dropped only Customer into the rows as per our requirement The Preview pane re-affirms the design as shown below.

Now, we will define the columns of the query. According to the requirement, Quantity and revenue have to be dragged and dropped into the columns pane. The preview changes with the new design as shown below.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

Understanding BEx Query Designer: Part-6 Simple Query Design

Now, we have to define the filter. To do that, click on the filter tab circled in red below.

Now, drag and drop Calendar Year to the Characteristics Restrictions Pane Now we have to define the restriction on it.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

Understanding BEx Query Designer: Part-6 Simple Query Design

Right click on Calendar year and select restrict from the context menu.

You will get the following pop-up

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

Understanding BEx Query Designer: Part-6 Simple Query Design

To restrict the Calendar year to 2002, first use the drop down menu on the Show field and select Single Values as shown below.

Select the year 2002 and use the

icon to move it to the Chosen Selections pane

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

Understanding BEx Query Designer: Part-6 Simple Query Design

The Characteristic Restrictions pane now contains the filter as shown below

Now, we need to set the condition to get the top 5 customers with the highest sold quantity. To do that, click on the conditions button on the toolbar circled in red below.

A conditions pane will open as shown below. Right click anywhere inside and select New Condition from the context menu.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

Understanding BEx Query Designer: Part-6 Simple Query Design

You will see that a new Condition appears as shown below.

Double click on the new Condition to define it. Fill in the Description and click on the New button to start defining it.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

Understanding BEx Query Designer: Part-6 Simple Query Design

According to the requirement, we have filled in the settings to get the top 5 customers based on quantity. These settings have been circled in red below.

Click on the Transfer button to complete the assignment.

You will see that the new condition has been added.

Now, press Ok to confirm and go back.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

Understanding BEx Query Designer: Part-6 Simple Query Design

You can see that the condition Definition is complete

Now save the query using the

button.

Executing the Query


Go to RSRT transaction screen in the BW system and enter in your query name as shown below and press execute.

You will see the following output

The requirement has been met and the Top 5 customers have been sorted by Quantity on year 2002.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

Understanding BEx Query Designer: Part-6 Simple Query Design

Related Content
http://help.sap.com/saphelp_nw04/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm http://sapdocs.info/sap/bw-bi-bobj/sap-bex-query-designer/ http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

Understanding BEx Query Designer: Part-6 Simple Query Design

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP COMMUNITY NETWORK 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

Você também pode gostar