Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 34 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
34
Dung lượng
1,53 MB
Nội dung
Chapter 9: Creating Queries Contents Overview 9–2 Creating and Saving a New Query 9–3 Defining a Filter in a Query 9–9 Creating Restricted Key Figures 9–10 Creating a New Formula—Percentage Change InfoObject 9–12 Creating a Calculated Key Figure 9–14 Working with BW Queries: Additional Functions 9–16 Review 9–34 Report Development Tools In this chapter you will learn how to: Create and save a new query Define filters in a query Create restricted key figures and calculated key figures in a query Create new formulas in a query Work with drilldown, currency conversion, charts, and other BW query functions 9–1 Chapter 9: Creating Queries Overview Overview In chapter you learned how to: < Build a workbook template < Insert an existing query into a workbook < Save a workbook to the InfoCatalog Queries define the structure of a workbook in the Business Explorer (BEx) Analyzer In the previous chapter you learned how to insert Bungee Software’s Sales Analysis query into a workbook With the help of a guided tour, you will now learn how to create the same query During the query building process, you will learn how to define filters, create restricted key figures, and create calculated key figures Later in the chapter we cover additional features and functions to help you work with BW queries Create a workbook Create a workbook template (optional) template (optional) Insert desired query (or queries) Insert desired query (or queries) into a workbook into a workbook Enhance workbook layout Enhance workbook layout and functionality (optional) and functionality (optional) Create a new query or Create a new query or modify an existing query modify an existing query Chapter Enable access to a workbook Enable access to a workbook through the BEx Browser through the BEx Browser Chapter 10 Chapter You are here Before Getting Started Before you start building a query, it is important to have a clear understanding of the user requirements For instance, Bungee Software executives primarily request sales revenue and gross profit data, grouped by organization, product, customer, and sales employee Thus, the relevant characteristics are Sales Organization, Distribution Channel, Division, Material, Material Group, Customer, and Sales Employee The relevant key figures are Sales Revenue and Gross Profit Users can include key figures and characteristics in one or more queries 9–2 Reporting Made Easy Chapter 9: Creating Queries Creating and Saving a New Query In this example, we separate the sales revenue and the gross profit information into two different queries: < Sales analysis query (0D_SD_DEMO_Q0001): First, you will learn how to build the sales analysis query, including the creation of restricted key figures < Gross profit analysis query (0D_SD_DEMO_Q0002): Next, you will learn to build the gross profit analysis query, including the creation of calculated key figures Creating Queries Based on the SAP DemoCube Before you can start creating the queries covered in this chapter, you must make sure that the SAP-delivered DemoCube is available in your BW system The SAP DemoCube is available with BW Release 1.2B (patch 8) To work with the sample queries shown in this guide, you may need to activate the contents of the SAP DemoCube and upload the data to your system For help activating the SAP DemoCube, see your system administrator Information on the SAP DemoCube can also be found in chapter 11 Now let us return to the BEx Analyzer to start creating the sales analysis query Guided Tour Creating and Saving a New Query To create a new query, New from the choose Business Explorer toolbar Report Development Tools 9–3 Chapter 9: Creating Queries Creating and Saving a New Query If you are already logged on to the BW system, jump to step If not, follow the onscreen prompts to log on to the BW system Choose Choose the InfoCubes for new query folder to get an expanded list of the demo cubes Expand the SAP Demo area and choose the SAP DemoCube Choose OK 9–4 Reporting Made Easy Chapter 9: Creating Queries Creating and Saving a New Query Take a few moments to familiarize yourself with the Define query: New query window You can define queries simply by dragging and dropping available objects (from the left side) to the Definition area on the right Expand the SAP DemoCube InfoCube to view the Key figure and Dimensions folders Query toolbar: See next page to learn more You can drag and drop characteristics and key figures to the Filter, Free Characteristics, Columns, and Rows areas, depending on how you want to set up your queries Query layout appears in this window Characteristic: A criterion (for example, plant, material, company code, etc.) used to select data Dimension: A logical grouping of characteristics Key Figure: A value you can report on Free Characteristics: Fields that can be defined to provide values according to whatever criteria you select Report Development Tools 9–5 Chapter 9: Creating Queries Creating and Saving a New Query The Query Toolbar To help you become familiar with the Query toolbar, the following table shows how the various buttons are used during query definition Button Use to… Transfer a query to a workbook Exit the query Create a new query Open an existing query Save a query Save a query with a different name Delete a query View query information, maintain the display format, and release the option of OLE DB for OLAP Check the definition of a query View where a query is used in all workbooks Switch between displaying or maintaining a query View the context menu to display the technical names of the fields in Query definition Open the BEx help file 9–6 Reporting Made Easy Chapter 9: Creating Queries Creating and Saving a New Query Define Rows: From the Organization dimension, drag the Company code into the Rows area Define Columns: From the Key figure folder and the Time dimension, drag Sales Revenue and Calendar Year into the Columns area 10 Define Free Characteristics (using drag and drop): From the Organization dimension, drag Sales organization, Distribution channel, and Division From the Customer dimension, drag Soldto-Party/Industry From the Sales employee dimension, drag Sales employee From the Product dimension, drag Material group and Material SAP (Demo) From the Time dimension, drag Calendar year/quarter 10 Note: The format of the query is shown in the lower right corner You may want to avoid expanding the tree in the Available objects area unless necessary Because there are thousands of items available (especially for customers and materials), an expanded listing could take some time to navigate In Release.1.2B, you can have a default setting that only lists the first 100 available objects Report Development Tools 9–7 Chapter 9: Creating Queries Creating and Saving a New Query 11 Use drag-and-drop to change the sequence of the InfoObject For instance, to re-position the InfoObject, Sales Employee in the Free Characteristics area, drag the Sales Employee InfoObject and drop it at the Material InfoObject area 12 The InfoObject Sales Employee is repositioned after the Material SAP 11 13 13 Choose Save 12 14 In Technical name, enter a name for the query (for example, ZDEMO) 15 In Description, enter a description for the query (for example, Sales Analysis) 14 15 16 Choose OK to exit the Save query screen You have now created and saved a basic query called Sales Analysis 9–8 16 Reporting Made Easy Chapter 9: Creating Queries Defining a Filter in a Query Defining a Filter in a Query You can use filters to show or hide values depending on your needs Expand the Version dimension Drag 0D_VTYPE into the Filter area Select 0D_VTYPE, rightclick the mouse and choose Restrict to restrict the view of the data (for example, Actual or Plan views) To view the actual data, choose the Single value tab Click Display to get a list of possible entries if needed Choose the value Actual Choose OK Restricting characteristics With the definition of a query it is possible to restrict characteristics to a single characteristic value, a value interval, a hierarchy node or a characteristic value variable For instance, you can create a query, in which all of the InfoCube data is restricted, using the characteristic, Calendar Year and restricting the value interval year 1997 to 1998 Report Development Tools 9–9 Chapter 9: Creating Queries Creating Restricted Key Figures The result of this query will show the value type Actual You have successfully set a filter for your query Creating Restricted Key Figures Restricted key figures are key figures with restricted values For example, in Columns you can define the restricted key figures to limit the display of values within a calendar year instead of using the characteristic, Calendar year to display the value for all available calendar years We will use Sales Revenue to restrict the display to values which fall in calendar years 1998 and 1997 Using the Sales Analysis query, choose from the Available objects area 2 Right-click and select New restricted key figure 9–10 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions Save and Reuse Variable Values If variables that are ready for input are used in a report, you can enter desired values or confirm the default values when embedding the query in an Excel worksheet To save and reuse variable values, choose the Save and reuse variable values option Query ID The technical identification number of the query is displayed as the query ID and cannot be changed Selecting Filter Values for Characteristics To display only the U.S.based company codes, choose a Company Code cell with the value US Right-click and choose Filter and drill down according to, then Sales Organization The report results are now restricted to U.S company codes and displayed by Sales Organization In this example, Company Code 2000 is the key and US is the description 9–20 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions Slice & Dice: Drilling Down Users can view the information by “exchanging” the current display (by Sales Organization) with a different area (for example, Material Group, or even get more product detail by further drilling down to Material) Choose the Sales Organization column Right-click and choose Exchange Sales Organization with, then Material Group Choose the Material Group column Right-click and choose Insert drill down according to, then Material Report Development Tools 9–21 Chapter 9: Creating Queries Working with BW Queries: Additional Functions The report now displays the drilldown results The data is now organized by Material Group and Material Slice & Dice: Drilling Across Instead of viewing the information vertically (drill down), you can also display the information horizontally (drill across) To drill across, choose Calendar Year/Quarter Right-click and choose Drill down → Across 9–22 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions The screen at right shows the results of drilling down by Material, and drilling across by Calendar Year/Quarter The Material information is displayed vertically The Calendar Year/Quarter is displayed horizontally Sorting Data Users can sort the characteristics or key figures in ascending or descending order For example, to find the top-selling material we can sort the sales revenue in descending order Choose a key figure column (for example, 1998 Sales) Right-click and choose Sort descending Report Development Tools 9–23 Chapter 9: Creating Queries Working with BW Queries: Additional Functions The result indicates that Barrio Brothers achieved the highest sales in 1998 Sales of Kung Fu Grandma decreased by 52 percent in 1998 compared to 1997 Note: The annotations in the textbox discuss possible reasons for the dismal sales of Kung Fu Grandma Optional: To sort characteristics, choose a characteristics column (for example, Material) Rightclick and choose Sort Material → Descending according to name Positioning/Hiding the Totals Row Users can change how the totals row is displayed The totals row can be displayed in the top left or the bottom right If needed, the totals row can be hidden from view Choose a cell that is related to a characteristic, such as Material, and right-click the mouse Choose All chars → Suppression of total rows → Never (to hide the totals rows) Choose All chars → Position of totals row to change the position of the totals row 9–24 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions Converting Currencies Since Bungee Software has operations in U.S and Europe, sales revenue is recorded in multiple currencies Currency conversion enables users to translate the values of the query into a joint target currency, database currency, or currencies according to the query definition Therefore, it is possible to display the values in various currencies or unify currency handling and display the values as one currency In the example shown below, the sales revenue currency is being changed from U.S dollars (USD) to Deutsche marks (DEM) Choose a key figure (for example, 1998 Sales) Right-click and choose Currency Translation → According to target currency Report Development Tools 9–25 Chapter 9: Creating Queries Working with BW Queries: Additional Functions Choose F4 to display a list of available target currencies (for example, DM) Choose Enter Choose the SAP-delivered Translation key, 0DDEMO See TechTalk below for more information 6 Choose Execute Sales Revenue is now converted from U.S dollars to Deutsche marks Translation Key Translation key is the name of the currency translation type The values of the query are translated into the desired target currency (or currencies) using a translation type The translation key is defined in the BW Administrator Workbench under Basic Settings → Currencies → Translation Keys 9–26 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions Displaying Reports Graphically: Using Charts The SAP Business Explorer toolbar allows you to attach charts to workbooks The chart evaluates data in the current navigational state, meaning the chart is automatically refreshed when the query is refreshed Using the Gross Profit Analysis report, you will learn how to use charts Choose the desired query cell (for example, Sales Organization) 2 From the SAP Business Explorer toolbar, choose Tools 3 Choose Attach chart The data used to build the initial chart always includes all of the data elements (for example, gross profit, percentage, sales revenue, and cost) Since we want to focus on gross profit, let us redefine the data source Click the chart Right-click and choose Source data Report Development Tools 9–27 Chapter 9: Creating Queries Working with BW Queries: Additional Functions In Data range, define the proper data range Choose OK To define the chart type, click the chart, right-click and choose Chart type 9–28 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions 10 To define the chart type for the Gross Profit Analysis report, choose the Custom Types tab 10 11 From Chart type, choose Blue Pie 12 Choose OK 11 12 13 To define the chart title, legend, data labels, and other options, choose the chart, right-click and choose Chart Options 13 14 Enter the chart title (for example, Gross Profit Analysis) 14 15 Choose OK 15 Report Development Tools 9–29 Chapter 9: Creating Queries Working with BW Queries: Additional Functions 16 To reformat the color of the chart area, choose the chart, right-click and choose Format Chart Area 16 17 In the Border options, select None 18 To customize the background, choose Fill Effects 17 18 19 Define the colors and shading styles 20 20 Choose OK 19 19 9–30 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions 21 Choose OK to exit the Format Chart Area screen 21 22 To format each data chart in a different color, double click a data area 23 In the Format Data Point screen, you have the option to further format the data chart (for example, color, shape, series order, or the gap depth/width in options) 22 23 24 Choose OK 24 25 If needed, the chart can also be assigned to another worksheet or location To this, rightclick the chart and choose Location 25 Report Development Tools 9–31 Chapter 9: Creating Queries Working with BW Queries: Additional Functions 26 The chart can be reassigned to a new worksheet or relocated to a different worksheet (for example, Sales Analysis) 26 27 Choose OK 28 Resize the chart and drag it to the desired position The resulting chart shows gross profit by Sales Organization 28 Modifying an Existing Query The SAP Business Explorer toolbar also provides the option to modify or enhance an existing query Let’s continue with the Gross Profit Analysis report to demonstrate how to modify the existing query Choose the Gross Profit Analysis query Select Change query to change the query 9–32 Reporting Made Easy Chapter 9: Creating Queries Working with BW Queries: Additional Functions Change Choose enhanced in the Change query screen The Gross Profit Analysis query is ready for further enhancement Report Development Tools 9–33 Chapter 9: Creating Queries Review Review < < Queries can be configured using characteristics, filters, key figures, and calculated and restricted key figures < Using the BEx Analyzer, users can easily build queries To define a query, simply drag available objects (key figures, characteristics, and dimensions) and drop them into rows, columns, and free characteristics in the query definition area < Filters can be used to restrict the values that appear in the query < Restricted key figures are key figures with restricted values < Calculated key figures imply that the key figure can be calculated based on a formula < Restricted key figures and calculated key figures are InfoCube-dependent < 9–34 A query is a data evaluation based on the selection of characteristics and key figures Users define queries to analyze the data from an InfoCube With queries you can also: Suppress the display of repeated texts and/or key values Disable the interactive drilldown capability (restricting users from changing saved data in workbooks) Select filter values for characteristics Drill down or across (slice & dice) Sort data Position/hide the totals Convert currencies Display reports graphically Reporting Made Easy .. .Chapter 9: Creating Queries Overview Overview In chapter you learned how to: < Build a workbook template < Insert an existing query into a workbook < Save a workbook to the InfoCatalog Queries. .. Users can include key figures and characteristics in one or more queries 9–2 Reporting Made Easy Chapter 9: Creating Queries Creating and Saving a New Query In this example, we separate the sales... Reporting Made Easy Chapter 9: Creating Queries Creating and Saving a New Query Take a few moments to familiarize yourself with the Define query: New query window You can define queries simply by