xi31_sp3_webi_qry_en

80
Building Queries with SAP BusinessObjects Web Intelligence Query - HTML SAP BusinessObjects XI 3.1 Service Pack 3

Transcript of xi31_sp3_webi_qry_en

Page 1: xi31_sp3_webi_qry_en

Building Queries with SAPBusinessObjects Web IntelligenceQuery - HTML

SAP BusinessObjects XI 3.1 Service Pack 3

Page 2: xi31_sp3_webi_qry_en

© 2010 SAP AG. All rights reserved.SAP, R/3, SAP NetWeaver, Duet, PartnerEdge,ByDesign, SAP Business ByDesign, and other SAP products and services

Copyright

mentioned herein as well as their respective logos are trademarks or registeredtrademarks of SAP AG in Germany and other countries. Business Objects and theBusiness Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, WebIntelligence, Xcelsius, and other Business Objects products and services mentionedherein as well as their respective logos are trademarks or registered trademarksof Business Objects S.A. in the United States and in other countries. BusinessObjects is an SAP company.All other product and service names mentioned arethe trademarks of their respective companies. Data contained in this documentserves informational purposes only. National product specifications may vary.Thesematerials are subject to change without notice. These materials are provided bySAP AG and its affiliated companies ("SAP Group") for informational purposesonly, without representation or warranty of any kind, and SAP Group shall not beliable for errors or omissions with respect to the materials. The only warranties forSAP Group products and services are those that are set forth in the expresswarranty statements accompanying such products and services, if any. Nothingherein should be construed as constituting an additional warranty.

2010-06-23

Page 3: xi31_sp3_webi_qry_en

ContentsAbout Web Intelligence 7Chapter 1

How Web Intelligence performs business intelligence over the web...........8How Web Intelligence performs business intelligence offline......................8Interacting with Web Intelligence reports.....................................................8

Viewing and printing Web Intelligence reports.......................................9Drilling on Web Intelligence reports........................................................9Performing on-report analysis................................................................9

Creating and editing Web Intelligence documents....................................10Web Intelligence Query - HTML...........................................................10Web Intelligence Java Report Panel....................................................11Web Intelligence Rich Client................................................................11Web Intelligence HTML Report Panel..................................................12

Accessing Web Intelligence from InfoView 13Chapter 2

To log in to InfoView...................................................................................14To log out of InfoView................................................................................15Web Intelligence InfoView options.............................................................15

Web Intelligence document creation and viewing options...................15To set Web Intelligence drill options.....................................................20Web Intelligence locale options............................................................22

Returning data using queries 27Chapter 3

Creating, editing and saving documents...................................................28To save a document.............................................................................28

Building and working with queries.............................................................28To build and run a query.......................................................................28

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 3

Page 4: xi31_sp3_webi_qry_en

To rename a query...............................................................................30To interrupt a query..............................................................................31To remove a query................................................................................31Multiple queries....................................................................................31To add a query......................................................................................32To duplicate a query.............................................................................33Viewing the SQL generated by a query................................................33

Setting the scope of analysis.....................................................................34Scope of analysis.................................................................................34Levels of scope of analysis..................................................................35To set the scope of analysis.................................................................36

Query contexts...........................................................................................36What is an ambiguous query?..............................................................36What is a context?................................................................................37Choosing a context when you run a query...........................................37

Web Intelligence query properties.............................................................37Allow other users to edit all queries property.......................................37Max retrieval time query property.........................................................38Max rows retrieved query property.......................................................38Query prompt order..............................................................................38Retrieve duplicate rows query property................................................39Query Stripping....................................................................................39Reset contexts on refresh query property............................................40Clear contexts query property..............................................................41Sample result set query property.........................................................41

Filtering data using query filters 43Chapter 4

Query filters defined...................................................................................44Query filters and report filters compared...................................................45Types of query filter...................................................................................45

Predefined query filters........................................................................46

4 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Contents

Page 5: xi31_sp3_webi_qry_en

Custom query filters.............................................................................46Query filter and prompt operators........................................................50Combining query filters.........................................................................54

Filtering queries with the Keydate variable................................................57To set the keydate for a single query in the query panel......................57To set the keydate for multiple queries in the query panel ..................58

Filtering data using prompts 59Chapter 5

What is a prompt?......................................................................................60Merged prompts...................................................................................61

Cascading prompts....................................................................................61Hierarchical lists of values.........................................................................62Query filter and prompt operators..............................................................62

Equal To operator.................................................................................62Not Equal To operator..........................................................................62Different From operator........................................................................62Greater Than operator..........................................................................63Greater Than Or Equal To operator......................................................63Less Than operator..............................................................................63Less Than Or Equal To operator..........................................................63Between operator.................................................................................63Not Between operator..........................................................................64In List operator.....................................................................................64Not In List operator...............................................................................64Matches Pattern operator.....................................................................64Different From Pattern operator...........................................................65Both operator........................................................................................65Except operator....................................................................................65

To create a prompt in Query - HTML.........................................................66Defining how prompts display..............................................................66

To remove a prompt...................................................................................67

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 5

Contents

Page 6: xi31_sp3_webi_qry_en

Combining prompts....................................................................................68Combining prompts with query filters...................................................68

To change the order of prompts in Query - HTML.....................................68

More Information 69Appendix A

Index 73

6 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Contents

Page 7: xi31_sp3_webi_qry_en

About Web Intelligence

1

Page 8: xi31_sp3_webi_qry_en

HowWeb Intelligence performsbusinessintelligence over the web

Web Intelligence provides business users with an easy to use interactiveand flexible user interface for building and analyzing reports on corporatedata over the web, on secured intranets and extranets. The Web Intelligencesoftware is installed by your administrator on a web server on your corporatenetwork.

To use Web Intelligence from your local computer, you log into the businessintelligence portal InfoView via your Internet browser. Then, depending onyour security profile, you can interact with the reports in corporate documentsor edit or build your own documents using a Web Intelligence report panelor query panel.

HowWeb Intelligence performsbusinessintelligence offline

Web Intelligence can be used offline as Web Intelligence Rich Client, astandalone Microsoft Windows application, equivalent to the Java ReportPanel, that you can install on your computer. Web Intelligence Rich Clientlets you continue to work with Web Intelligence (WID) documents when youare unable to connect to a CMS, when you want to perform calculationslocally rather than on the server, and when you want to work with WebIntelligence documents without installing a CMS or application server.

Web Intelligence Rich Client can also be used when connected to a CMS.

InteractingwithWeb Intelligence reportsDepending on your security profile and on how Web Intelligence is deployedacross your organization, you can view, analyze, or enhance and modify thedata displayed on reports.

8 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

About Web Intelligence1 How Web Intelligence performs business intelligence over the web

Page 9: xi31_sp3_webi_qry_en

Viewing and printing Web Intelligence reports

Once logged into the business intelligence portal InfoView, you can accessWeb Intelligence documents and view reports. Onscreen navigation is madeeasy with page-to-page navigation buttons and a document map that allowsyou to jump from section to section or report to report.

The same document can provide the information adapted to each user dueto prompts that request each user, who opens the document, to specify thedata they want to return to the reports.

When you print, Web Intelligence automatically generates a copy of reportsin Portable Document Format (PDF) format for optimum print quality. Youcan print reports directly from the Web Intelligence Java Report Panel orWeb Intelligence Rich Client without exporting to PDF.

Drilling on Web Intelligence reports

Drilling on Web Intelligence reports enables you to analyze the detailed databehind the displayed results. You can turn the report you are viewing into adrillable report or drill on a duplicate of the original report to retain a versionof the results before your drill analysis.

Once you have found the information you need, you can save a snapshotof the drilled report to share the results of your analysis with other WebIntelligence users, or save the document in Excel or Portable Document(PDF) format to print or email to other business contacts.

Performing on-report analysis

Viewing Web Intelligence reports in Interactive view format enables you toenhance reports and fine-tune the data reports contain, to highlight theinformation that most interests you on demand.

On-Report Analysis is designed for:

• users who need to build queries and then want to build reports• report consumers who need to manipulate the reports created by others

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 9

1About Web IntelligenceInteracting with Web Intelligence reports

Page 10: xi31_sp3_webi_qry_en

With On-Report Analysis you can:

• view document metadata to understand the data behind reports and seehow reports are structured and filtered

• filter and sort results• add new tables and charts• add formulas and create variables• format and change the layout of charts and tables• slice and dice results by adding other data to charts and tables

Note:On-report analysis of Web Intelligence reports in Interactive view format isonly available if your administrator has deployed Web Intelligence in JSPmode.

Creating and editing Web Intelligencedocuments

You can create or edit Web Intelligence documents using the Web IntelligenceHTML Report Panel, Web Intelligence Query - HTML, Web Intelligence inInteractive mode, the Web Intelligence Java Report Panel and WebIntelligence Rich Client.

Web Intelligence Query - HTML

Designed for users requiring a pure HTML environment to build queries,Web Intelligence Query – HTML offers the ability to define the data contentof documents on multiple data sources. You can use Query – HTML to createnew documents from scratch or edit the queries in documents created usingany of the other Web Intelligence tools.

Used together with On-Report Analysis, Query – HTML provides a completesolution for building queries and designing powerful reports in a pure HTMLenvironment. Once you have run the queries to generate a standard report,you can leverage Web Intelligence On-Report Analysis features to formatmultiple reports, add formulas, and create variables.

10 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

About Web Intelligence1 Creating and editing Web Intelligence documents

Page 11: xi31_sp3_webi_qry_en

Note:Web Intelligence Query – HTML and On-Report Analysis in Interactive viewformat are only available, if your administrator has deployed Web Intelligencein JSP mode.

Web Intelligence Java Report Panel

The Java Report Panel is designed for users who need more flexibility withdesigning report layout and defining formulas and variables. A graphicalFormula Editor enables you to build formulas rapidly using drag-and-drop.

Note:The Web Intelligence Java Report Panel is available if your administratorhas deployed Web Intelligence in ASP mode and if your administrator hasdeployed Web Intelligence in JSP mode.

Web Intelligence Rich Client

Web Intelligence Rich Client is a locally installed Microsoft Windowsapplication that lets you work with Web Intelligence (WID) documents thatare stored locally or in a CMS.

When working without a CMS connection you can work on your local machinewith either CMS-secured or unsecured documents.

Web Intelligence Rich Client is based on the Web Intelligence Java ReportPanel and provides equivalent document creation, editing, formatting, printingand saving capabilities.

There are a number of reasons for using Web Intelligence Rich Client towork with WID documents:

• You want to work with Web Intelligence documents but you are unableto connect to a CMS (while traveling, for example).

• You want to improve calculation performance: Web Intelligence RichClient performs calculations locally, rather than on the server, and localcalculations can perform better than server calculations.

• You want to work with Web Intelligence documents without installing aCMS or application server.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 11

1About Web IntelligenceCreating and editing Web Intelligence documents

Page 12: xi31_sp3_webi_qry_en

Web Intelligence HTML Report Panel

Designed for users who need to build basic reports, the HTML Report Panelprovides query and report features in a simple wizard-like interface. Eachdocument is based on a single data source and can contain multiple reports,displaying different subsets of information.

In addition, the HTML Report Panel is 508 compliant and can be customizedfor specialized deployments.

Note:The Web Intelligence HTML Report Panel is only available if youradministrator has deployed Web Intelligence in JSP mode.

12 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

About Web Intelligence1 Creating and editing Web Intelligence documents

Page 13: xi31_sp3_webi_qry_en

Accessing Web Intelligencefrom InfoView

2

Page 14: xi31_sp3_webi_qry_en

You access Web Intelligence reports and set global Web Intelligence optionsfrom InfoView, the corporate business intelligence portal.

To log in to InfoViewBefore you can use InfoView and Web Intelligence you need the followinginformation:

• a URL to the InfoView server• the InfoView server name and port number• your login and password• your authentication, which controls the InfoView resources available to

you

Contact your adminstrator for these details if you do not already know them.

Note:By default the InfoView server name and authentification method are notdisplayed on the InfoView logon page. You need to supply this informationonly if your administrator has made these options visible.

You access Web Intelligence by using your web browser to log into InfoView,the corporate business intelligence portal. Once you are in InfoView, youcan analyze and enhance Web Intelligence reports.

1. Launch your web browser.2. Point your browser to the InfoView bookmark or URL.

The InfoView login page appears.

3. If the System box is blank, type the name of the InfoView server followedby a colon (:), and then type the port number.

4. In the Username box, type your user name.5. In the Password box, type your password.6. In the Authentication box, select the authentication provided to you by

your administrator.7. Click Log On.

The InfoView home page appears.

14 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 To log in to InfoView

Page 15: xi31_sp3_webi_qry_en

To log out of InfoViewWhen you finish using InfoView or Web Intelligence you need to log out,instead of simply closing your web browser.

Logging out of InfoView ensures that any preferences you modified duringyour InfoView session are saved. It also lets your administrator track howmany users are logged into the system at any given time and thus optimizeInfoView and Web Intelligence performance.

• Click Log Out.The login page appears. You are logged out of InfoView

Web Intelligence InfoView options

Web Intelligence document creation and viewingoptions

You can set your Web Intelligence options to determine how you create,view and interact with documents using Web Intelligence.

You create documents using a query editor to build the query to retrieve thedocument data. After the query returns the data to the document, you canview and interact with the data.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 15

2Accessing Web Intelligence from InfoViewTo log out of InfoView

Page 16: xi31_sp3_webi_qry_en

DescriptionDocument creation option

You create documents using theJava Report Panel, a Java appletthan launches in your Web brows-er.

The Java Report Panel is a com-bined query building, report editingand data analysis environment. Ifyou choose Advanced as yourdocument creation option, you alsouse the Java Report Panel forworking with the data returned bythe query. The Select a defaultview format option is not taken intoaccount.

The Java Report Panel providesthe richest feature set of all WebIntelligence query building, reportediting and data analysis environ-ments.

Advanced

You build queries using Query -HTML, an HTML-based query editor.Interactive

You build queries, edit reports andanalyze data using Web Intelli-gence Rich Client, a standaloneversion of the Java Report Panelthat runs outside your web browser.

Desktop

You create reports using the HTMLReport Panel, a 508-compliant queryand report building environment.

Web Accessibility

You can use the following view formats to view and interact with existingWeb Intelligence documents, or documents that you have just created usinga query editor:

16 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 17: xi31_sp3_webi_qry_en

DescriptionView format

Use Web (HTML) format when youwant to open reports, answerprompts, navigate reports, and/orperform drill analysis.

Web

Use Interactive format when youwant to apply filters, sorts, calcula-tions, modify formatting and datadisplayed on tables and charts,and/or perform drill analysis.

Use Interactive format if you are us-ing Query – HTML to define queries,and you want to format reports basedon those queries and add formulasand variables.

Interactive format + Query HTMLprovides an approximate equivalentto the Java Report Panel or Web In-telligence Rich Client, in a pureHTML environment.

You can also use Interactive formatto view and work with reports gener-ated from the HTML Report Panel.Unline Query - HTML, which is apure query-building environment, theHTML Report Panel also allows youto define reports. After running yourquery, you can continue to work withthe report either by using Interactiveformat, or by returning to the HTMLReport Panel.

Interactive view format is only avail-able if your administrator has de-ployed Web Intelligence in JSPmode.

Interactive

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 17

2Accessing Web Intelligence from InfoViewWeb Intelligence InfoView options

Page 18: xi31_sp3_webi_qry_en

DescriptionView format

Use PDF mode when you want to viewstatic reports.PDF

To select the Web Intelligence query editor

1. Click the Preferences button on the InfoView toolbar.2. Click Web Intelligence Preferences to display the Web Intelligence

options.3. Select the query editor beneath Select a default creation/editing tool.4. Click OK.

To select the Web Intelligence view format

You can select different view formats for Web Intelligence documentsdepending on how you want to interact with the information displayed on thereports. You select your Web Intelligence view options in InfoView. Whenyou modify your view options, the new settings are implemented the nexttime you open a Web Intelligence document.

1. Click the Preferences button on the InfoView toolbar.2. Click Web Intelligence Preferences to display the Web Intelligence

options.3. In the Select a view format section, select the view format.

To select a default universe for new documents

1. Click Preferences on the Infoview toolbar.2. ClickWeb Intelligence Preferences to display the Web Intelligence

options.3. Click Browse beneath Select a default universe and browse to the

universe you want to select as the default.

18 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 19: xi31_sp3_webi_qry_en

Refresh option in Infoview

With SAP BusinessObjects XI 3.1 SP3 refresh of Web Intelligence documentscreated from custom data sources like text, excel files and Custom DataProvider plug-in are supported in Infoview.

Note:The refresh option is available for Windows operating system only.

To refresh a text or excel file, set the RefreshOnServer registry to thefollowing values:

RefreshOnServer = NO or Disable to disable refresh on Server.

RefreshOnServer = YES or ENABLE to enable refresh on Server, bydefault it is set to YES or Enable.

RefreshOnServer = ALLOW_USE_WINDOWS_SHARE to enable refreshon Windows server only.

The registry path is: HKEY_LOCAL_MACHINE > SOFTWARE > BusinessObjects > Suite 12.0 > Default > Web Intelligence > Calculator > PDP.

Before refreshing a document from Infoview make sure that the followingpoints are taken care:1. The Custom Data Provider has to be on the BOE server, if it is clustered

then each and every cluster needs to be updated with the same copy ofCustom Data Provider.

2. Incase of a blocker issue and the file cannot be accessed from its originalsource location then the file should be placed in the default location foreach server.

The default server path is <Installdir>BusinessObjects\PersonalDPFilessymantec, you can change this path bychanging the value of Server_Path in the registry.

3. The Server Intelligence Agent (SIA) should be managed by a userauthentication valid in the network domain. Normally SIA is managedusing local system account; this practice is not recommended whendeploying Custom Data Provider in server.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 19

2Accessing Web Intelligence from InfoViewWeb Intelligence InfoView options

Page 20: xi31_sp3_webi_qry_en

4. For refreshing a document based on Generic WS, update thenet.properties file present at: <Installdir>\javasdk\jre\lib withthe following lines:

http.proxyHost=bluecoat-proxyhttp.proxyPort=8080http.nonProxyHosts=localhost|127.0.0.1|10.

Where, proxyHost is the name of the proxy server (e.g.proxy.mydomain.com),

proxyPort is the port number to use (default value is 80),

nonProxyHosts is a '|' separated list of hostnames which should beaccessed directly, ignoring the proxy server (default value is localhost &127.0.0.1)

Note:The .pac files are not supported, you have to explicitly configure the proxyserver in the proxy settings for the URL.

To set Web Intelligence drill options

Drilling on reports lets you look deeper into data to discover the details behinda good or bad summary result displayed on a table, chart, or section. Beforeyou begin a drill session, you can set your drill options in InfoView to specifyhow reports will change each time you drill.

1. Click Preferences on the Infoview toolbar.2. Click Web Intelligence Preferences to display the Web Intelligence

options.3. Select the drill options under Drill options and Start drill session.

Hide drill toolbar option

When you drill on a value displayed on a report, the Drill toolbar appearsand displays the value on which you drilled. The value displayed on thetoolbar filters the results displayed on the drilled report.

20 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 21: xi31_sp3_webi_qry_en

For example, if you drill on year 2001, the results displayed on the drilledtable are Q1, Q2, Q3, and Q4 for year 2001. This means that the quarterlyvalues you drilled to are filtered by 2001.

Note:If the drilled report includes dimensions from multiple queries, a ToolTipappears when you rest your cursor on the value displayed on the filter. TheToolTip displays the name of the query and the dimension for the value.

The Drill toolbar allows you to select alternative values on the same level,in order to filter the results differently. For example, if you use the Drill toolbarillustrated above to select “2002, ? the results displayed on the drilled tablewould be Q1, Q2, Q3, and Q4 for year 2002.

You can opt to hide the Drill toolbar when you start drill mode. The Drilltoolbar is only useful if you want to select filters during your drill session.

Prompt when drill requires additional data option

When you drill the results displayed on a Web Intelligence report, you maywant to drill to higher- or lower-level information that isn’t included in thescope of analysis for the document. When this is the case, Web Intelligenceneeds to run a new query to retrieve the additional data from the data source.

Since queries on large selections of data may take a long time to becompleted, you can choose to be prompted with a message every time anew query is necessary. The prompt message asks you whether you wantto run the additional query or not. In addition, the prompt lets you apply filtersto the extra dimensions you include in the new query. This means you canrestrict the size of the query to only the data necessary for your analysis.

You need permission from your administrator to drill out of the scope ofanalysis during a drill session.

Synchronize drill on report blocks option

When you select theSychronize drill on all report blocks option, the displayof all blocks changes to correspond with your drill actions. For example, ifyou drill down on a block from year to quarter, and your report also containsa chart showing data by year, the chart display also changes to display databy quarter.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 21

2Accessing Web Intelligence from InfoViewWeb Intelligence InfoView options

Page 22: xi31_sp3_webi_qry_en

If you do not select the option, only the drilled block changes in response todrill actions.

Start drill session option

The Start drill session option controls how Web Intelligence behaves whenyou start drill mode.

Start drill session on existing report optionWhen you select Start drill session on existing report, the current reportbecomes drillable when you start drill mode. When you end drill mode, thereport displays the drilled values.

Start drill session on a duplicate report optionWhen you select Start drill on a duplicate report, Web Intelligence createsa duplicate of the current report when you start drill mode, and you drill onthe duplicate. This allows you to compare the results of the original reportwith the results you discover during your drill analysis.

Web Intelligence locale options

Locales determine how Web Intelligence displays its interface (for example,menu items and button text) and data (for example, date and numberformatting).

Web Intelligence has three locales:

DescriptionLocale

The locale in which the Web Intelli-gence interface is displayedProduct Locale

The locale of the data currently con-tained in the documentDocument Locale

The user's preferred locale for display-ing document dataPreferred Viewing Locale

22 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 23: xi31_sp3_webi_qry_en

The InfoView settings determine how the Document Locale and PreferredViewing Locale interact to display document data.Related Topics• To permanently associate a locale with a document

The Product Locale

The product locale is used to display the Web Intelligence interface (forexample, menu items and button text).

Note:The GetLocale function returns the Product Locale.

To set the Product Locale1. Click Preferences on the main InfoView toolbar.2. Click General to display the general options.3. Select the product locale from the Product locale list.

The Document Locale

The Document Locale formats the data in a document. For example, theDocument Locale determines how Web Intelligence displays dates andnumbers.

If the Web Intelligence settings in InfoView give the user's Preferred ViewingLocale priority through the Use my Preferred Viewing Locale to formatthe data setting, Web Intelligence sets the Document Locale to the PreferredViewing Locale when the user opens a document. When the user saves thedocument, Web Intelligence saves this Document Locale with the document.

If the Web Intelligence settings do not give the user's Preferred ViewingLocale Priority, Web Intelligence formats the data according to the DocumentLocale saved with the document.

When a user creates a document, Web Intelligence always assigns the user'sPreferred Viewing Locale as the initial Document Locale, whether or not theWeb Intelligence settings in InfoView give the Preferred Viewing Localepriority.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 23

2Accessing Web Intelligence from InfoViewWeb Intelligence InfoView options

Page 24: xi31_sp3_webi_qry_en

A user can permanently associate the current Document Locale with adocument by saving the document with thePermanent Regional Formattingoption selected. Once a document has been saved with the option selected,Web Intelligence ignores the InfoView settings and always formats thedocument data using the saved Document Locale. This applies to all users,not just the user who selected the Permanent Regional Formatting option.

Note:The GetContentLocale function returns the Document Locale.

Related Topics• To permanently associate a locale with a document

To set the Document Locale1. Click Web Intelligence Preferences to display the Web Intelligence

options.2. Click Use the document locale to format the data beneath When

viewing a document.

The Preferred Viewing locale

The Preferred Viewing Locale is a user's preferred locale for displayingdocument data. The Document Locale becomes the user's Preferred ViewingLocale when the InfoView settings give the Preferred Viewing Locale priority.

Note:The GetPreferredViewingLocale function returns the Preferred ViewingLocale. The GetLocalized function also uses the Preferred Viewing Localeto display translated strings.

To set the Preferred Viewing Locale1. Click Preferences on the main InfoView toolbar.2. Click General to display the general options.3. Select the preferred viewing locale from the Preferred viewing locale

list.4. Click Web Intelligence Preferences to display the Web Intelligence

options.

24 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 25: xi31_sp3_webi_qry_en

5. If you want data to be formatted using the preferred viewing locale, clickUse my Preferred Viewing Locale to format the data beneath Whenviewing a document.

To permanently associate a locale with a document

1. In Web Intelligence Interactive, select Document > Properties from themenu to display the" Document Properties" dialog box, then selectPermanent regional formatting.

2. In the Web Intelligence Java Report Panel or Web Intelligence Rich Client,right-click an empty area of the report, select Document Properties todisplay the Document Properties pane, then select PermamentRegional Formatting in the Document Options section of the pane.

3. Save the document.The current Document Locale is associated permanently with thedocument.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 25

2Accessing Web Intelligence from InfoViewWeb Intelligence InfoView options

Page 26: xi31_sp3_webi_qry_en

26 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Accessing Web Intelligence from InfoView2 Web Intelligence InfoView options

Page 27: xi31_sp3_webi_qry_en

Returning data usingqueries

3

Page 28: xi31_sp3_webi_qry_en

Creating, editing and saving documentsYou create Web Intelligence documents by first selecting a universe inInfoView. Each universe maps to a database containing corporate businessinformation. When you connect to a universe, Web Intelligence automaticallylaunches the document editor selected on the Web Intelligence DocumentPreferences page in InfoView.

After you have selected a universe, you use the objects in the universe tobuild a query to return data from the database to your Web Intelligencedocument.

After creating a document you can save it to the InfoView repository.

To save a document

1. Click the arrow to the right of the Save document button on the left ofthe Query - HTML toolbar.

2. Click Save (to resave the document if it has already been saved) or Saveas (to save the document under a new name) from the dropdown list thatappears.If you clicked Save As or if you are saving the document for the first time,the "Save As" dialog box appears.

3. Use the "Save As" dialog box to save the document to the InfoViewrepository.

Building and working with queries

To build and run a query

You create Web Intelligence documents by first selecting a universe inInfoView. Each universe maps to a database containing corporate businessinformation. When you connect to a universe, Web Intelligence automaticallylaunches the query editor selected in InfoView. For Query - HTML to open,you must have selected Interactive as your document creation option.

28 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Creating, editing and saving documents

Page 29: xi31_sp3_webi_qry_en

1. Click Document List, then New > Web Intelligence Document inInfoView.

2. Click the universe on which you want to build the query.

Web Intelligence Query – HTML opens.

3. Select an object in the Universe pane and drag it over to the ResultObjects pane to add an object to the query.• To add all the objects in a class to the query, drag the class folder to

the Result Objects pane.• To remove an object from the query, drag it from the from the Result

Objects pane back to the Universe pane.• To remove all objects from the query, click Remove All at the right of

the Result Objects pane.

4. Select an object in the Result Objects pane and drag and drop it to theleft or right, or click Move Left/Move Right to the right of the ResultObjects pane, to change its position in the query.

5. Set the scope of analysis.6. Define query filters.7. Set query properties.8. Click Run.

How universe objects map to data

Classes and subclassesObjects are grouped into folders called classes. Each class can also containone or more subclasses. Subclasses contain objects that are a furthersubcategory of the objects in the upper level of the class.

The role of classes is to organize the objects into logical groups. When youcreate queries on the universe, classes help you to find the objects thatrepresent the information that you want to use in a query.

Dimension objectA dimension object represents data that provides the basis for analysis in areport. Dimension objects typically retrieve character-type data, for example;customer names, resort names, or dates.

Dimension objects appear as follows in the Web Intelligence query panel:

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 29

3Returning data using queriesBuilding and working with queries

Page 30: xi31_sp3_webi_qry_en

Detail objectA detail obect provides descriptive data about a dimension. A detail is alwaysattached to the dimension for which it provides additional information. Forexample, [Age] is a detail object that is associated with the (Customer]dimension.

Detail objects appear as follows in the Web Intelligence query panel:

Measure objectThe measure object retrieves numeric data that is the result of calculationson data in the database. For example, [Revenue] is the calculation of thenumber of items sold multiplied by item price. Measure objects are oftenlocated in a Measures class.

Measure objects appear as follows in the Web Intelligence query panel:

There are two types of measure:• classic measures - calculated by Web Intelligence• smart measures - calculated by the database on which the universe is

based

In certain situations, smart measures impact the way in which WebIntelligence displays calculations. For more information on smart measures,see theUsing Functions, Formulas and Calculations in SAP BusinessObjectsWeb Intelligence guide.

To rename a query

1. Right-click the tab showing the name of the query you want to rename.2. ClickRename on the menu.

30 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Building and working with queries

Page 31: xi31_sp3_webi_qry_en

3. Type the new name, then press Enter.• The query name cannot have more than 50 characters.• The query name cannot contain the following character: [• Two queries cannot have the same name.The new name appears on the query tab.

To interrupt a query

When you interrupt a query, only partial data is returned to the document.The values displayed in the document do not accurately reflect the definitionin the query.

1. On the "Waiting - Refresh Data" dialog box, click Cancel.The "Interrupt Data Retrieval" dialog box appears.

2. Click OK.

To remove a query

1. Select a the query you want to remove by right-clicking the appropriateQuery tab.

2. Click Remove.

Multiple queries

You can include one or multiple queries in a Web Intelligence document.When you include multiple queries, those queries can be based on a singleuniverse or on multiple universes available in InfoView.

For example, you can include product sales data and customer data in thesame document. In this case, your corporate data for product line sales isavailable on one universe and data on customers is available on anotheruniverse. You want to present product line sales results and information oncustomer age groups in the same report. To do this, you create a singledocument that includes two queries; one query on each universe. You canthen include and format results from both queries on the same report.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 31

3Returning data using queriesBuilding and working with queries

Page 32: xi31_sp3_webi_qry_en

Defining multiple queries in a single document is necessary when the datayou want to include in a document is available on multiple universes, or whenyou want to create several differently-focused queries on the same universe.You can define multiple queries when you build a new document or add morequeries to an existing document. You can present the information from allof the queries on a single report or on multiple reports in the same document.

Multiple queries, combined queries and synchronized queriescompared

Multiple queries can be related in a Web Intelligence document in differentways.

• Basic multiple queries draw unrelated data from different sources.• “Synchronized queries” relate the data from different queries around a

dimension that contains data common to both queries. These dimensionsare called merged dimensions.

You merge dimensions in the Web Intelligence reporting interface afteryou have created and run your multiple queries.

• “Combined queries” are a special kind of query created in the WebIntelligence query interface. Combined queries generate SQL containingthe UNION, INTERSECT and MINUS operators (if the database supportsthem) or simulate the effect of these operators.

Combined queries allow you to answer complex business questions thatare difficult to formulate using standard queries.

You cannot create combined queries in Query - HTML.

To add a query

1. Click Add a Query.The Add Query window appears.

2. Select the universe you want to use to build the query.You can create a new query on a universe already used in the documentor select a different universe. By default, the universe used in the currentdocument is displayed first.

3. Click OK.

32 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Building and working with queries

Page 33: xi31_sp3_webi_qry_en

4. Define the objects, filters, scope of analysis, and properties you want forthe query.The data content, scope of analysis, and filters you define here will onlyapply to the selected query. The query properties you define only applyto the selected query.

To duplicate a query

If you want to build a different query on a universe already included in thedocument, you can duplicate the existing query on that universe and thenmodify it, instead of starting from scratch.

1. Select the query you want to duplicate by right-clicking the appropriateQuery tab at the bottom of the report panel.

2. Select Duplicate

Viewing the SQL generated by a query

When you build a query in Web Intelligence, Web Intelligence generatesSQL to run against the database to return the query result. S(tructured)Q(uery) L(anguage) is the query language understood by all relationaldatabases.

You can view and edit the SQL generated by Web Intelligence.

Note:You cannot view the SQL of queries that call database stored procedures.

To view and edit the generated SQL

Note:You cannot edit the query SQL when the query contains optional prompts.Edit the query to remove the optional prompts before attempting to edit theSQL.

1. Click SQL on the query toolbar to display the "SQL Viewer" dialog box.When SQL is not editable, values supplied in response to prompts appeardirectly in the query.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 33

3Returning data using queriesBuilding and working with queries

Page 34: xi31_sp3_webi_qry_en

For example, if "UK" was supplied in response to a prompt on [Country],a line similar to

Resort_country.country In ('UK')

appears in the query.

If no value has yet been supplied for the prompt, the Web Intelligencesyntax for prompts (described below) appears in the query.

2. Click Use custom SQL to make the generated SQL editable.When you make the SQL editable, the Web Intelligence syntax for promptsappears in the query.

For example, a line similar to

Resort_Country.country = @prompt('Enter Country:','A','Resort\Country',Mono,Free,Persistent,,User:0)

appears in the query.

3. Click Validate after editing the SQL to check that your edits are valid.4. Click Copy (Java Report Panel and Web Intelligence Rich Client only) to

copy the SQL to the clipboard.5. Click Print (Query - HTML only) to print the SQL.

Setting the scope of analysis

Scope of analysis

The scope of analysis for a query is extra data that you can retrieve from thedatabase to give more details on the results returned by each of the objectsin a query. This extra data does not appear in the initial result report, but itremains available in the data cube, so you can pull this data in to the reportto allow you to access more detail at any time. This process of refining thedata to lower levels of detail is called drilling down on an object.

In the universe, the scope of analysis corresponds to the hierarchical levelsbelow the object selected for a query. For example, a scope of analysis ofone level down for the object Year, would include the object Quarter, whichappears immediately under Year.

34 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Setting the scope of analysis

Page 35: xi31_sp3_webi_qry_en

You can set this level when you build a query. It allows objects lower downthe hierarchy to be included in the query, without them appearing in theResults Objects pane. The hierarchies in a universe allow you to chooseyour scope of analysis, and correspondingly the level of drill available.

In the Java Report Panel and in Web Intelligence Rich Client, you can alsocreate a custom scope of analysis by selecting specific dimensions for theScope of Analysis pane.

Note:You cannot set the scope of analysis when working in query drill modebecause this drill mode causes Web Intelligence to modify the scopedynamically in response to drill actions.

Levels of scope of analysis

You can set the following levels for scope of analysis:

DescriptionLevel

Only the objects that appear in theResults Objects pane are included inthe query.

None

For each object in the Result Objectspane, one, two, or three objects lowerdown the hierarchy tree are includedin the query. The data from these ob-jects is stored in the cube until you addthem to the document.

• One level down• Two levels down• Three levels down

All objects added manually to theScope of Analysis panel are includedin the query.

Custom

Note:This option is available in the JavaReport Panel and in Web IntelligenceRich Client only.

Including a scope of analysis in a document increases the document sizesignificantly. This is because the data necessary for the scope you specifyis saved with the document, even though it is not visible in the reports unless

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 35

3Returning data using queriesSetting the scope of analysis

Page 36: xi31_sp3_webi_qry_en

you start drill mode and drill down to the data to display the correspondingvalues.

In order to minimize the size of documents and optimize performance, werecommend that you only include a scope of analysis in documents whereyou are certain that users will need to drill.

We suggest the following method because it will be easier for you to set thescope of analysis seeing the hierarchy of the classes and objects.

To set the scope of analysis

1. Click Query Properties in the Query toolbar.2. Choose: None (the default), One Level, Two Levels, or Three Levels

from the drop-down list.

Query contexts

What is an ambiguous query?

An ambiguous query is a query that contains one or more objects that canpotentially return two different types of information.

In a universe, certain dimensions may have values that are used for twodifferent purposes in the database. For example, the [Country] dimension inthe query below can return two types of information:

• Customers and the country in which they spent their vacation.• Customers and the country for which they have made their reservation.

The role that Country plays in this query is ambiguous. A country can beeither the country where a vacation was sold, or a country where a vacationis reserved. One is existing information (sales), and the other is futureinformation (reservations).

To avoid ambiguities in a query, the universe designer identifies the differentways that objects can be used in the universe, and implements restrictionson how these objects can be combined. These restrictions are called contexts.

36 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Query contexts

Page 37: xi31_sp3_webi_qry_en

What is a context?

A context is a defined group of objects that share a common businesspurpose. This business purpose is usually the type of information that theserelated objects represent. For example, a sales context is a grouping of allthe objects that can be used to create sales queries. A reservations contextis a grouping of all the objects that can be used in reservation queries.Contexts are defined in a universe by the universe designer.

You can combine any object within the same context to create a query. Youcan also combine objects in different contexts. If you use an object that iscommon to both contexts, Web Intelligence will try to determine the contextthat best fits the other objects in the query.

If it cannot determine a context, you are prompted to choose the context thatyou want to apply to the query.

Choosing a context when you run a query

When you create a query or refresh a report, you may be asked to choosea context before the query can run. Contexts are set up in a universe to avoidambiguous queries.

To choose a context when you run a query

1. Run the query containing multiple contexts.The "Select a Context" dialog box appears.

2. Select the context in the "Select a Context" dialog box.

Web Intelligence query properties

Allow other users to edit all queries property

When selected, other users who have the appropriate editing rights canaccess Query View and modify the queries in the document. When cleared,

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 37

3Returning data using queriesWeb Intelligence query properties

Page 38: xi31_sp3_webi_qry_en

only the report creator can modify the queries. This option is selected bydefault. Unlike the other query properties, which only apply to the selectedquery, this option applies to all of the queries in the document.

Max retrieval time query property

Maximum time that a query can run before the query is stopped. This canbe useful when a query is taking too long due to an excess of data, or networkproblems. You can set a time limit so a query can stop within a reasonabletime.

Max rows retrieved query property

The Max rows retrieved query property determines the maximum numberof rows of data that are displayed when a query is run. If you only need acertain amount of data, you can set this value to limit the number of rows ofdata in your document.

Max rows retrieved does not operate at the database level. If you set Maxrows retrieved to 1000, and your query returns 5000 rows, Web Intelligenceinitially retrieves all 5000 rows, before discarding 4000 and retaining onlythe first 1000 rows.

The Sample result set query property also applies a restriction on thenumber of rows in the query, but at the database level. If you set Max rowsretrieved to 2000 and Sample result set to 1000, the query retrieves amaximum of 1000 rows only.

This setting can be overridden by the limits set by your administrator in yoursecurity profile. For example, if you set the Max rows retrieved setting to400 rows, but your security profile limits you to 200 rows, only 200 rows ofdata will be retrieved when you run the query.

Query prompt order

Prompts are listed in the list. You can use the up and down arrows to movea prompt up or down the list to change the order in which they are executed.

38 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Web Intelligence query properties

Page 39: xi31_sp3_webi_qry_en

Retrieve duplicate rows query property

In a database, the same data may be repeated over many rows. You canchoose to have these repeated rows returned in a query, or to have onlyunique rows returned.

Query Stripping

Query Stripping enables you to optimize the query generation automatically.With Query Stripping enabled, Web Intelligence generates a query containingonly those objects that effectively contribute to a report. It improves theperformance of the report by sending the stripped query to the connectionserver.

Each time you refresh a query, Web Intelligence strips the objects which arenot contributing to the report (directly or indirectly) from the report as well asfrom the SQL Viewer tab. It refreshes only the query that is directly relatedto the report. The stripped objects get deleted from the report and appearas bold in the Data map to allow easy identification of the stripped objects.You can drag and drop these objects if you want them to appear in the reportagain. Once you drag and drop these objects, the column header of thereport displays the object definition and data cells display #Refresh . Refreshthe query again to allow the stripped objects data to appear in the report.

Note:• Query Stripping is applicable only for OLAP database users.• In a Query Stripping enabled document, if a query filter is used on a

Measure object, Web Intelligence does not strip the objects.

For more information about how to work with Web Intelligence, see BuildingReports with Web Intelligence Rich Client guide on SAP Help Portal:http://help.sap.com

To control Query Stripping

You can control the automatic query optimization by enabling or disablingQuery Stripping at two levels, namely, Query and Document level property.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 39

3Returning data using queriesWeb Intelligence query properties

Page 40: xi31_sp3_webi_qry_en

• Query level property: At Query level property, Query Stripping can beenabled or disabled only by Power users, who create a Web Intelligencereport and defines queries and initial structures of the report. QueryStripping at query level property is disabled by default. In case of multiplequeries in the same document, the query set for Query Stripping will bestripped and other queries would remain unaffected.

• Document level property: At Document level property, Query Strippingcan be enabled or disabled by all the users of Web Intelligence to changethe report objects for analysis. Query Stripping at document level propertyis disabled by default.

When you create a Web Intelligence document, by default the Query Strippingis disabled. A power user needs to enable this parameter to strip an objectfor a specific query. Web Intelligence fails to strip a query if the documentlevel property is enabled and query level property is disabled or vice-versa.Query Stripping works only when Query Stripping is enabled at both Queryand document level properties.

Once the Query Stripping is disabled at the document level property, WebIntelligence retains the default pattern of refreshing all the objects selectedin the query panel for a specific query sent to the connection server.

1. To enable Query Stripping at the query level for a specified query, selectEnable Query Stripping in the "Query Properties" tab while creating aWeb Intelligence report.

Note:Enable Query Stripping parameter is set only by the Power users whoneeds to edit Query or create query rights. The user of a report will notbe able to set this parameter.

2. To enable Query Stripping at the document level for a specified query,select Enable Query Stripping in the Document Properties tab.

As a result, Query Stripping is enabled for a specified query.

Reset contexts on refresh query property

When selected, you are prompted to choose a context each time a queryrequiring a context is run. When unselected, Web Intelligence retains thecontext specified the first time you run the query.

40 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Web Intelligence query properties

Page 41: xi31_sp3_webi_qry_en

Clear contexts query property

When this property is selected, Web Intelligence clears the contexts listedin the list when you next run the query or refresh the data.

Sample result set query property

The Sample result set property determines the maximum number of rowsthat a query returns. The property applies this restriction at the databaselevel. If the database supports sampling, Web Intelligence adds the restrictionto the SQL that Web Intelligence generates to return the data.

If you select the Fixed option, Web Intelligence uses fixed sampling. At eachdata refresh, the query returns the same rows. If you do not set the Fixedoption, Web Intelligence uses random sampling. At each data refresh, thequery returns a different set of sampled rows.

Sample result set is more efficient than the Max rows retrieved property,which discards rows beyond the maximum limit only after retrieving all therows in the query.

Not all databases support fixed and random sampling. If they are notsupported, the properties are disabled (in the Java Report Panel) or invisible(in Query - HTML). Sampling is not available at all in the HTML Report Panel.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 41

3Returning data using queriesWeb Intelligence query properties

Page 42: xi31_sp3_webi_qry_en

42 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Returning data using queries3 Web Intelligence query properties

Page 43: xi31_sp3_webi_qry_en

Filtering data using queryfilters

4

Page 44: xi31_sp3_webi_qry_en

Query filters definedYou limit the data returned to the document by applying filters when youdefine the query. Using query filters enables you to secure the data that youdon’t want specific user groups to see and limits the size of the documentsthat are stored on your network. When you run the query on the documentdata, the Web Intelligence returns only the values that meet the query filterdefinitions.

Query filters limit the data Web Intelligence returns to a document. Theyretrieve a sub-set of the data from the database and return the correspondingvalues to the document. You define filters to match business questions. Forexample, you can filter the [Year] dimension to view only sales revenue forYear 2003; or filter the [Annual Income] dimension to view only customerswhose annual income is equal to or greater than $1.5M.

Query filters allow you to:

• retrieve only the data you need to answer a specific business question• hide the data you don’t want specific users to see when they access the

document• minimize the quantity of data returned to the document to optimize

performance

Example: In Q4 2002, which stores in my sales region gained marginsabove $130K?

As Regional Marketing Manager for Texas, you are only interested inanalyzing margins for Texas, but the sales universe includes data US-wide.In addition, you only want to view information for stores where marginsreached over your 4Q 2002 quarterly target figure: $130K. To create adocument with only the information you need, you apply a filter on the[State], [Year], and [Quarter] dimensions and a filter on the [Margin]measure:

44 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Query filters defined

Page 45: xi31_sp3_webi_qry_en

Year Equal to 2002

ANDQuarter Equal to Q4

State Equal to Texas

Margin Greater than or equal to 130000

To avoid displaying the filtered values Texas, 2002, and Q4 in the tablecolumns Year, Quarter, and State, you exclude the [Year], [Quarter], and[State] objects from the Result Objects pane. When you generate the report,the report values correspond to Texas stores with 4Q 2002 margins greaterthan or equal to $130K:

MarginSales RevenueStore name

133,802307,914e-Fashion Houston

136,055316,232e-Fashion HoustonLeighton

Query filters and report filters comparedYou can apply filters at two levels within a document:

• query filters – these filters are defined on the query; they limit the dataretrieved from the data source and returned to the Web Intelligencedocument.

• report filters – these filters limit the values displayed on reports, tables,charts, sections within the document, but they don’t modify the data thatis retrieved from the data source; they simply hide values at the reportlevel.

Types of query filterYou can create the following types of query filter:

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 45

4Filtering data using query filtersQuery filters and report filters compared

Page 46: xi31_sp3_webi_qry_en

• predefined filters – created by your administrator• custom filters – you define on the query• quick filters - a simplified form of custom filter for simple filters• prompts – you define these dynamic filters to display a question or a list

of values so you or other users can select different filter value(s) at eachrun query

You can mix different types of filters on a single query.

Predefined query filters

Predefined filters make the specific data you most typically need for reportspermanently available in Web Intelligence. They are created by anadministrator and saved with the universe. Predefined filters often containcomplex expressions that require a detailed knowledge of the databasestructure. Including predefined filters on the universe means you don’t needto create the same custom filters every time you create new Web Intelligencedocuments based on the same universe.

As a Web Intelligence user, you cannot view the component parts ofpredefined filters or edit predefined filters.

To select a predefined query filter

• Double-click the predefined filter or drag it to the Query Filters pane.

When you run the query, the data corresponding to the query filters youselected is returned to the report.

Custom query filters

You create custom query filters to limit document data to informationcorresponding to:

• a specific business question• the business information needs of a specific group of users

For example, you can create custom filters to retrieve sales results data forspecific dates, products, or services, or to view customer information onlyfor customers who are high wage earners or who live in a particular region.

46 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 47: xi31_sp3_webi_qry_en

To add and remove custom query filters

1. Select the object you want to filter and drag it to the Query Filters pane.The query filter appears in outline in the Query Filters pane.

2. Click the arrow next to the default operator (In List) and select the queryoperator from the list of operators.

3. Click the arrow on the right of the query filter and select the type of filteryou want to apply: Constant, Value(s) from List, Prompt, Object fromthis query, Result from another query, Result from another query(Any), Result from another query (All).

DescriptionOption

You compare the object against a constant value tofilter the query result.

Constant

You compare the object against values from a list ofvalues to filter the query result.

Value(s) from list

You create a filter which requires the user to supplyfilter values on data refresh.

Prompt

You compare the object against the values returnedby an object from in the same query.

Object from thisquery

You compare the object against the values returnedby an object from another query (the filtering query)to filter the query result.

Result from anoth-er query

You compare the object against any of the valuesreturned by an object from another query (the filter-ing query) to filter the query result.

Result from anoth-er query (Any)

You compare the object against all of the valuesreturned by an object from another query (the filter-ing query) to filter the query result.

Result from anoth-er query (All)

4. Type/select the constant, list of values or object you want to include inthe filter.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 47

4Filtering data using query filtersTypes of query filter

Page 48: xi31_sp3_webi_qry_en

5. To remove the filter, select it and click the Delete key, or click Removeat the top right corner of the Query Filters pane. To remove all filters,click Remove All at the top right corner of the Query Filters pane.

Related Topics• What is a prompt?• Filtering a query on values returned from another query

Filtering a query on values returned from another query

You can filter a query on values returned from another query. For example,if you want to return results for all the countries in Query 1 that have acorresponding country in Query 2, you can filter the [Query 1].[Country]object on the values of the [Query 2].[Country] object.

The filtered query must be in a universe based on a relational (RDBMS) datasource. The query that supplies the filtering values (filtering query) can bebased on a relational, OLAP or local data source.

When you are building a query on a query, the filtering query does not appearin the list of queries that can be used as filtering queries until it has been runor saved.

The filtering query is not refreshed when you refresh the filtered query.

The query filter can filter against all or any of the values returned by thefiltering query. The supported combinations of operator and filter mode appearin the table below. If you do not choose an operator from the table, theResultfrom another query menu item is not available.

48 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 49: xi31_sp3_webi_qry_en

DescriptionFiltermode

Operator

Keep values in the filtered query that areequal to any value returned by the filteringquery.

AnyEqual To

Keep values in the filtered query that are dif-ferent from all the values returned by the fil-tering query.

AllNot Equal To

Keep values in the filtered query that aregreater than/greater than or equal to anyof the values in the filtering query.

In other words, keep values in the filteredquery that are greater than/greater than orequal to the minimum value returned bythe filtering query.

AnyGreater Than

Greater Than orEqual To

Keep values in the filtered query that aregreater than all of the values in the filteringquery.

In other words, keep values in the filteredquery that are greater than/greater than orequal to the maximum value returned bythe filtering query.

AllGreater Than

Greater Than orEqual To

Keep values in the filtered query that areless than/less than or equal to any of thevalues in the filtering query.

In other words, keep values in the filteredquery that are less than/less than or equalto the maximum value returned by the filter-ing query.

AnyLess Than

Less Than or EqualTo

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 49

4Filtering data using query filtersTypes of query filter

Page 50: xi31_sp3_webi_qry_en

DescriptionFiltermode

Operator

Keep values in the filtered query that areless than/less than or equal to any of thevalues in the filtering query.

In other words, keep values in the filteredquery that are less than/less than or equalto the minimum value returned by the filter-ing query.

AllLess Than

Less Than or EqualTo

Keep values in the filtered query that areequal to any value in the list of values re-turned by the filtering query.

AnyInList

Keep values in the filtered query that are notequal to any of the values in the list of valuesreturned by the filtering query.

AnyNot InList

Query filter and prompt operators

Equal To operator

Use the Equal to operator to obtain data equal to a value.

For example, to return data for the US only, create the filter "County EqualTo US".

Not Equal To operator

Use the Not Equal To operator to obtain data not equal to a value.

For example, to return data for all countries except the US create the filter"County Not Equal To US".

50 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 51: xi31_sp3_webi_qry_en

Different From operator

Use the Different From operator to retrieve data different from a value.

For example, to retrieve data for all quarters execpt Q4, create the filter[Quarter] Different From "Q4"

Greater Than operator

Use the Greater Than operator to retrieve data greater than a value.

For example, to retrieve data for customers aged over 60, create the filter"[Customer Age] Greater than 60".

Greater Than Or Equal To operator

Use the Greater Than Or Equal To operator to retrieve data greater than orequal to a value.

For example, to retrieve data for revenue starting from $1.5M, create thefilter "[Revenue] Greater than or equal to 1500000".

Less Than operator

Use the Less Than operator to retrieve data lower than a value.

For example, to retrieve data for exam grades lower than 40, create the filter"[Exam Grade] Less Than 40".

Less Than Or Equal To operator

Use the Less Than Or Equal To operator to retrieve data less than or equalto a value.

For example, to retrieve data for customers whose age is 30 or less, createthe filter "[Age] Less Than Or Equal To 30".

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 51

4Filtering data using query filtersTypes of query filter

Page 52: xi31_sp3_webi_qry_en

Between operator

Use the Between operator to retrieve data between and including two values.

For example, to retrieve data for weeks starting at week 25 and finishing at36 (including week 25 and week 36), create the filter "[Week] Between 25and 36".

Not Between operator

Use the Not Between operator to retrieve data outside the range of twovalues.

For example; to retrieve data for all the weeks of the year, except for andnot including weeks 25 through 36, create the filter "[Week] Not between 25and 36".

In List operator

Use the In List operator to retrieve data corresponding to values in a list ofvalues.

For example, to retrieve data for the US, UK and Japan only, create the filter[Country] In List ("US";"UK";"Japan").

Not In List operator

Use the Not In List operator to retrieve data that does not correspond tomultiple values.

For example, if you do not want to retrieve data for the US, UK and Japan,create the filter [Country] Not In ("US";"UK";"Japan").

Matches Pattern operator

Use the Matches Pattern operator to retrieve data that includes a specificstring or part of a string.

52 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 53: xi31_sp3_webi_qry_en

For example, to retrieve customers whose date of birth is 1972, create thefilter [DOB] Matches Pattern "72".

Different From Pattern operator

Use the Different From Pattern operator to return data that doesn't includea specific string.

For example, to retrieve customers whose date of birth is not 1972, createthe filter [DOB] Different From Pattern '72'.

Both operator

Use the Both operator to retrieve data that corresponds to two values.

For example, to retrieve customers who have both a fixed and a mobiletelephone, create the filter [Account Type] Both 'Fixed' And 'Mobile'.

Except operator

Use the Except operator to retrieve data that corresponds to one value andexcludes another.

For example, to retrieve customers who have a fixed telephone and do nothave a mobile telephone, create the filter [Account Type] 'Fixed' Except'Mobile'.

The Except operator is more restrictive than Different From or Not InList. For example, a report that returns customers and that includes thefilter [Lines] Different From 'Accessories' excludes all salesrecords where the item sold is part of the 'Accessories' line. If the samecustomer has purchased Accessories and non-Accessories items, thecustomer still appears in the report, but their spending total includes onlynon-Accessories sales.

If the filter is [Lines] Except 'Accessories', only customers whohave bought no accessories are included in the report.Related Topics• Not In List operator

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 53

4Filtering data using query filtersTypes of query filter

Page 54: xi31_sp3_webi_qry_en

• Different From operator

Combining query filters

The AND and OR operators

You use the AND and OR operators to combine and nest query filters orreport filters. When you use AND to combine filters, Web Intelligence displaysonly the data that matches the criteria in both the filters linked by the operator.When you use OR, Web Intelligence returns the data that matches the criteriain either one of the filters linked by the operator.

You can mix the AND and OR operators when combining and nesting filters.For example, you can link three filters in the relationship (Filter1 OR Filter2)AND Filter3. In this case, Web Intelligence first restricts the data by theconditions in either Filter1 or Filter2. Web Intelligence then compares thisdata with the condition in Filter3 and returns only the data that correspondsto this condition.

Combining query filters

Typical business questions require you to retrieve information that matchesmore than one criteria. For example, if you are analyzing customer servicesdata, you will most likely want to focus on customers for a specific time periodand also for a specific region, and probably also for a specific level ofcustomer service contract. You can retrieve data that answers several criterialike this by combining filters in the same query.

Example: Analyze sales revenue this year at stores where the floor sizeis over 4,000 square feet and sales revenue figures are equal to or lessthan $1.5M

In this example, you are an operations manager for a retail chain. You wantto analyze information about the large retail stores in your chain that aremaking less than the sales revenue figure your company has set as thetarget.

54 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 55: xi31_sp3_webi_qry_en

To do this you add a predefined filter on the [Year] dimension to specifythat you only want to retrieve values for this year. Then you create a secondfilter on the [Sales Floor Size] dimension to specify that you only want toretrieve data for stores where the floor size is greater than 4,000 squarefeet. After this, you create a third filter on the [Sales Revenue] measure tospecify that you only want to retrieve data for stores where the sales revenuefigures are equal to or less than $1.5M. Finally, you combine these threefilters with the And operator:

Last Year

AND Sales Floor Size Group Greater than or equal to:4000

Sales Revenue Less than 1,500,000

When you run the query, only data for stores that satisfy all three criteriawill be returned to the report.

To combine query filters1. Create the filters and add them to the Query Filters pane.

By default, Web Intelligence combines the filters with the AND operator.

2. Double-click the operator (Java Report Panel, Rich Client and Query -HTML) or click the arrow next to the operator checkbox and select theother operator (HTML Report Panel) to toggle between AND and OR.

Nesting query filters

Nesting query filters allows you to create more complex filter conditions thanis possible when you combine filters at the same level.

When you nest filters, you set the order in which Web Intelligence evaluatesthem. For example, Web Intelligence can return the data given by two queryfilters joined in an OR relationship (where either one filter condition or theother is true) and then further restrict this data by applying another filter toit. In this case, the two filters in an OR relationship are nested, then comparedwith the other filter in an AND relationship.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 55

4Filtering data using query filtersTypes of query filter

Page 56: xi31_sp3_webi_qry_en

The following example illustrates this:

Example: List all sales made in Japan either in Q4 or where the revenuewas greater than 1000000

To answer this question you create the following nested query filter:

Country Equal To Japan

AND Quarter Equal To Q4

OR Revenue Greater Than1000000

Web Intelligence first returns sales data where the sale was made in Q4or the revenue was greater than 1000000, then restricts this data furtherby returning only those sales made in Japan.

To nest query filters in Query - HTML1. Add the query filter or filter combination that you want to be evaluated

last to the Query Filters pane.2. Select any filter or the AND or OR operator (if there are multiple filters)

and click Add nested filter on the right of the Query Filters pane.The nested filter outline appears with the OR operator by default.

3. With the nested filter operator selected, select the object or objects thatyou want to appear in the nested filter and click >> to add them to thenested filter.

4. Double-click the nested filter operator to toggle between AND and OR.5. To add further nested filters, select any object at any level in the current

set of filters, then click Add nested filter to add a further nested filter.6. To add or remove filters at any level in the set of nested filters, select the

AND or OR operator that links the filters at that level, then add or removeobjects from the list of filters.

56 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Types of query filter

Page 57: xi31_sp3_webi_qry_en

Filtering queries with the Keydatevariable

The keydate variable is a SAP BW variable which restricts dimensionmembers to the values on a given date. You can set a keydate value whenbuilding queries on universes based on SAP BW data sources.

When a keydate is set, the lists of values in any prompts defined on the queryare filtered according to the keydate. The dimension values returned by thequery are also filtered according to the keydate.

You can define one keydate per query. This means that, for example, youcan compare data changes by creating two data providers based on thesame query, but with different keydates.

If a keydate is available in the universe, Web Intelligence allows you to setits value in the query panel. The keydate can either be the default date usedby the SAP BW cube, or a date set in Web Intelligence.

When you define a keydate in the query panel, you can also define that thereport user must re-select the keydate each time they refresh the report data.

To set the keydate for a single query in the querypanel

1. Click Keydate Properties to display the "Keydate Properties" dialog box.2. Select Use the default date if you want the SAP BW cube to determine

the keydate value.If a specific default date is set in the SAP BW cube, Web Intelligencedisplays the date. If no date is set in the cube, the cube uses the lastavailable keydate and Web Intelligence displays Last Available.

3. Select Set a date and choose a date from the calendar if you want to setthe keydate yourself.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 57

4Filtering data using query filtersFiltering queries with the Keydate variable

Page 58: xi31_sp3_webi_qry_en

To set the keydate for multiple queries in the querypanel

1. Click Keydate Properties to display the "Keydate Properties" dialog box.2. Select Use the default date if you want the SAP BW cube to determine

the keydate value.If a specific default date is set in the SAP BW cube, Web Intelligencedisplays the date. If no date is set in the cube, the cube uses the lastavailable keydate and Web Intelligence displays Last Available.

3. Click Set date for all queries and choose a date from the calendar if youwant to set the same date for all queries.

4. Click Set a date for each query if you want to set different dates for eachquery.

5. For each query, select Default from the drop-down list if you want theSAP BW cube to determine the keydate value. To choose your own date,select Specific from the drop-down list, then choose the date from thecalendar.

58 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using query filters4 Filtering queries with the Keydate variable

Page 59: xi31_sp3_webi_qry_en

Filtering data using prompts

5

Page 60: xi31_sp3_webi_qry_en

What is a prompt?A prompt is a special type of query filter. It is a dynamic filter that displays aquestion every time you refresh the data in a document. You answer promptsby either typing or selecting the value(s) you want to view before you refreshthe data. Web Intelligence retrieves only the values you specified from thedatabase and returns those values to the reports within the document.Prompts allow multiple users viewing a single document to specify a differentsub-set of the database information and display it in the same report tablesand charts. Prompts also reduce the time it takes for the data to be retrievedfrom the database.

A prompt contains the following elements:

• a filtered object• an operator• a message

For example, to prompt users to select a specific year, you define a prompton the [Year] dimension:

Year Equal To ("Which year?°)

In this prompt, the filtered object is [Year], the operator is Equal To, and theprompt message is "Which year?".

You can define prompts on any dimension, measure, or detail object. Forexample, you can filter the [Year] dimension to return values for a specificyear, filter the [Sales Revenue] measure to return values for a range ofrevenue figures, or filter the [Year/week] detail to return values for a specificweek in a year.

You can create multiple prompts, related by the AND or OR operators, inthe same query. You can also nest prompts. When the user runs a query,Web Intelligence displays the prompts.

Prompts appear in the SQL generated by a Web Intelligence query as eitherthe value supplied in response to the prompt (when the SQL is read-only),or as Web Intelligence prompt syntax (when the SQL is editable). Forexample, a prompt on [Country] can appear in the generated SQL as

Resort_Country.country = @prompt('Enter Country:','A','Resort\Country', Mono,Free,Persistent,,User:0)

60 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using prompts5 What is a prompt?

Page 61: xi31_sp3_webi_qry_en

or as

Resort_country.country In ('UK')

Prompts can be optional. The user is not obliged to specfy a value for anoptional prompt. If no value is specified, Web Intelligence ignores the prompt.

Merged prompts

When a document contains multiple data providers, any prompts that include(1) objects with the same data type, (2) operators of the same operator type,and that (3) use the same prompt text are merged.

When all the data providers are refreshed, a single prompt message appearsfor such prompts.

The List of Values displayed by the merged prompt is the list associated withthe object in the prompt that has the most display property constraints.

Cascading promptsSome objects cause Web Intelligence to display a cascading prompt whenthey are included in a prompt definition. The universe designer defines thelists of values of these objects hierarchically in relation to other object listsof values in the universe.

Cascading prompts help the user to focus on the object values they want toinclude in the prompt without the need to search all possible object values.

Example: Choosing a store

In this example the universe designer has defined the [Store Name], [City]and [State] objects in a hierarchy. If you include a prompt [Store Name]Equal To <value>, Web Intelligence displays these objects in a hierarchyin the Prompts dialog box. In order to select the store, the user must firstselect the state in which the store city is found, then the city in which thestore is found, then the store itself. When the user selects the state, WebIntelligence restricts the values of City to the cities in the state; when theuser selects the city, Web Intelligence restricts the stores to the stores inthe city.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 61

5Filtering data using promptsCascading prompts

Page 62: xi31_sp3_webi_qry_en

Hierarchical lists of valuesIf your universe contains hierararchical lists of values, these lists appear intree form. You navigate down through the tree to the items you want.

Whether a list of values appears as a cascading prompt or hierarchicallydepends on how the list is configured in the universe. See your administratorfor more information.

Query filter and prompt operators

Equal To operator

Use the Equal to operator to obtain data equal to a value.

For example, to return data for the US only, create the filter "County EqualTo US".

Not Equal To operator

Use the Not Equal To operator to obtain data not equal to a value.

For example, to return data for all countries except the US create the filter"County Not Equal To US".

Different From operator

Use the Different From operator to retrieve data different from a value.

For example, to retrieve data for all quarters execpt Q4, create the filter[Quarter] Different From "Q4"

62 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using prompts5 Hierarchical lists of values

Page 63: xi31_sp3_webi_qry_en

Greater Than operator

Use the Greater Than operator to retrieve data greater than a value.

For example, to retrieve data for customers aged over 60, create the filter"[Customer Age] Greater than 60".

Greater Than Or Equal To operator

Use the Greater Than Or Equal To operator to retrieve data greater than orequal to a value.

For example, to retrieve data for revenue starting from $1.5M, create thefilter "[Revenue] Greater than or equal to 1500000".

Less Than operator

Use the Less Than operator to retrieve data lower than a value.

For example, to retrieve data for exam grades lower than 40, create the filter"[Exam Grade] Less Than 40".

Less Than Or Equal To operator

Use the Less Than Or Equal To operator to retrieve data less than or equalto a value.

For example, to retrieve data for customers whose age is 30 or less, createthe filter "[Age] Less Than Or Equal To 30".

Between operator

Use the Between operator to retrieve data between and including two values.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 63

5Filtering data using promptsQuery filter and prompt operators

Page 64: xi31_sp3_webi_qry_en

For example, to retrieve data for weeks starting at week 25 and finishing at36 (including week 25 and week 36), create the filter "[Week] Between 25and 36".

Not Between operator

Use the Not Between operator to retrieve data outside the range of twovalues.

For example; to retrieve data for all the weeks of the year, except for andnot including weeks 25 through 36, create the filter "[Week] Not between 25and 36".

In List operator

Use the In List operator to retrieve data corresponding to values in a list ofvalues.

For example, to retrieve data for the US, UK and Japan only, create the filter[Country] In List ("US";"UK";"Japan").

Not In List operator

Use the Not In List operator to retrieve data that does not correspond tomultiple values.

For example, if you do not want to retrieve data for the US, UK and Japan,create the filter [Country] Not In ("US";"UK";"Japan").

Matches Pattern operator

Use the Matches Pattern operator to retrieve data that includes a specificstring or part of a string.

For example, to retrieve customers whose date of birth is 1972, create thefilter [DOB] Matches Pattern "72".

64 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using prompts5 Query filter and prompt operators

Page 65: xi31_sp3_webi_qry_en

Different From Pattern operator

Use the Different From Pattern operator to return data that doesn't includea specific string.

For example, to retrieve customers whose date of birth is not 1972, createthe filter [DOB] Different From Pattern '72'.

Both operator

Use the Both operator to retrieve data that corresponds to two values.

For example, to retrieve customers who have both a fixed and a mobiletelephone, create the filter [Account Type] Both 'Fixed' And 'Mobile'.

Except operator

Use the Except operator to retrieve data that corresponds to one value andexcludes another.

For example, to retrieve customers who have a fixed telephone and do nothave a mobile telephone, create the filter [Account Type] 'Fixed' Except'Mobile'.

The Except operator is more restrictive than Different From or Not InList. For example, a report that returns customers and that includes thefilter [Lines] Different From 'Accessories' excludes all salesrecords where the item sold is part of the 'Accessories' line. If the samecustomer has purchased Accessories and non-Accessories items, thecustomer still appears in the report, but their spending total includes onlynon-Accessories sales.

If the filter is [Lines] Except 'Accessories', only customers whohave bought no accessories are included in the report.Related Topics• Not In List operator• Different From operator

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 65

5Filtering data using promptsQuery filter and prompt operators

Page 66: xi31_sp3_webi_qry_en

To create a prompt in Query - HTMLYou can apply one or multiple prompts to a document. The prompts appearin the order you create them, but you can also edit the order in which theprompts appear later.

1. From the Universe pane, drag the object on which you want to apply aprompt onto the Query Filters pane.An outline query filter appears in the Query Filters pane.

2. Click Define filter type on the right of the outline query filter and selectPrompt from the list of filter operators.

3. Edit the prompt message to form a business question, or leave the defaultmessage.

4. Click Properties to display the "Prompt Properties" dialog box.5. Use the "Prompt Properties" dialog box to define how the prompt displays.

Defining how prompts display

By default, prompts display a box and a list of values. You answer the promptby either typing the value(s) in the box or by selecting value(s) from the list.

You can modify how prompts display by checking one, some, or all of thefollowing options:

then...(useful when you...)If you want the promptto display...

leave the option selectedby default: Prompt withList of Values

want to view all the val-ues for the object andthen select from thosevalues

the list of values associat-ed with the filtered dimen-sion, measure, or detail,

66 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using prompts5 To create a prompt in Query - HTML

Page 67: xi31_sp3_webi_qry_en

then...(useful when you...)If you want the promptto display...

select the option: Keeplast values selected

often reselect the samevalue(s) when you re-fresh the document, butwant the ability to selecta different value whennecessary, such as thename of the currentmonth

the value(s) specified thelast time the prompt wasanswered (users can se-lect a different value(s)),

select the option: Set de-fault value(s)

almost always reselectthe same value(s) whenyou refresh the docu-ment, but want the abilityto select a different valuewhen necessary, such asthe number for the cur-rent year

the value(s) you specifyas the default (users canselect a different val-ue(s)),

select the option: Selectonly from List

prevent users from typinga value that might not ex-ist on the database

a list of values from whichusers select a value(s),

To make the prompt optional, selectOptional prompt. The user is not obligedto specify a value for the prompt. In this case, Web Intelligence ignores theprompt.

Note:If the prompt is for a date and you want users to see the popup calendar inorder to select the date(s) then do not select Prompt with List of Values

To remove a prompt• Select the prompt and then click the Delete key.

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 67

5Filtering data using promptsTo remove a prompt

Page 68: xi31_sp3_webi_qry_en

Combining promptsCombining multiple prompts on a single query enables you to filter the datareturned to the document so that each person viewing the reports sees onlythe information relevant to their business need. For example, you cancombine the following three prompts on a Customer Accounts document:

• Which customer?• Which account?• Which calendar period: from? to?

This enables each accounts manager viewing the document to view reportvalues for a specific customer account during a specific period.

You combine prompts in the same way that you combine query filters.

Combining prompts with query filters

Combining prompts and filters on a single query enables you decide thevalues for some of the selected objects on the query using filters and allowusers to decide the values of other selected objects using prompts. Forexample, if you combine the following filters and prompts on a HR document:

• [Year] Equal to This Year• [Job title] Not equal to Senior Executive• Which employee?

Users viewing the document can choose which employee they viewinformation for, but they can only view data for the current year and theycan’t view data for senior executives.

To change the order of prompts in Query- HTML

1. Click Query Properties to display the Query Properties dialog box.2. Select the prompt you want to move up or down in the prompt order in

the Prompt Order box, then press the Up or Down arrow next to the box.

68 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Filtering data using prompts5 Combining prompts

Page 69: xi31_sp3_webi_qry_en

More Information

A

Page 70: xi31_sp3_webi_qry_en

LocationInformation Resource

http://www.sap.comSAP BusinessObjects productinformation

Select http://help.sap.com > SAP BusinessObjects.

You can access the most up-to-date documentation cover-ing all SAP BusinessObjects products and their deploymentat the SAP Help Portal. You can download PDF versionsor installable HTML libraries.

Certain guides are stored on the SAP Service Marketplaceand are not available from the SAP Help Portal. Theseguides are listed on the Help Portal accompanied by a linkto the SAP Service Marketplace. Customers with a mainte-nance agreement have an authorized user ID to accessthis site. To obtain an ID, contact your customer supportrepresentative.

SAP Help Portal

http://service.sap.com/bosap-support > Documentation• Installation guides: https://service.sap.com/bosap-inst

guides• Release notes: http://service.sap.com/releasenotes

The SAP Service Marketplace stores certain installationguides, upgrade and migration guides, deployment guides,release notes and Supported Platforms documents. Cus-tomers with a maintenance agreement have an authorizeduser ID to access this site. Contact your customer supportrepresentative to obtain an ID. If you are redirected to theSAP Service Marketplace from the SAP Help Portal, usethe menu in the navigation pane on the left to locate thecategory containing the documentation you want to access.

SAP Service Marketplace

https://boc.sdn.sap.com/

https://www.sdn.sap.com/irj/sdn/businessobjects-sdklibraryDeveloper resources

70 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

More InformationA

Page 71: xi31_sp3_webi_qry_en

LocationInformation Resource

https://www.sdn.sap.com/irj/boc/businessobjects-articles

These articles were formerly known as technical papers.

SAP BusinessObjects articleson the SAP Community Net-work

https://service.sap.com/notes

These notes were formerly known as Knowledge Base ar-ticles.

Notes

https://www.sdn.sap.com/irj/scn/forumsForums on the SAP Communi-ty Network

http://www.sap.com/services/education

From traditional classroom learning to targeted e-learningseminars, we can offer a training package to suit yourlearning needs and preferred learning style.

Training

http://service.sap.com/bosap-support

The SAP Support Portal contains information about Cus-tomer Support programs and services. It also has links toa wide range of technical information and downloads.Customers with a maintenance agreement have an autho-rized user ID to access this site. To obtain an ID, contactyour customer support representative.

Online customer support

http://www.sap.com/services/bysubject/businessobjectsconsulting

Consultants can accompany you from the initial analysisstage to the delivery of your deployment project. Expertiseis available in topics such as relational and multidimensionaldatabases, connectivity, database design tools, and customized embedding technology.

Consulting

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 71

AMore Information

Page 72: xi31_sp3_webi_qry_en

72 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

More InformationA

Page 73: xi31_sp3_webi_qry_en

Index508 compliance

and the HTML Report Panel 12

AActive Server Pages (ASP)

and the Java Report Panel 11adding additional queries 32adding charts to reports 9adding custom query filters 47adding formulas to reports 9adding objects to queries 28adding tables to reports 9Allow Other Users to Edit All Queries property

37ambiguous queries 36And operator 54, 55, 56answering cascading prompts 61applying using values from another query 48

BBetween operator 52, 63blocks

synchronizing drill on 21Both operator 53, 65building queries 28business intelligence

and Web Intelligence 8offline 8over the web 8

Ccalculations

improving performance of 11cascading prompts 61changing the order of prompts 38, 68charts

adding to reports 9choosing a query context 37classes

relationship with objects 29role of 29

classic measures 30Clear Contexts query property 41clearing query contexts 41CMS 8combined queries

compared with multiple queries 32compared with synchronized queries 32

combining prompts 60, 68combining prompts with query filters 68combining query filters 54, 55

example of 54combining report filters 54contexts

and universes 37choosing when running queries 37clearing 41defined 37resetting on refresh 40

copying SQL to clipboard 33creating documents 10, 28creating prompts 66custom query filters 45, 46

adding and removing 47custom scope of analysis level 35

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 73

Page 74: xi31_sp3_webi_qry_en

Ddata

analyzing 9displaying using the Document Locale 24displaying using the Preferred Viewing

Locale 24filtering 9filtering at query level 45filtering at report level 45interrupting retrieval of 31retrieving with queries 28sorting 9

data samplingand Query - HTML 41and the Java Report Panel 41

databasesand Web Intelligence queries 33sampling support in 41

date prompts 66default universe 18detail objects

defined 30relationship with dimensions 30

Different From operator 51, 62Different From Pattern operator 53, 65dimension objects

defined 29displaying data using the Document Locale 24displaying data using the Preferred Viewing

Locale 24displaying default values in prompts 66displaying hierarchical lists of values 62displaying lists of values in prompts 66document creation and viewing options 15Document Locale

defined 22, 23displaying data using 24

documentscreating 28editing 28navigating 9

documents (continued)permanently associating locales with 25printing 9saving 28selecting creation and viewing options 15selecting the default universe for 18tools for creating and editing 10viewing 9

drillhiding the drill toolbar 20setting options 20snapshots 9starting 22starting on duplicate report 22synchronizing on blocks 21

drill modeand the scope of analysis 34

drill optionshide drill toolbar option 20prompt for additional data option 21setting 20start drill on duplicate report option 22start drill on existing report option 22start drill session option 22synchronize drill on report blocks option 21

drill snapshots 9Drill toolbar

hiding 20drilling on reports 9duplicating queries 33

Eediting documents 10, 28editing the query SQL 33Equal To operator 50, 62example of cascading prompt 61Except operator 53, 65

Ffiltering data 9

74 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Index

Page 75: xi31_sp3_webi_qry_en

filtering data in queries 45filtering data in reports 45filtering queries on values from other queries

48filtering queries with keydates 57filters

adding custom query filters 47combining 54custom query filters 45predefined query filters 45query filters defined 44quick query filters 45removing custom query filters 47selecting a predefined query filter 46

fixed data sampling 41formulas

including in reports 9functions

GetContentLocale 23GetLocale 23GetPreferredViewingLocale 24

GGetContentLocale function 23GetLocale function 23GetPreferredViewingLocale function 24Greater Than operator 51, 63Greater Than Or Equal To operator 51, 63

Hhiding the drill toolbar 20how Web Intelligence merges prompts 61HTML Report Panel

and 508 compliance 12and JSP 12defined 12selecting as document creation tool 15

Iimproving calculation performance 11In List operator 52, 64InfoView 8

accessing Web Intelligence from 14logging in to 14logging out of 15selecting document creation and viewing

options in 15selecting the default universe in 18selecting the document view format in 18selecting the query editor in 18selecting universes in 28setting drill options in 20setting locale options in 22setting the Preferred Viewing Locale in 24setting the Product Locale in 23

interface localesetting 23

interrupting queries 31

JJava Report Panel

and data sampling 41and the scope of analysis 35and Web Intelligence Rich Client 11defined 11selecting as document creation and viewing

tool 15Java Server Pages (JSP)

and interactive view format 15and on-report analysis 9and Query - HTML 10and the HTML Report Panel 12and the Java Report Panel 11

Kkeydate

filtering queries with 57

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 75

Index

Page 76: xi31_sp3_webi_qry_en

keydate (continued)setting for multiple queries 58setting for single queries 57

LLess Than operator 51, 63Less Than Or Equal To operator 51, 63lists of values

displaying in prompts 66hierarchical 62restricting prompt responses to 66

localesdefined 22Document Locale 22, 23, 24permanently associating with documents 25Preferred Viewing Locale 22, 24Product Locale 22, 23

logging in to InfoView 14logging out of InfoView 15

Mmaking SQL editable 33Matches Pattern operator 52, 64Max Retrieval Time query property 38Max Rows Retrieved query property

compared to Sample Result Set property 38measure objects

defined 30merging prompts 61multiple queries 31, 32, 33

compared with combined queries 32compared with synchronized queries 32

Nnesting prompts 60nesting query filters 55, 56Not Between operator 52, 64Not Equal To operator 50, 62

Not In List operator 52, 64

Oobjects

adding to queries 28classic measure 30detail 30dimension 29measure 30relationship with classes 29smart measure 30

OLAP universes 57on-report analysis 9operators

And 54, 55, 56Between 52, 63Both 53, 65Different From 51, 62Different From Pattern 53, 65Equal To 50, 62Except 53, 65Greater Than 51, 63Greater Than Or Equal To 51, 63In List 52, 64Less Than 51, 63Less Than Or Equal To 51, 63Matches Pattern 52, 64Not Between 52, 64Not Equal To 50, 62Not In List 52, 64Or 54, 55, 56

optional promptsand SQL 33defined 60

Or operator 54, 55, 56

Ppage-to-page navigation 9Portable Document Format (PDF) 9

viewing documents as 15

76 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Index

Page 77: xi31_sp3_webi_qry_en

predefined query filters 45, 46Preferred Viewing Locale

defined 22, 24setting 24

printing reports 9Product Locale

defined 22, 23setting 23

prompt operatorsBetween 52, 63Both 53, 65Different From 51, 62Different From Pattern 53, 65Equal To 50, 62Except 53, 65Greater Than 51, 63Greater Than Or Equal To 51, 63In List 52, 64Less Than 51, 63Less Than Or Equal To 51, 63Matches Pattern 52, 64Not Between 52, 64Not Equal To 50, 62Not In List 52, 64

prompt orderchanging 68

promptsanswering cascading prompts 61changing the order of 38, 68combining 68combining with query filters 68creating 66defined 60displaying a default value in 66displaying hierarchical lists of values in 62displaying lists of values in 66displaying the previously-selected value in

66example of cascading prompt 61merging 61removing 67

Qqueries

adding 32adding objects to 28Allow Users to Edit All Queries property 37ambiguous queries 36and query contexts 36building with Query - HTML 10changing prompt order in 38, 68choosing contexts when running 37Clear Contexts property 41combining prompts in 68creating prompts in 66duplicating 33editing SQL generated by 33filtering on values from other queries 48filtering with keydates 57interrupting 31Max Retrieval Time property 38multiple queries 31, 32, 33multiple, combined and synchronized

compared 32query contexts defined 37query filters defined 44removing 31renaming 30Reset Contexts on Refresh property 40restricting access to 37Retrieve Duplicate Rows property 39Sample Result Set property 41setting the keydate for 57, 58setting time limits for 38viewing and editing SQL 33viewing SQL generated by 33

Query - HTMLand data sampling 41and JSP 10and on-report analysis 10defined 10selecting as query editor 15

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 77

Index

Page 78: xi31_sp3_webi_qry_en

query contexts 36and universes 37choosing 37clearing 41defined 37resetting on query refresh 40

query editorQuery - HTML 10selecting 18

query filter operatorsBetween 52, 63Both 53, 65Different From 51, 62Different From Pattern 53, 65Equal To 50, 62Except 53, 65Greater Than 51, 63Greater Than Or Equal To 51, 63In List 52, 64Less Than 51, 63Less Than Or Equal To 51, 63Matches Pattern 52, 64Not Between 52, 64Not Equal To 50, 62Not In List 52, 64

query filters 48adding complexity by nesting 55adding custom query filters 47combining 54, 55combining with prompts 68compared with report filters 45custom 45, 46defined 44filtering queries on values from other queries

48nesting 55, 56predefined 45predefined query filters defined 46quick filters 45removing custom query filters 47selecting predefined 46types of 45

query namesrestrictions on 30

query on query 48query properties

Allow Other Users to Edit All Queries 37Clear Contexts 41Max Retrieval Time 38Max Rows Retrieved 38Reset Contexts on Refresh 40Retrieve Duplicate Rows 39Sample Result Set 41

Query Stripping 39quick query filters 45

Rrandom data sampling 41relational databases

and Web Intelligence queries 33removing custom query filters 47removing prompts 67removing queries 31renaming queries 30report filter operators

Between 52, 63Different From 51, 62Equal To 50, 62Greater Than 51, 63Greater Than Or Equal To 51, 63In List 52, 64Less Than 51, 63Less Than Or Equal To 51, 63Not Between 52, 64Not Equal To 50, 62Not In List 52, 64

report filterscombining 54compared with query filters 45

reportsanalyzing data in 9drilling on 9duplicating 22

78 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Index

Page 79: xi31_sp3_webi_qry_en

reports (continued)filtering data in 9interacting with 8, 15making drillable 22navigating 9printing 9saving 9sorting data in 9viewing 9, 15viewing in PDF 15

Reset Contexts on Refresh query property 40resetting query contexts on refresh 40restricting prompt responses 66restricting rows at database level 41restricting the number of rows in a query 38restrictions on query names 30Retrieve Duplicate Rows query property 39retrieving a sample result set 38retrieving duplicate rows 39rows

restricting number of at database level 38, 41

restricting number of at query level 38retrieving duplicates 39sampling at database level 41

running queries 28

SSample Result Set query property

compared to Max Rows Retrieved property41

sampling rows at database level 41saving documents 28scope of analysis

and drill mode 34and universe hierarchies 34custom 35defined 34impact on document size 35levels of 35setting 36

selecting a predefined query filter 46selecting the document view format 18selecting the query editor 18selecting the query universe 28setting drill options 20setting the interface locale 23setting the keydate for multiple queries 58setting the keydate for single queries 57setting the Preferred Viewing Locale 24setting the Product Locale 23setting the scope of analysis 36setting time limits for queries 38smart measures 30SQL

and optional prompts 33copying to clipboard 33making editable 33validating 33viewing and editing 33

starting drill mode 22subclasses 29synchronized queries

compared with combined queries 32compared with multiple queries 32

Ttables

adding to reports 9toolbars

Drill toolbar 20

Uuniverse hierarchies

and the scope of analysis 34universes

and cascading prompts 61and hierarchical lists of values 62and query contexts 37defined 28OLAP universes 57

Building Queries with SAP BusinessObjects Web Intelligence Query - HTML 79

Index

Page 80: xi31_sp3_webi_qry_en

universes (continued)predefined query filters in 46selecting default 18selecting the query universe 28

Vvalidating SQL 33values

displaying hierarchical lists of 62view format

selecting 18viewing reports 9viewing the query SQL 33

WWeb Intelligence

accessing from InfoView 14and business intelligence 8and InfoView 8using offline 8

Web Intelligence interfacesetting the locale of 23

Web Intelligence Rich Client 8and the Java Report Panel 11and the scope of analysis 35defined 11selecting as document creation and viewing

tool 15WID documents 8

working with in CMS 11working with locally 11

80 Building Queries with SAP BusinessObjects Web Intelligence Query - HTML

Index