This lesson teaches you how to use the Query Builder to modify the layout of presentations, and selections for the data that is displayed in crosstabs and graphs.
![]() |
Overview | |
![]() |
Prerequisites | |
This lesson will discuss the following:
![]() |
Modify the Layout of a Crosstab | |
![]() |
||
![]() |
Create Saved Selections | |
![]() |
Modify the Layout of a Graph | |
![]() |
Use Saved Selections and Dimension Conditions | |
![]() |
Summary | |
45 minutes
Move your mouse over this icon to show all screenshots.
You can also move your mouse over each individual icon to see only the screenshot
associated with it.
The Query Builder provides a simple user interface to define sophisticated queries. A key strength of the Query Builder is that the end-user does not need to know a query language to define the query.
Lesson Objectives
In this lesson, you will learn how to create powerful analytic queries that are made simple by presenting the query definition in business terms. End users can easliy modify these queries to meet their needs using the same simple interface.
You will use the Query Builder to modify the layout and selections for the data that appears in a crosstab and a graph. Specifically, you will learn how to:
![]() |
Select Query Items The Query Builder presents the available measures for query in a format that is identical to the Items step of the Presentation Wizard. You can use this interface to add and remove query items for a presentation at any time.
|
||||||||||||||||
![]() |
Modify the Query Layout The Query Builder provides a graphical layout tool that lets you modify the layout of your query for a Crosstab or a Graph.
|
||||||||||||||||
![]() |
Specify Dimension Selections The Query Builder provides three ways to specify selections for the dimensions in a query:
The Query Builder also has two tabs that reveal the contents of the current dimension selection before you execute the query:
|
||||||||||||||||
Data Model
For information on the data model used in the BI Beans OBE lessons, please see the Data Model page.
High Level Objectives
The general business requirements of the BI Beans OBE lessons are described in the Business Requirements page.
In order for this lesson to work successfully, you will need to have performed the following:
| 1. | Complete the lesson titled 'Creating Business Intelligence (BI) Objects'
|
You can change the layout of the dimensions in a crosstab by using the Query Builder.
Perform the following steps to change the layout of the dimensions in the Sales Analysis crosstab:
| 1. |
If the crosstab that you defined in the previous lesson is not already open, in the Applications-Navigator pane, right-click Sales Analysis Crosstab and click Open.
|
|||||||||
| 2. | On the toolbar in the upper left corner of the crosstab, click the Query Editor tool. The Query Editor tool launches the re-entrant Query Wizard.
|
|||||||||
3. |
In the Query Wizard, select the Layout tab. Note: The Layout tab that is contained within the re-entrant Query Wizard is also represented as a Step in the Presentation Wizard. In the previous lesson, the instructions for creating your crosstab and graph did not include steps that demonstrated this Query Builder feature. Therefore, you can also specify the layout of a presentation object when you first create that object.
|
|||||||||
| 4. | To rearrange dimensions, select a dimension, and use a drag-and-drop operation to move the dimension to the desired position. Rearrange the dimensions so that the layout appears as follows:
Click OK to to apply the changes and exit the wizard.
|
|||||||||
| 5. | Observe that the layout of the crosstab has changed. From the File menu, select Save All to save your work.
|
|||||||||
As stated in the Overview section, you can modify dimension selections in an ad-hoc fashion by selecting from a list of available dimension members.
Here, you will use this method to modify the selections for the data that appears in your crosstab in order to show the Sales Revenue for the sub regions and countries of Americas, at the Product Division level, for All Channels of distribution.
Follow these steps to modify the dimension selections for the Geography, Channel, and Product dimensions:
![]() |
Change the Geography Selection | |
![]() |
Change the Channel Selection | |
![]() |
Change the Product Selection | |
To change the Geography selection to the sub-regions and countries within Americas, perform the following steps:
| 1. | Click
the Query Editor tool on the toolbar of the
Sales Analysis Crosstab.
The re-entrant Query Wizard is opened.
|
| 2. | In the Query Wizard, select the Dimensions tab. Note: The Dimensions tabs that is contained within the re-entrant Query Wizard is also represented as Steps in the Presentation Wizard. In the previous lesson, the instructions for creating your crosstab and graph did not include steps that demonstrated this Query Builder feature. Therefore, you can also specify the dimension selections for a presentation object when you first create that object.
|
| 3. | In the Choose box, select Geography. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 4. | In the Available list, select the Members tab and click the drill symbol ('+'), which is located to the left of World total, then again click the drill symbol ('+') to expand Americas. The list of sub-regions appears. Click the drill symbol ('+') located to the left of Northern America and Southern America to display the countries associated with each sub-region. Using the mouse and the 'Shift' key, multi-select the following Geography dimension members: 'Americas', 'Northern America', 'Canada', 'United States of America', 'Southern America', 'Argentina' and 'Brazil'.
|
| 5. | Click the Add Selected Items shuttle button ('>') to move Americas group to the Selected List. Click Apply to apply the changes. Do not exit the Query Wizard.
|
To modify the Channel selection to include all channels of distribution, perform the following steps:
| 1. | Ensure that the Dimensions tab is selected in the Query Wizard. In the Choose box, select Channel.. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 2. | In the Available list, click the drill symbol ('+'), which is located to the left of Channel total. Then, click on the Add all Items shuttle button ('>>') to move all of the channels to the Selected list. Click Apply to apply the changes. Do not exit the Query Wizard.
|
To change the Product selection to Total Products and the Products Divisions, perform the following steps:
| 1. | Ensure that the Dimensions tab is selected in the Query Wizard. In the Choose box, select Product. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 2. | In the Available list, select Product total. Click the Add Selected Items shuttle button ('>') to move Product total to the Selected list.
|
| 3. | In the Selected list, select Product total. Click the drill symbol ('+') to expand Product total. The list of product categories appears. Click OK to apply the changes and exit the Query wizard. The crosstab should display in the following format:
|
| 4 . |
From the File menu, click Save All to save your work.
|
As stated in the Overview section, you can save defined dimension selections. These saved selections can then be reused in other queries.
In this topic, you will create two saved selections for the Geography dimension that will be used later in these lessons.
To create the saved selections for the Geography dimension, follow these steps:
| 1. | Click the Query Editor tool on the toolbar of the Sales Analysis Crosstab.
|
||||||||||||||||||
| 2. | In the Query Wizard, click the Dimensions tab and select Geography in the Choose box. The current selection for Geography dimension is displayed in the Selected region.
|
||||||||||||||||||
| 3. | Click the Save button at the bottom of the Selected region. The Save Selection As dialog box is displayed.
|
||||||||||||||||||
| 4. | In the Save Selection As dialog box, enter America Areas as the name. Accept the default Save steps option and click OK to return to the Query Wizard. Notes: Saved steps: The "Save steps" option creates an XML object that records the steps that result in the dimension selection. This object can be thought of as a dynamic saved selection. For example, if you create a saved selection that contains a condition, you should choose this option. Each time the query is run, this kind of saved selection is re-evaluated using the current state of the dimension. Saved members: The "Save members" option creates an XML object that records a static list of values that are specified for the dimension when the saved selection is created. Therefore, this object contains a list of dimension members that never change.
|
||||||||||||||||||
| 5. | Now, still in the Query Wizard's Dimension tab, create a second regional selection for European Regional members by following these steps:
The new saved selections are ready for reuse.
|
||||||||||||||||||
| 6. | Use America Areas as the default selection for the crosstab. To do this:
To preview the members that will be returned by a saved selection, click the Members tab in the Selected region.
|
||||||||||||||||||
| 7. |
Click OK to close the Query Wizard.
|
||||||||||||||||||
| 8. | From the File menu, select Save All to save your work. Then, close the crosstab.
|
||||||||||||||||||
You can change the layout of the dimensions in a graph by using the Query Builder.
Use the following steps to change the layout of the dimensions that are displayed in the Sales Analysis graph so that the bars of the graph represent Product, and they are grouped by Channel.
| 1. | If the graph that you defined in the previous lesson is not already open, right-click Sales Analysis Graph and click Open.
|
|||||||||
| 2. | In the toolbar of the Sales Analysis Graph, click the Query Editor tool. The re-entrant Query Wizard is opened.
|
|||||||||
| 3. | In the Query Wizard, select the Layout tab.
|
|||||||||
| 4. | To rearrange dimensions, select a dimension, and use a drag-and-drop operation to move the dimension to the desired position. Rearrange the dimensions so that the layout appears as follows:
Click OK to to apply the changes and exit the wizard. The modified layout of the graph is shown here:
|
|||||||||
| 4. | From the File menu, select Save All to save your work.
|
|||||||||
As stated in the Overview section, you can modify the data selections in a presentation by using Saved Selections and creating Dimension Conditions.
For the Sales Analysis graph, you will modify the Geography dimension by using a Saved Selection that you created previously. In addition, you will create a ranking condition that returns the top 5 products in the Photo division, based on Sales Revenue for each Geography, Channel, and Time dimension member in the query. Finally, you will select Channel dimension members using the Members tab, as you did with the crosstab.
Follow these steps to modify the selections for the graph:
![]() |
Change the Geography Selection Using a Saved Selection | |
![]() |
Change the Product Selection Using a Condition | |
![]() |
Change the Channel Selection | |
![]() |
Test the Ranking Condition | |
Change the Geography Selection Using a Saved Selection
To modify the Geography selection by applying a Saved Selection, perform the following steps:
| 1. |
Click the Query Editor tool on the toolbar of the Sales Analysis Graph. Select the Dimensions tab in the Query Wizard.
|
| 2. | In the choose box, select Geography. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 3. | In the Available region, click the Saved Selections tab. Your two Geography Saved Selections are displayed. Select America Areas and then click the Add Selected Items shuttle button ('>') to move the saved selection to the Selected List.
|
Change the Product Selection Using a Condition
To specify the ranking query, you will construct the following Steps for the Product dimension in Query Builder:
![]() |
Select all the products in the Photo division | |
![]() |
Keep only the top 5 Products based on the Sales revenue | |
To create the Product ranking condition, perform the following steps:
| 1. | Ensure that the Dimensions tab is selected in the Query Wizard. In the Choose box, select Product. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 2. | In the Members tab of the Available list, expand Product total by clicking on the drill symbol ('+'). Select Photo and click the Add Selected Items shuttle button ('>') to move Photo to the Selected list.
|
| 3. | In the Available list, select the Conditions tab.
|
| 4. | In the Conditions list, there are templates that can be customized to match the condition that you want to specify. Expand the Top/Bottom folder and select the template Top 10 based on Sales Revenue. Click the Add Selected Items shuttle button ('>') to move the condition to the Selected list.
|
| 5. | In the Selected list, select the Top 10 condition. Click
the first hypertext link: ‘Add’. Select ‘Then
Keep’ from the list.
|
| 6. | In the condition, click the '10' hypertext link and change it to '5' so that the condition reads as follows: Keep Product: Top 5 based on Sales Revenue This condition will Keep the top 5 products in the Photo division. This means the Photo division member itself will not be part of the member selection that is returned by this condition.
|
| 7. | Now, you will qualify this ranking condition so that it will be re-evaluated when any new Geography or Time member is selected from the Page dimension tiles in the graph. First, click the Edit Step tool (pencil icon) to display the Edit Step box.
|
| 8. | An OLAP ranking condition returns the appropriate dimension members for the condition by using a specific combination of values for the remaining,or qualifying, dimensions in the query. The values for these dimensions are displayed in the For box. For example, as shown in the Edit Step dialog above, our ranking condition would return the top 5 products for Channel total, Americas, Promotion total and 1998. In an OLAP ranking condition, you can use the Qualify button to select a different dimension member for each of the qualifying dimensions in the query. Even more, you can specify that the ranking condition should be re-executed each time you select a new member from a qualifying dimension that is in the Page Items region of the crosstab. To do this, choose the Selected <Dimension> page item option in the dimension value drop-down list. Click on the Qualify button. The Qualify Measure-Sales Revenue dialog box opens.
|
| 9. | In the column ‘Include Sales Revenue In’, select Each Geography for the Geography dimension.
|
| 10. | In the column ‘Include Sales Revenue In’, select Each Time for the Time dimension. Click OK. The Edit Step dialog box now shows that the "Top 5 Products" condition will be re-evaluated for all Geography and Time dimension members, but will only be evaluated for the Channel total and Promotion total dimension members. Click OK to complete the condition and close the Edit Step dialog box.
|
| 11. | Click the Sort button below the Selected list in the Query wizard to display the Sort Members dialog box. Choose the Sort members by option and then click Add. The Edit Sort Criterion dialog box opens.
|
| 12. | In the Edit Sort Criterion dialog, select Product name from the Sort By options list, then click OK. The Sort Members list box will show the condition as follows: Click OK to close the Sort Members dialog box.
|
| 13. | In the Query Wizard, click Apply to apply the changes. Do not exit the Query Wizard. |
To modify the Channel selection, perform the following steps:
| 1. | In the Choose box, select Channel. Click the Remove All Items shuttle button ('<<') to remove the current selection.
|
| 2. | In the Available list, select the Members tab. Click the drill symbol ('+'), which is located to the left of Channel total to expand it. Click on the Add all Items shuttle button ('>>') to move all the channels to the Selected list. Click OK to apply the changes and close the Query Wizard. The graph will look as shown below:
|
| 3. | From the File menu, select Save All to save your work.
|
To test the ranking condition perform the following steps:
| 1. | Click the Time dimension and select 1999. The graph updates with a new set of top 5 products.
|
| 2. | Click the Geography dimension and select Canada. The graph updates with a new set of top 5 products. Click the Geography dimension and select Argentina. Once again, the graph updates with a new set of top 5 products. Notice that there is only one channel of distribution in Agentina - Direct. Once again, click the Geography dimension and select Americas. The graph updates with a new set of top 5 products. From the File menu, select Save All to save your work. Choose File > Close to close the graph.
|
In this lesson you learned how to use the Query Builder to:
![]() |
Select measures for a query. | |
![]() |
Modify the layout of presentations | |
![]() |
Specify dimension selections that define the data that is displayed in crosstabs and graphs. | |
In the next lesson, you will learn how to create highly-formatted crosstabs and graphs using the Presentation Editor.
Move your mouse over this icon to hide all screenshots