BusinessObjects Access DataAnalysis PDF
BusinessObjects Access DataAnalysis PDF
BusinessObjects 6.1
Windows
2 BusinessObjects Users Guide: Accessing Data and Data Analysis
Copyright No part of the computer software or this document may be reproduced or transmitted in any form
or by any means, electronic or mechanical, including photocopying, recording, or by any
information storage and retrieval system, without permission in writing from Business
Objects S.A.
The information in this document is subject to change without notice. If you find any problems
with this documentation, please report them to Business Objects S.A. in writing at
[email protected].
Business Objects S.A. does not warrant that this document is error free.
Copyright Business Objects S.A. 2003. All rights reserved.
Printed in France.
Trademarks The Business Objects logo, WebIntelligence, BusinessQuery, the Business Objects tagline,
BusinessObjects, BusinessObjects Broadcast Agent, Rapid Mart, Set Analyzer, Personal
Trainer, and Rapid Deployment Template are trademarks or registered trademarks of Business
Objects S.A. in the United States and/or other countries.
Contains IBM Runtime Environment for AIX(R), Java(TM) 2 Technology Edition Runtime
Modules (c) Copyright IBM Corporation 1999, 2000. All Rights Reserved.
This product includes code licensed from RSA Security, Inc. Some portions licensed from IBM
are available at http://oss.software.ibm.com/icu4j.
All other company, product, or brand names mentioned herein, may be the trademarks of their
respective owners.
Use restrictions This software and documentation is commercial computer software under Federal Acquisition
regulations, and is provided only under the Restricted Rights of the Federal Acquisition
Regulations applicable to commercial computer software provided at private expense. The use,
duplication, or disclosure by the U.S. Government is subject to restrictions set forth in
subdivision (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-
7013.
Contents
Contents 3
Examples 9
Part I Introduction
Contents
4 Accessing Data and Data Analysis
Contents
Accessing Data and Data Analysis 5
Contents
6 Accessing Data and Data Analysis
Contents
Accessing Data and Data Analysis 7
Part V Appendix
Contents
8 Accessing Data and Data Analysis
Index 519
Contents
Accessing Data and Data Analysis 9
Examples
How do the official figures compare with my personal targets? . . . . . . . . . . 45
Adding regional information to an existing document . . . . . . . . . . . . . . . . . 47
Building a query in the Query Panel and running the query . . . . . . . . . . . . . 61
Limiting query results by using a condition . . . . . . . . . . . . . . . . . . . . . . . . . 66
Create eFashion report that shows sales by store and category in Florida . 82
Create prompted eFashion report on sales by state, store and category . . 85
Creating a report showing article sales by state . . . . . . . . . . . . . . . . . . . . . 90
Accessing an Outlook inbox using VBA . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Creating an Internet query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
BUSINESSOBJECTS prompts you to link data providers . . . . . . . . . . . . . . . . 212
Reports showing revenue by country and resort, revenue by country . . . . 227
Why is revenue better in this resort than in the others? . . . . . . . . . . . . . . . 238
Move from analyzing Resort to Sales . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Analyzing profit margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Focus analysis on high-profile resort using drill filters as query conditions 259
Filter data to show sales revenue for two regions only . . . . . . . . . . . . . . . 299
Display only those stores with weekly revenue over $200 000 . . . . . . . . . 304
How can I get months to sort correctly? . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Sort customers by nationality and then by name in alphabetical order . . . 312
Display the three top-selling product lines only . . . . . . . . . . . . . . . . . . . . . 315
Show sales revenue for top three months, compare with overall revenue . 319
Which sales representatives generate revenue over $500 000 . . . . . . . . . 323
Obtaining total ordered revenue by creating a user object . . . . . . . . . . . . 331
Which customers made reservations for 2001 and 2002? . . . . . . . . . . . . . 337
When did each customer last pay for a product? . . . . . . . . . . . . . . . . . . . . 345
Which customer made the earliest reservation? . . . . . . . . . . . . . . . . . . . . 354
Which customer made the earliest reservation? (using calculation) . . . . . 355
Return list of resorts/revenues where resort country revenue > $1000000 356
Which customers bought a given product in a given time period? . . . . . . . 363
Which customers bought products in both 2001 and 2002? . . . . . . . . . . . 368
Examples
10 Accessing Data and Data Analysis
Examples
Accessing Data and Data Analysis 11
Determining the first and last days of the previous month . . . . . . . . . . . . . 496
Calculating total revenue for all resorts when some are filtered out . . . . . 499
Examples
12 Accessing Data and Data Analysis
Examples
Maximizing Your Information
Resources
preface
14 Accessing Data and Data Analysis
Overview
Information, services, and solutions
The Business Objects business intelligence solution is supported by thousands
of pages of documentation, available from the products, on the Internet, on CD,
and by extensive online help systems and multimedia.
Packed with in-depth technical information, business examples, and advice on
troubleshooting and best practices, this comprehensive documentation set
provides concrete solutions to your business problems.
Business Objects also offers a complete range of support and services to help
maximize the return on your business intelligence investment. See in the
following sections how Business Objects can help you plan for and successfully
meet your specific technical support, education, and consulting requirements.
Information resources
Whatever your Business Objects profile, we can help you quickly access the
documentation and other information you need.
Where do I start?
Below are a few suggested starting points; there is a summary of useful web
addresses on page 18.
Documentation Roadmap
The Documentation Roadmap references all Business Objects guides and
multimedia, and lets you see at a glance what information is available, from
where, and in what format.
View or download the Business Objects Documentation Roadmap at
www.businessobjects.com/services/documentation.htm
Information resources
16 Accessing Data and Data Analysis
Multimedia
Are you new to Business Objects? Are you upgrading from a previous release or
expanding, for example, from our desktop to our web solution? Try one of our
multimedia quick tours or Getting Started tutorials. All are available via the Online
Customer Support (OCS) website or on the Documentation CD.
Product documentation
We regularly update and expand our documentation and multimedia offerings.
With a valid maintenance agreement, you can get the latest documentation in
seven languages on the Online Customer Support (OCS) website.
NOTE
If your issue concerns a Business Objects product and not the documentation,
please contact our Customer Support experts. For information about Customer
Support visit: www.businessobjects.com/services/support.htm
Services
A global network of Business Objects technology experts provides customer
support, education, and consulting to ensure maximum business intelligence
benefit to your business.
Services
18 Accessing Data and Data Analysis
Address Content
Business Objects Documentation Overview of Business Objects documentation. Links
to Online Customer Support, Documentation Supply
www.businessobjects.com/services/ Store, Documentation Roadmap, Tips & Tricks,
documentation.htm Documentation mailbox.
[email protected]
Product documentation The latest Business Objects product
documentation, to download or view online.
www.businessobjects.com/services/
support.htm
Business Objects product information Information about the full range of Business
Objects products.
www.businessobjects.com
Developer Suite Online Available to customers with a valid maintenance
agreement and a Developer Suite license via the
Online Customer Support (OCS) website. Provides
www.techsupport.businessobjects.com
all the documentation, latest samples, kits and tips.
Knowledge Base (KB) Technical articles, documents, case resolutions.
Also, use the Knowledge Exchange to learn what
www.techsupport.businessobjects.com challenges other users both customers and
employees face and what strategies they find to
address complex issues. From the Knowledge
Base, click the Knowledge Exchange link.
Tips & Tricks Practical business-focused examples.
www.businessobjects.com/forms/
tipsandtricks_login.asp
Address Content
Online Customer Support
Audience
This guide is intended for non-technical end users who intend to use
BusinessObjects to build reports using corporate or personal data.
Convention Indicates
Small capitals The names of all products such as
BusinessObjects, WebIntelligence, Supervisor,
and Designer.
This font Code, SQL syntax, computer programs. For
example: @Select(Country\Country Id).
This font is also used for all paths, directories,
scripts, commands and files for UNIX.
Some code Placed at the end of a line of code, the symbol ( )
more code indicates that the next line should be entered
continuously with no carriage return.
$DIRECTORYPATHNAME The path to a directory in the Business Objects
installation/configuration directory structure. For
example:
$INSTALLDIR refers to the Business Objects
installation directory.
$LOCDATADIR refers to a subdirectory of the
BusinessObjects installation directory called
locData.
part
Introduction to BusinessObjects
chapter
24 Accessing Data and Data Analysis
Overview
This section gives a description of BusinessObjects, introduces BusinessObjects
concepts, and lists the new features in BusinessObjects 6.0 and
BusinessObjects 6.1.
Introduction to BusinessObjects
Accessing Data and Data Analysis 25
What is BusinessObjects?
BusinessObjects is an integrated query, reporting and analysis solution for
business professionals that allows you to access the data in your corporate
databases directly from your desktop and present and analyze this information in
a BusinessObjects document.
BusinessObjects makes it easy to access this data, because you work with it in
business terms that are familiar to you, not technical database terms like SQL.
Once youve used BusinessObjects to access the data you need, you can
present the information in reports as simple as tables or as sophisticated as
dynamic documents with drillable charts.
You can then save those documents for your own personal use, send them to
other users, or publish them to the corporate repository for potentially even
broader circulation.
This section gives an overview of what BusinessObjects does and how it works.
What is BusinessObjects?
26 Accessing Data and Data Analysis
universe maps to data in the database, using everyday terms that describe your
business environment. This means you can select exactly the data that interests
you using your own business terminology.
In your company or organization, universes are created by a universe designer,
using BusinessObjects Designer. The designer then makes universes available
to you and other users, so that you can access the data you want from the
database through an intuitive, user-friendly interface
Class
Universes are made up of classes and objects.
Objects
Objects are elements that map to a set of data
from a relational database using business terms.
These objects allow you to retrieve data for your
documents.
A BusinessObjects Universe
Using this interface, you build a BusinessObjects query using an editor called the
Query Panel, by adding and organizing objects from a universe. Objects are
elements that map to a set of data from a relational database in terms that pertain
to your business situation. When you run the query, BusinessObjects connects
to the database and retrieves the data mapped to the objects you selected.
A query is a type of data provider. The data provider contains the data you have
chosen to retrieve from the data source. Using this data set, you can build
interactive reports.
BusinessObjects lets you access data from a wide range of sources: from
relational and multidimensional databases, from packaged applications, from
personal data files, and, using Microsoft Visual Basic for Applications
procedures, from virtually any source.
Introduction to BusinessObjects
Accessing Data and Data Analysis 27
What is BusinessObjects?
28 Accessing Data and Data Analysis
You can add images and embedded objects and format your documents to high
presentation standards for viewing on screen or for printing.
On-report analysis allows you to switch your business perspective by dragging
and dropping data, insert on-report calculations or drill into a report for detailed
information:
Introduction to BusinessObjects
Accessing Data and Data Analysis 29
NOTE
For information on sending, retrieving, printing, and publishing and scheduling
documents, see the InfoView Users Guide. You can open an electronic version
of this guide directly from the BusinessObjects Help menu.
Security
The repository is set up and administered by the BusinessObjects supervisor. All
of the rights you have as a user are granted by your BusinessObjects supervisor
using Supervisor. The supervisor defines:
The parts of the BusinessObjects interface you can access. Your supervisor
can restrict the availability of BusinessObjects functionality, such as access
to certain menu commands.
Your database connections
The universes you can access for creating and editing queries
The rights accorded to each user define the users profile. This profile-based
security system allows a single document to be distributed to many users -- with
end users having access only to the information that they are authorized to see.
What is BusinessObjects?
30 Accessing Data and Data Analysis
Introduction to BusinessObjects
Accessing Data and Data Analysis 31
Save as Excel
Save As Excel allows you to save a BusinessObjects report as an Excel
spreadsheet, retaining the reports layout and formatting.
Introduction to BusinessObjects
Accessing Data
part
Introduction to Accessing Data
with BusinessObjects
chapter
36 Accessing Data and Data Analysis
Overview
This chapter is about accessing data, or how to get data from your database to
the reports that you create with BusinessObjects. It introduces the different data
sources that are available, and how, using BusinessObjects, you can access
these to get the information you need, when you need it.
NOTE
OLAP and SAP data providers are documented in dedicated guides that you
receive when you purchase your OLAP or SAP Access Pack. The other types of
data providers are documented in this guide.
Restrictive connections
If you are working with a universe that is set up with a restrictive connection, you
need to supply the database username and password to run a query. This
username/password is not the one that you use to log onto BusinessObjects; it is
the username/password of the underlying database (for example an Oracle or
SQL Server database) that the universe accesses. This database normally
remains hidden to you, but the universe designer can set up a restrictive
If you do not know your database username and password, see your
BusinessObjects administrator.
To run this wizard once you have launched BusinessObjects, click New Report
Wizard on the Standard toolbar.
To build a new data provider using the wizard:
New Report
Wizard 1. Select an option for the report layout, then click Begin.
The Specify Data Access dialog box appears:
3. If you chose to build a query on a universe in the previous step, the Select a
4. Select the universe that you want to use, then click Finish.
The Query Panel appears. In the Query Panel, you can view all the classes
and objects in the universe you selected, and use these to build your query.
For more information, refer to Displaying the query panel on page 56.
REMINDER
OLAP and SAP data providers are documented in dedicated guides that you
receive when you purchase your OLAP or SAP Access Pack.
3. In the Data Access group box, select the type of data provider you want to
use.
Use a Default Universe option lets you select the universe you want.
Use a Different Data Provider lets you select a data provider type from the
drop-down list.
4. Click OK to close the dialog box.
EXAMPLE
How do the official figures compare with my personal targets?
Your companys sales information is stored in your corporate database, which
you access by running a query on a universe in BusinessObjects. You already
have a BusinessObjects document containing this information.
You keep your quarterly targets in a Microsoft Excel spreadsheet and you want
to compare the corporate figures with your personal data. To do this:
1. Open the document containing the corporate data.
2. Click New Data Provider on the Data menu.
3. In the Wizard that appears, click Access new data in a different way.
5. Click Finish, and in the dialog box that appears, browse to the Excel file that
contains your personal data.
6. Click Run.
BusinessObjects makes the data from the spreadsheet available in your
report.
TIP
If you want to see the new data as soon as BusinessObjects has retrieved it, use
the Table, Crosstab or Chart commands on the Insert menu, then follow the
wizard to access the data you want.
EXAMPLE
Adding regional information to an existing document
Youre working in a document with sales figures by year, but you need some
regional information to complete the picture. Rather than building a new query,
which means creaing multiple data providers in the same document, you can
simply add result objects to the existing data provider. To do this:
1. Click Edit Data Provider on the Data menu.
In the Query Panel, add the objects you want (for example Region, City) to the
Result Objects box. You do this by double-clicking each objects icon in the
Classes and Objects list.
2. Click Run.
BusinessObjects returns the new data to the report, and, provided that your data
is displayed in a table, the new columns automatically appear.
You want the data to be sorted in a given order at the query level.
If you Then
Want to view the results that will be click Continue the execution.
created by the data provider you were
running,
Want to view the partial results created click Stop the execution and keep the
by the data provider when you partial results.
interrupted the execution, When you have partial results in a
report, the following notification
appears in the status bar:
Want to view the results of the previous click Keep the results of the previous
execution, execution.
3. Click OK.
chapter
52 Accessing Data and Data Analysis
Overview
This chapter is about accessing data by using BusinessObjects native
technology: building queries on universes.
What is a universe?
BusinessObjects universes make it easy to access data because they contain
objects of data in business terms that are familiar to you. Whats more, you need
no knowledge of the database structure, or of database technology, to be able to
create powerful reports with data that is relevant to your work.
Universes provide the business-intelligent, semantic layer that isolates you from
the complexities of the database. A universe maps to data in the database in
everyday terms that describe your business situation.
Universes are made up of classes and objects. For example, the objects in a
human resources universe would be Names, Addresses, Salaries. Classes are
logical groupings of objects. Each class has a meaningful name, such as
Vacation (for objects pertaining to employee vacations). Each object maps to
data in the database and enables you to retrieve data for your reports.
Demonstration materials
Two demonstration databases, Island Resorts Marketing and eFashion, and their
accompanying universes and reports are included in the BusinessObjects
package. They are installed with BusinessObjects, and used in the examples in
this guide. The databases are compatible with Microsoft Access 2000. The
BusinessObjects CD also includes generic SQL scripts and data files to allow a
database administrator to build the databases on any RDBMS.
A folder represents a
class.
Dimension objects retrieve the data that will provide the basis for analysis in
a report. Dimension objects typically retrieve character-type data (customer
Dimension names, resort names), or dates (years, quarters, reservation dates)
object
Measure objects are semantically dynamic: the values they return depend on
the objects they are used with. For example, if you include Resort and
Measure Revenue in a query, revenue per resort is calculated. If you include Customer
object and Revenue, revenue per customer is calculated, and so on.
eFashion
The eFashion demo database contains retail data from a clothing chain. It tracks
211 products (663 product color variations), sold over 13 stores in the US, over
three years. It contains approximately 90,000 rows of data.
56 Accessing Data and Data Analysis
If you need more information, refer to Workflows for accessing data on page 42.
The Query Panel displays the contents of your BusinessObjects universe and
lets you select data with simple mouse clicks.
d
e f g h i j k
4. Click Finish.
The Query Panel appears with the classes of the Island Resorts Marketing
universe displayed:
EXAMPLE
Building a query in the Query Panel and running the query
You have displayed the Query Panel for the Island Resorts Marketing universe
and want to move objects from the Classes and Objects box to the Result Objects
box to build your query.
1. Click the + sign next to the Resort class, the Sales class and the Measures
class.
Doing this reveals the objects in each class.
2. Double-click the objects you want. For example, to find out yearly revenue in
each resort, double-click Resort, Year, and, in the Measures class,
Revenue.
The Query Panel now looks like this:
3. Click Run.
BusinessObjects retrieves the data for Resort, Year and Revenue and
NOTE
If the universe designer has set the up the universe with a restrictive connection,
BusinessObjects prompts you to enter your database username and password
before retrieving the data. For more information on restrictive connections, see
Restrictive connections on page 40.
NOTE
All the above tasks are easy to perform for non-technical end users. In
"Customizing Queries on Universes" on page 329, you can find information on
more powerful query building procedures that are designed for advanced users.
NOTE
If a universe contains no hierarchies, BusinessObjects uses its classes as
hierarchies by default.
To use this feature, first insert an object from a hierarchy in the Result Objects
box. Then, click the arrow on the Scope of Analysis list box on the Query Panel
toolbar:
This list enables you to include one, two or three objects from the hierarchy in
your scope of analysis. For example, if you insert Resort in the Result Objects
box, then click One Level Down, your scope of analysis contains the object below
Resort (Service Line) in the Resort hierarchy. Click the option that corresponds
to the number of objects you want to include in your scope of analysis. This option
is now active in the Scope of Analysis list box.
When you run the query, the report displays the data for the objects that you
included in the Result Objects box of the Query Panel. The data for the objects
in your scope of analysis is not displayed, but it is available for use in analysis.
TIP
You can select all the objects in a hierarchy by clicking the hierarchy check box
in the Scope of Analysis dialog box.
Applying conditions
A condition is a way of limiting the data that a query returns. Heres a simple
example.
EXAMPLE
Limiting query results by using a condition
The Resort object retrieves five values: Australian Reef, Bahamas Beach,
French Riviera, Hawaiian Club and Royal Caribbean.
You can apply a condition on the Resort object to stipulate that you want to
retrieve the data for only the Bahamas Beach and Royal Caribbean resorts only.
In BusinessObjects, you can set three types of conditions on a query:
Condition Description
Predefined conditions When universe designers build universes, they can
create predefined conditions for you to use. For
example, the Island Resort Marketing universe
contains predefined conditions such as Year 2002,
which lets you obtain reservations for 2002 only.
You can apply one or more predefined conditions
when you build a query. However, you can neither
delete predefined conditions from a universe, nor
can you edit their definition.
Simple conditions Enable you to limit data returned by a result object.
For example, you can find out about certain
customers by applying a simple condition on the
Customer object, then selecting the customer
names that appear in a dialog box.
Complex conditions Enable you to limit the query results by any object in
the universe.
For more information on complex conditions, refer to
Applying complex conditions on queries on
page 337.
illustrated here:
TIP
For information on using two or more conditions in the same query, refer to Using
an existing query in a condition on page 356.
3. Hold down the Ctrl key on your keyboard, click the values you want the object
to retrieve, then click OK.
The condition appears in the Conditions box.
When you run the query, only the data corresponding to the value(s) you
selected will appear in the report.
Applying sorts
Sorts control the order in which data appears: ascending or descending. For
example, you can apply a sort on a measure object so that its data appears in
ascending order, from lowest to highest values.
The following table summarizes the order in which data appears:
To invert a sort
Double-click the sort icon below the object. The arrow in the sort icon appears the
other way up, to indicate that you have inverted the sort.
2. Click No Duplicate Rows if you want to eliminate duplicate rows of data from
chapter
74 Accessing Data and Data Analysis
Overview
This chapter explains how to create reports using data providers other than
BusinessObjects universes. In addition to universes, you can build reports using
free-hand SQL, stored procedures, personal data files, Visual Basic for
Applications (VBA) procedures, XML files, OLAP cubes and Web Connect.
5. Click the Parse button to check the script for SQL errors.
BusinessObjects runs the SQL against the database and displays any error
message that the database returns.
Parse
NOTE
BusinessObjects does not execute COMPUTE and ORDER BY clauses in free-
hand SQL statements.
9. Click Run.
The data retrieved by the SQL query appears in the report.
To create a connection
1. Click Create a New Connection.
The Add a Connection dialog box appears.
Create New
Connection
2. Choose the driver that you will use to connect to the database, then click OK.
The Connection Properties dialog box appears. This box varies according to
the database driver you selected.
3. Type a name for the connection in the Name box and select the RDBMS from
the Database Engine list box.
4. Type the username, password and database/datasource name in the Login
Parameters box.
5. In the Type list box, select Personal or Shared.
Personal means that only you can use the connection.
Shared means that other users can use the connection.
6. Click Test to check that the connection is correctly defined. If you receive an
error message, check the parameters you have entered and try again. If you
still cannot successfully create a database connection, see your database
administrator.
To edit a connection
You can edit any connection after you have created it. To do this:
1. In the Free-Hand SQL dialog box, select the connection from the Connections
EXAMPLE
Create eFashion report that shows sales by store and category in Florida
1. Start BusinessObjects
2. Click New Report Wizard.
3. Select an option for the report layout, then click Next.
4. Select Free-hand SQL from the Others list box, then click Next.
New Report The Free-Hand SQL dialog box opens.
Wizard
You now need to create a connection to the Microsoft Access eFashion
database. To do this:
5. Click Create New Connection.
The Add a Connection dialog box opens.
6. Select ODBC drivers from the list of drivers and click OK.
Create New
Connection The Connection Properties dialog box opens.
7. Type eFashion in the Name box, select eFashion from the Data Source
Name list box, select MS Access 2000 from the Database Engine list box,
then click OK.
The eFashion connection you have just created now appears as the current
connection in the Connection box.
8. Type the following SQL in the Free-Hand SQL dialog box:
EXAMPLE
Create prompted eFashion report on sales by state, store and category
1. Click New Report Wizard.
2. Select an option for the report layout, then click Next.
3. Choose free-hand SQL from the Others list box, then click Next.
The Free-Hand SQL dialog box appears.
4. If necessary, create a connection to the eFashion database (see Creating a
report showing sales by store and category on page 82 for an explanation of
how to do this).
5. Type the following SQL into the Free-Hand SQL dialog box:
7. Click Values.
The List of Values dialog box appears.
SELECT ol.shop_name,
al.article_label,
SUM (sf.quantity_sold) as total_sold
FROM outlet_lookup ol INNER JOIN (
shop_facts SF INNER JOIN article_lookup al
ON sf.article_id = al.article_id )
ON ol.shop_id = sf.shop_id
WHERE ol.state = @state
AND al.article_label LIKE '%' + @article + '%'
GROUP BY ol. shop_name,
al.article_label
EXAMPLE
Creating a report showing article sales by state
1. Click the New Report wizard button on the Standard toolbar.
The New Report Wizard appears.
2. Select an option for the report layout, then click Next.
New Report
The Specify Data Access dialog box appears.
Wizard
3. Click Others, then select Stored procedures. from the list.
6. Click Finish.
If the stored procedure has input parameters, supply values for each parameter
by typing its value in the Values box.
For each parameter
7. Click Run.
BusinessObjects runs the stored procedure and places its data in a report.
4. Click Browse to locate the file that contains the data you want.
The Open a File to Access Personal Data dialog box appears.
When you have located the file and closed the dialog box, the path to the file
appears in the Name field of the Access Personal Data dialog box.
The Format field displays the format of the file you selected.
The options in the dialog box are now specific to the file type you are working
with.
If you have selected a dBASE file, no further options are available so click
Run.
5. Set the options you want:.
6. Click Run.
The data from the personal data file appears in the report.
3. Under Others, click Visual Basic for Applications procedures, then click
Finish.
The Access Data From VBA dialog box appears.
Edit
subroutine
Selected
subroutine
Create new
subroutine
Delete
subroutine
Available Add a
subroutines description for
Debug Run selected
selected the selected
subroutine
subroutine subroutine
EXAMPLE
Accessing an Outlook inbox using VBA
This example shows how to generate a report based on the contents of an
Outlook inbox.
sColName(1) = "From"
sColName(2) = "To"
sColName(3) = "Cc"
sColName(4) = "Subject"
sColName(5) = "Size"
sColName(6) = "Created"
sColName(7) = "Received"
'Loop through 10 rows in the inbox and assign values to the 7 columns
'in each row.
For row = 1 To 10
'Get the row's data.
Set objMail = objInboxFolder.Items.Item(row)
oColData(1) = objMail.SenderName
oColData(2) = objMail.To
oColData(3) = objMail.CC
oColData(4) = objMail.Subject
oColData(5) = objMail.Size
oColData(6) = objMail.CreationTime
oColData(7) = objMail.ReceivedTime
'Loop throug the columns.
For col = 1 To 7
Set oCol = oColumns.Item(col)
'Set the column name and data type on the first iteration.
If row = 1 Then
oCol.Name = sColName(col)
'First 5 columns are strings, last 2 are dates.
If col < 6 Then
oCol.Type = boCharacterObject
Else
oCol.Type = boDateObject
End If
End If
oCol.Qualification = boDimension
oCol.Item(row) = oColData(col)
Next col
Next row
dpInterface.CheckDataIntegrity (boCheckAll)
End Sub
6. Click Compile on the Debug menu to compile the project.
7. Click Close and Return to BusinessObjects on the File menu to return to
BusinessObjects.
8. Click Run.
BusinessObjects generates the report.
What is XML?
XML is a text-based data format that structures data in elements or tags. XML
files are similar to the HTML files used to build pages on the World Wide Web.
The principal difference is that, whereas the set of HTML elements is limited to
those used to describe the structure of a Web page, an XML file can contain any
elements, depending on its application.
Here is an example of an XML file containing data from the Island Resorts
Marketing database:
</Resort>
<Resort>
<Country>US</Country>
<ResortName>Bahamas Beach</ResortName>
<ServiceLine>Recreation</ServiceLine>
<Revenue>128100</Revenue>
</Resort>
</Resorts>
XML files can store many different types of data. This manual could be stored as
XML, as could the data in a relational database. Database-like XML, such as the
bookstore data above, is the only XML that is meaningful as a datasource for
BusinessObjects.
3. Click Others and select XML Data Provider from the Others box, then click
Next.
5. Click Load XML, then use the Open dialog to navigate to and select the XML
file.
The structure of the XML file appears in the Structure box.
To reload the XML, click Refresh. To display the values of an element, select
the element in the structure box and click Display Sample Values.
8. Click Save.
The Save XML Filter As dialog box appears.
9. Type a filter name in the New Filter Name text box and click OK.
The filter appears in the list of XML filters.
3. Click Others and select XML data provider from the Others box, then click
Begin.
6. Click Run.
BusinessObjects generates the report.
3. Select XML Sources to change the location of XML source files or XML
Filters to change the location of XML filter files.
4. Click Change.
The Browse for Folder dialog box appears.
5. Use the Browse for Folder dialog box to select the folder where you want the
files to be stored.
6. Click OK to close the Browse for Folder dialog box.
7. Click OK to close the Options dialog box.
chapter
120 Accessing Data and Data Analysis
Overview
This chapter discusses Web Connect, a data provider that allows you to retrieve
data from pages on the World Wide Web.
NOTE
The catalogs themselves are simply pointers to the query files. It is the queries
themselves that contain all the necessary information for retrieving specific data
from the referenced web page(s), as well as the display options and any prompts
that may have been included.
Although the long term distribution media of data over the Internet is likely to be
in XML format, it seems that more than 99% of the data available on the web
today is in HTML format. Web Connect allows you to query this HTML data,
providing access to the vast majority of the Internet.
Grid Browser
area window
Once you have selected a query in the Internet Query Wizard and clicked on
Finish, the query is run and displayed in a BusinessObjects report.
You can also create your own predefined queries.
You can also select cells from any number of web pages and combine them into
the same table in the lower section of the window. For example, you might want
to pull your competitors' stock quotes (from a Stock Market financial web site)
and their quarterly revenue (from their corporate web site) into the same table.
Furthermore, you can build reports from both Internet data and other data
sources. For example, you could combine the Euro to Dollar exchange rate from
the Internet with sales figures from a universe to get European sales in Dollar
equivalent.
Generating reports
Once you have selected the data you want in your Internet query, you click Run
to generate a BusinessObjects report. You can format this report as with regular
BusinessObjects reports. If you choose to edit the data provider, you are returned
to the Internet Query Panel.
NOTE
You can slice and dice in an Internet query report, and you can save your Internet
query for personal or for corporate use. However, you cannot directly drill down
into an Internet query report within Web Connect. In order to drill into data in an
Internet query, you must first manually define the object hierarchy in
BusinessObjects. For information on this procedure, refer to Drilling using
custom hierarchies on page 262.
Refreshing reports
When you refresh a report based on an Internet query, BusinessObjects will
reconnect to the web page(s) and bring back the most current data. If the
structure of the web page has changed, you will be notified by an error message
3. Select Others, click on the list of data providers, choose Web Connect from
the list, then click Finish.
This wizard helps you select the way you want to access Internet data:
Click New Query to create your own query.
Click Corporate Query to retrieve and use an existing query from a predefined
Corporate catalog.
Click Business Objects Query to retrieve and use an existing qualified query
from the Business Objects web site.
These queries may be stored anywhere on the external Web or on the intranet
file server. The queries themselves are listed in catalog subdirectories. The
catalogs are arranged hierarchically in a tree structure that can be expanded and
collapsed.
Both catalogs and queries are saved in XML format. When you double-click on
an XML file, it is automatically opened in your web browser.
NOTE
The catalogs are simply pointers to the query files. It is the queries that contain
all the necessary information for retrieving specific data from the referenced web
page(s), as well as the display options and any prompts that may have been
included.
2. Select a query.
A description of the query appears under Help on the selected query..
3. Click Finish.
A progress bar appears while Web Connect makes a connection to the
associated web site(s) and retrieves the query information.
The retrieved query information is displayed in the report window like any
BusinessObjects report.
You can now work with this report as you would with any other BusinessObjects
report.
3. Click Corporate Query, type the path to the location of the queries, then click
Next.
2. Click New Query to create your own query, then click Next.
The Internet Query Panel is displayed.
a.
a. Toolbar
b.Browser window
c.Query grid header
d.Query grid body
NOTE
If you want to change the page that is automatically displayed as your home page
in Internet Explorer, click Internet Options in the Tools menu in Internet Explorer,
and enter an alternate URL in the home page address field.
the web data in a single cell. This method is primarily useful if you ultimately
display this data as HTML, by right clicking the appropriate cell in the query grid
and then selecting HTML from the drop down menu (for information on creating
a BusinessObjects report in HTML, refer to Creating a BusinessObjects report
in HTML on page 144).
NOTE
URLs used to create your queries are saved in the registry so you can retrieve
them within the Internet Query Panel combo box.
EXAMPLE
Creating an Internet query
In the following example you create a query by extracting currency conversion
data from a web site. Once the query has been successfully generated, you will
be able to create a simple BusinessObjects report by clicking Run.
To create an Internet query:
1. Enter the URL of the site you wish to query in the Address box. (In this
example the site is a site that provides currency conversion data.)
2. Select the two currencies for which you want the conversion rate: US Dollars
and Euros.
3. Click Convert in the browser window to display the current exchange rate.
4. Highlight the text US Dollars, and drag it to the header area of the Internet
Query Panel.
This creates a small table of cells, 3 columns wide by two rows deep.
Note that the top row of the new table in the Internet Query Panel is shaded.
This is the header row. The non-shaded rows are the body rows. For each
query that you generate, you will need to differentiate between header data
and body data.
5. In the browser window, highlight the 1 below US Dollars and drag it to the
first body cell in the Internet Query Panel.
Note that the first column of the table in the Internet Query Panel is also
shaded. This is used by Web Connect to number the rows.
6. Repeat the above procedure to drag the Euro data into the Internet Query
Panel.
The result appears as follows:
As you add values, Web Connect always adds an extra column to the right of
your data in the grid, and an extra row below. Only the drag and drop and
paste options are enabled on these added cells. All other options on the right-
click menu are grayed out.
If you make a mistake while copying data to the cells in the Internet Query
Panel, right-click on the cell and click Clear Selection on the shortcut menu.
1. Within a new report in the Internet Query Panel, create a new query and enter
the URL of the web site from which you want to extract your data.
2. Construct your query in the query grid (for information on creating Internet
queries, see Creating a new Web Connect query on page 133).
3. Select your data and drag it into a single cell in the query grid by dropping the
selected data while holding down the shift key.
The selected data appears in a single cell in the query grid.
4. Optionally, right click on the active column and click Rename Header on the
shortcut menu to enter a name in the header row.
5. Right click on the selected cell and click HTML on the shortcut menu.
format the individual cells of the report in order to view the HTML data.
7. To format a cell, right-click it then click Format Cell on the shortcut menu.
The Format Cell window appears.
NOTE
Publishing your document to Corporate Documents allows you to view and
refresh your data in InfoView. Saving your report as HTML will allow you to view
your document in a Web browser, but you will not be able to refresh your data.
Your document will be static.
12. Open your report in InfoView or in your Web browser. The resulting report will
display the data you extracted from web sites using Web Connect.
NOTE
Creating reports in HTML using Web Connect allows you to display web
components such as graphics in your reports, as demonstrated with the charts in
the above report. However, only components referenced by absolute links may
be viewed. Graphics linked by relative reference cannot be viewed.
Saving Reports
You can save any of the reports you generate as follows.
1. Click Save on the File menu.
2. Select a location, enter a name for the report, then click Save.
The report is saved with a .rep extension.
You can click on the .rep file to open the report in BusinessObjects and
refresh it.
NOTE
When you save a report, you are saving the query results and the definition of the
query itself. For information on saving queries individually, refer to Saving Web
Connect queries on page 167.
Saving Reports
150 Accessing Data and Data Analysis
NOTE
You can also delete the entire grid by right-clicking in the top lefthand cell of the
table.
What is a prompt?
A prompt is an extra feature that you can add to your queries in order to refine
the type and amount of information that is displayed in the report each time the
query is run.
When you run a query or refresh a report that contains prompts, a small dialog
box is displayed. This dialog box prompts you to make a selection from a series
of items, and will determine the content of the report.
You can create a prompt by opening a query and clicking the Prompts button.
This opens a dialog which allows you specify exactly how the prompt will work.
Here, you specify the type of prompt(s) you will use:
Up to nine monovalued prompts.
One multivalued prompt plus up to eight monovalued prompts.
Monovalued prompts
A monovalued prompt is a prompt which allows you to select one -- and only one
-- item from a list of items. For example, the prompt illustrated above shows that
3 items have been selected, AUD;GBP;ITL. However, if this is a monovalued
prompt, then only the first item selected (AUD) will be used when the query is run.
Multivalued prompts
A multivalued prompt is a prompt which allows you to select several items from
a list of items. Using the same example, if all 3 items are selected
(AUD;GBP;ITL), then the data relating to these three prompts is retrieved when
the query is run.
Creating a prompt
This section explains how to create a single multivalued prompt using the
previous example.
1. Open the report in BusinessObjects.
2. Click Edit Data Provider on the Data menu.
The Internet Query Panel appears.
3. Click Prompts.
The Internet Query Prompts dialog box appears.
The URL used within the current Internet query is automatically retrieved and
displayed in the URL list box.
5. Click New.
The Prompt Properties dialog box appears.
.
6. Click Monovalued
- Monovalued prompts allow the user to select one value from the list of
values related to the prompt.
- Multivalued prompts can reference multiple data cells. This option is grayed
out if you have already created a multivalued prompt on the selected query:
only one multivalued prompt is allowed per Internet query.
7. Type Currency in the Prompt Name box..
8. Click Insert to enter additional items in the List of Values field.
A new item is added in the box.
13. To associate the newly created prompt with the URL currency field, select the
section of the URL you want to replace with the prompt (in this case, EUR
at the end of the URL).
The selected text area is displayed at the bottom right-hand side of the dialog
box.
NOTE
The format for a prompt in a URL is:
http://...@prompt(message). You can enter several prompts within the same
URL, but only one multivalued prompt can be entered per Internet Query.
and the URL returns to its initial value (that is, with EUR at the end.).
16. Right-click on the Euro header click Rename Header on the shortcut menu.
Enter Exchange Rate in the Rename Cell dialog box then click OK.
The Enter or Select Values dialog box shows a list of the values you
selected.
3. Click OK again.
The Internet Query in Progress dialog box appears while the query executes,
and then the report is displayed.
Managing Queries
This section explains how to open, edit, and save existing Internet queries, and
how to set your Internet query preferences
This dialog box allows you to open and edit an existing query. This is an important
function in dealing with web data, given that the structure of web pages may
change frequently. If the structure of a web page changes, the cells of the
corresponding report which contain this data will display an error message (for
more information on data-source error messages, refer to Conversion errors on
page 174). If you select the Save query location option, Web Connect points to
the location of the selected query by default the next time you click Open Internet
Query.
NOTE
The Open dialog box also allows you to reload a predefined query if its definition
has changed and the new definition has been uploaded on the web by IT. This is
an effective way to resolve errors resulting from changes in the structure of
source web pages.
Managing Queries
166 Accessing Data and Data Analysis
4. Add, delete, or change any of the cells that are referenced in the query, as
required.
5. Edit the prompt fields, as necessary.
6. If you wish, save the query with a new filename.
7. Click Run.
Managing Queries
168 Accessing Data and Data Analysis
Setting preferences
You can modify your Internet Query Panel preferences to set a page download
timeout and a default size for the Internet Query Panel.
1. Click Preferences in the Internet Query Panel.
The Preferences dialog box appears.
2. Choose one of the available timeout options. This is the maximum amount of
time, in seconds, that Web Connect will use when attempting to display a web
page in the browser window.
You can select an incremental value between 5 and 180 seconds, or enter
the value of your choice.
3. Choose a default size for the Internet Query Panel. Your options are:
X-Small
Small
Medium (default)
Large
X-Large (full screen)
NOTE
These sizes will always be proportional to your screen resolution.
4. Click OK.
Refreshing documents
When you refresh a report that contains prompts, a dialog box appears with the
different prompt names.
When refreshing a report without prompts, the latest web data will be
automatically retrieved based on the information entered in your Internet query.
The difference between the monovalued and multivalued prompt options
appears when you try to refresh the Internet Data Provider. For monovalued
prompts, you enter only one value per prompt, while for multivalued prompts, you
can enter several values.
Refreshing in InfoView
When refreshing a document in INFOVIEW, the regular INFOVIEW prompt dialog is
displayed.
Managing Queries
170 Accessing Data and Data Analysis
2. Right-click in the area of the page which contains the data you want to extract,
then select Properties on the shortcut menu.
The Properties dialog box appears..
Note the URL address. This is the specific address of the frame that contains
the data you want to access.
3. Highlight the address and press CTRL-C to copy it to the clipboard.
4. Click Cancel to quit the Properties dialog box.
The multiple-frame web page is displayed again in the Internet Query Panel.
5. Highlight the URL address in the browser area, press CTRL-V to insert the
specific frame address you copied, and press Enter.
The browser now displays only the single-frame data.
6. Extract the cells you require from the frame for your report.
NOTE
You cannot apply this workaround to some multiple-frame pages, such as those
containing frames that reference other frames.
Autoqualifying cells
When you create and run your Internet queries, the data is automatically qualified
by Web Connect. This qualification is actually performed when you click Run.
However, as you have seen in Internet Query Grid Context Menu Options on
page 150, you can manually qualify any of the data cells in the Query grid. If you
do this, then whenever you run the query, Web Connect will always use your
manual data qualifications.
To override any manual qualifications you may have made, you must autoqualify
the data in the Query grid. This resets all manual qualifications, forcing
autoqualification on previously qualified columns.
1. Open or create your Internet query.
2. Click Autoqualify on the Internet Query Panel
Parsing cells involves retrieving their content and checking it for possible
conversion to numeric data.. A numeric cell can only contain numbers and two
additional character types ([ ], ['] [.] and [,] for thousands separator and [.] or
[,] for decimal separator. [+] and [-] are also accepted in front of the number).
For example, the following strings can be converted to numeric:
1 000 432
1.234.345,23
1.43
1'324.23
NOTE
A column can only be autoqualified to a Dimension/Character or Measure/
Numeric.
NOTE
The autoqualify button forces autoqualification for all columns, whether
previously qualified or not.
Managing Queries
172 Accessing Data and Data Analysis
Separator options
When you drag numeric data to the Query grid, Web Connect interprets any
separators it finds according to a predefined algorithm.
For example:
If you select a dot (.) decimal Separator, then whenever Web Connect
encounters an ambiguous numerical value, it will always use the dot separator
instead of the comma separator.
If you select a comma (,) decimal separator, then whenever Web Connect
encounters an ambiguous numerical value, it will always use the comma
separator instead of the dot separator.
NOTE
If you do not set a Separator option, then by default in an ambiguous situation
Web Connect will use a dot separator.
Managing Queries
174 Accessing Data and Data Analysis
Conversion errors
When refreshing an Internet query, if a cell content cannot be converted to the
previously set Qualification/Type, then you can configure Web Connect to act
according to any of the three following rules:
Set cell to #EMPTY: The report cell is displayed empty.
Set cell to #ERROR: The text #ERROR will be displayed in the report cell.
Convert column to Character: All of the cells in the column containing the error
are converted to type Character and are displayed in the report.
1. Start your Internet browser, and try to access a web page that requires basic
authentication.
A login dialog box such as the one below might appear:
1. Extend the http://USER:PASS@ string with the URL of the web page you are
trying to access.
In this example:
http://USER:PASS@localhost/wi/bin/iswi.dll/WIGenerator/wigenerator/
generator/ExecuteWIS?sWIS=Welcome
2. Click OK.
The Internet Query User Identification dialog box appears..
3. Enter the required user name and password, then click OK.
Your Internet query is now set up to automatically provide the necessary
authentication data each time you run the query, or refresh reports that are
based on it.
NOTE
Web sites that require Windows NT authentication are also supported, provided
the domain the user is trying to log into is the default domain. Only sites
requesting client certificates are supported. Sites requesting server certificates
are not supported.
Form authentication
This section explains how to configure Web Connect to access a web page that
requires authentication data which is embedded in a form. Once you have set up
this query authentication, you will be asked to enter your username and
password when you run the query for the first time. However, after entering this
authentication data once, you will not be required to enter it again during the
current session.
Whenever you start a new session, you will need to enter your password again.
Your username is stored with the document.
1. Start your Internet browser and access a web page that requires form
authentication.
A web page such as the following appears.
dialog box.
3. Select the first cell in the header and extend the selection to the second row.
This selects the entire table.
4. Drag the selection to the header area in the Internet Query Grid.
NOTE
In this example, before adding a prompt, make sure you have a list of company
ticker symbols. You will need to enter these when building the prompt. Later on,
when you generate your reports, you will then be able to choose the companies
that you want to include (by selecting the appropriate ticker symbol).
3. Click New to display the Prompt Properties dialog box, and then click Insert
A new item appears in the List of Values panel.
4. Enter one of the ticker symbols, and press the Return key. Alternatively,
select an existing list of values by clicking Import list of values (for more
information on importing lists of values, refer to Using Prompts with Web
Connect Queries on page 153).
5. Click Insert again to enter another ticker symbol, and repeat this process until
you have entered all the symbols you require.
text that you select is then displayed below in the Selected text area box.
This string will now be used by Web Connect to retrieve any of the specific
data that you are prompted to request the next time you run the query.
12. Click OK to return to the Internet Query Panel.
14. Select the company ticker symbols from the values displayed, and click OK.
BusinessObjects generates the report.
2. Locate the web site that contains the data you require.
In this example, use the browser window to select two currencies for which
we want the conversion rate -- US Dollars and Japanese Yen
3. Drag the required data cells into the Internet Query Panel.
To do this:
1. Click Prompts in the Internet Query Panel.
The Prompts dialog box appears.
8. Click OK.
The Internet Query Prompts dialog box is re-displayed with the prompt added.
9. Select the section of the URL you want to replace with the prompt (in this
case, USD ).
The selected text area is displayed at the bottom right hand side of the dialog
box.
values.
5. Type the names of the currencies that you would like to be able to convert to
in the list of values.
Each time you generate a report, you will be able to choose any or all of these
currencies to display their current conversion rate against the base currency
you select at the first prompt.
6. Click Create an associated column to associate the extra values you have
added with a new column.
A column name is automatically entered, corresponding to the Prompt name
you entered.
7. Click OK.
The Internet Query Prompts dialog box is re-displayed, with the prompt
added.
8. Select the Convert to prompt in the middle window.
9. To associate the newly created prompt with the URL currency field, select the
section of the URL you want to replace with the prompt (in this case, JPY in
the URL address).
The selected text area is displayed at the bottom right-hand side of the dialog
box
chapter
202 Accessing Data and Data Analysis
Overview
The data you need might not all come from the same source. For example, you
might have business objectives in a corporate database and personal data that
you store in a spreadsheet. BusinessObjects enables you to combine data from
different sources in the same report.
This chapter explains
the different data sources you can use
how to include data from different sources in the same report
when BusinessObjects automatically links data from different sources, and
when you have to make the link yourself
6. Click Begin.
The Specify Data Access screen appears.
7. Select the type of data provider you want to use, then click Finish. The editor
for the data provider appears.
8. Define and run the data provider.
BusinessObjects can automatically link data providers. It will prompt you to
link the new data provider with the existing data provider if:
No common dimension exists between them. Common dimensions are
dimensions with the same name occuring in the same universe. Dimensions
called Year that occur in a universe and an Excel spreadsheet are not
common. BusinessObjects will prompt you to link them.
and
The new block is in a section.
The new data appears in the new block.
Further information
For further information on linking data providers, refer to Linking data providers
on page 212.
If you Then
Want to display data in an existing use the Pivot tab in the Table Format
table or crosstab, dialog box.
Want to display data in an existing use the Pivot tab in the Chart Format
chart, dialog box.
Want to display data in any type of use the Slice and Dice Panel.
existing block,
.You can use the common dimension from either data provider. Most often, you
can use measures from both data providers in the same block.
4. In the Used Variables box, click the folder that represents where you want to
display the data: Columns, Rows, Body.
5. In the Available Variables box, click the variable you want to add, then click
Add.
6. Click OK.
4. Click Use an existing query to build a new one. (This option is not available if
your report does not already contain at least one data provider based on a
universe, personal data provider or OLAP data provider.)
A list of data providers currently in the document appears.
EXAMPLE
BusinessObjects prompts you to link data providers
Heres an example scenario where BusinessObjects prompts you to link data
providers:
You create a new document by running a query on a universe.
You format the report as a master/detail, using for example the Year
dimension.
You want to compare yearly revenue with your sales targets, so you insert a
new table in the Year section.
Rather than inserting data from the document, or using the universe you ran
the first query on, you pull in data from the spreadsheet that contains your
personal targets.
Even though the spreadsheet contains the Year column, BusinessObjects
prompts you to link the personal data file with the query already in the report,
because youre inserting the new data in a section thats generated by the
query data.
Additionally you should use only dimensions that return the same type of values.
It doesnt make sense to create a link between dimensions with totally different
lists of values (Year and Region, for example).
The dimension you clicked in the Dimensions box appears below the dimension
in the Master(s) in the Report box:
8. Click OK.
The new data appears in the report. Measures are automatically calculated.
NOTE
If the Links Between Data Provider and Report dialog box appears, and you click
OK or Cancel without creating a link, you will obtain a Cartesian product. A
Cartesian product is a report result that returns each row from the first data
provider joined to every row from the second. If the first data provider has 100
rows and the second 50, the Cartesian product contains 5000 rows.
The Define Link Between Dimensions dialog box appears. It lists the
dimensions you can use to link the two data providers.
5. Click the dimension you want to use as the link.
The symbol next to the dimension name now changes to indicate that the
dimension is the link between two data providers. This symbol will also now
appear when you click the dimension in the Data Manager.
6. Click OK to close the dialog box, then click OK in the Data Manager.
You can now use the linking dimension to apply a master/detail format in the
report.
chapter
220 Accessing Data and Data Analysis
Overview
In what ways can you manage queries and other data providers in
BusinessObjects documents? This chapter answers that question by describing
how to:
rename data providers
get statistics such as the date and time a data provider was last refreshed,
and how many rows of data were returned
empty data providers of their data (called purging), and delete data providers
you no longer need
REMINDER
Data provider is the BusinessObjects generic term for all types of queries:
queries on universes, free-hand SQL, stored procedures, VBA procedures, XML
files, OLAP cubes and Web Connect.
Here are a few cases where you might want to rename data providers.
Giving data providers more meaningful names can help you know right away
which one you want.
Definition tab:
4. Type the new name in the Name box, then click OK.
TIP
You can populate a purged data provider by clicking Refresh Data on the Data menu.
Note that this command refreshes all the data providers in the active document.
EXAMPLE
Reports showing revenue by country and resort, revenue by country
In this example the Revenue and Country objects are common to both reports.
Instead of creating a data provider for each report you create a data provider
containing the Revenue, Country, and Resort objects and use these objects in
both reports. To do this:
1. Create a report showing revenue by country and resort by dragging the
Country, Resort and Revenue objects into the report. (See Building a basic
query on a universe on page 56 for an explanation of how to build a report on
a universe.)
2. Add an additional report tab by cliking Report on the Insert Menu.
Drag the Country and Revenue objects to the new report tab to create the
revenue by country report.
When you run this report, BusinessObjects retrieves the data once and shares it
between the two reports, rather than retrieving the data twice.
NOTE
You can use the Query Panel to modify a data provider by clicking Edit on the
Data menu. Do this rather than create a new data provider if you wish to add a
new report to a new tab and the new report uses the same or similar data to your
existing report(s).
part
Introduction to Data Analysis
chapter
232 Accessing Data and Data Analysis
Overview
With BusinessObjects, you analyze data by looking at it on different levels of
detail and from different viewpoints. Through your analysis, you gain new
information and thereby answer questions.
You need go no further than the BusinessObjects interface to address all your
multidimensional analysis needs:
BusinessObjects on-report analysis allows you to work directly on your data
in your report using drag and drop and or with simple mouse clicks.
Explorer, an optional component in BusinessObjects, enables you to carry out
multidimensional analysis in Drill mode.
OLAP servers are databases that store summarized data, ready for business
analysis
BusinessObjects Slice and Dice mode allows you to organize data for
analysis in the slice and dice panel.
On-report analysis
This part of the Users Guide describes how BusinessObjects on-report analysis
allows you to analyze your data directly on your report using easy mouse clicks
and drag and drop or with a simple mouse click.
You can drag and drop data on your report to get a different viewpoint for your
analysis. You can add data from the Report Manager to create tables and
sections. You can replace, swap and re-organize data on the report.
BusinessObjects redoes the calculations in your report immediately so that you
can see at once how different combinations of factors affect your performance.
Dynamic on-report grouping allows you to create groups for comparative analysis
and you can quickly insert common business calculations or easily create your
own formulas and variables for analysis.
You can sort, filter and rank your data using a simple mouse click to focus your
analysis on a slice of data.
On-report analysis
234 Accessing Data and Data Analysis
OLAP servers
If you work with an OLAP server, you can view and select the data you want when
creating a report. OLAP servers are databases that store summarized data,
ready for business analysis.
For more information on OLAP servers, refer to the OLAP Access Pack
documentation for the server at your site.
OLAP servers
236 Accessing Data and Data Analysis
chapter
238 Accessing Data and Data Analysis
Overview
This chapter describes how to use BusinessObjects drill mode.
EXAMPLE
Why is revenue better in this resort than in the others?
You see that revenue is much higher in the Hawaiian Club resort than in the
others. To find the reason for this, you need to look at all the factors that affect
revenue.
If you displayed all the factors that could be useful for analysis in a table or chart,
there would be too much data, making the report difficult to read. Drill mode
allows you to include data for analysis behind the scenes of your report and
display the top level data only. If necessary, you can drill down to the more
detailed data to understand the higher-level data. This allows you to see how
different aspects of your business affect your revenue step by step.
This underlying data is set up by the person who creates the report.
Sales Class
Hierarchies
Objects are also organized in this way for drilling. When you analyze data in drill
mode, you use hierarchies. The universe classes are the default hierarchies you
use for drilling but the universe designer can also set up custom hierarchies. You
can also create and edit hierarchies in your reports.
Drill hierarchies contain dimension objects only. In drill mode, you drill down on
dimensions, for example from Year to Quarter to Month. At each level
BusinessObjects recalculates measures such as Revenue or Profit Margin.
240 Accessing Data and Data Analysis
If this happens, click inside the table, chart or crosstab you want to analyze.
When you go into drill mode, by default:
BusinessObjects creates a new report that contains a copy of the selected
table, crosstab or chart. The report tab displays the drill icon to show you are
in drill mode. The original report remains intact.
BusinessObjects adds a sum on measure objects.
If you are working on a master/detail report, BusinessObjects displays the
Drill toolbar.
NOTE
You can change these default behaviors. See Setting options for working in drill
mode on page 270 for more details.
Drilling down
When you drill down, you display the next level of detail in a hierarchy.
To drill down
1. Rest the cursor over the data.
The cursor changes to a magnifying glass with a plus sign in it. The plus sign
You can drill down as long as there are objects in the hierarchy. When you reach
the last level in a hierarchy, the normal cursor is displayed. This indicates you are
at the bottom of a hierarchy. If tooltips are turned on, a tooltip displays the
message Right-click to explore.
BusinessObjects
updates the Revenue
column to show revenue
for French Riviera.
Drilling up
Drilling up is the opposite of drilling down. When you drill up, you go back up
through the hierarchy to display data on less detailed levels.
Drilling across
When you drill down and up you move through the levels of the same hierarchy.
However, if you cannot find the answer to a question by analyzing data in its
current hierarchy, you can move to another hierarchy to analyze other data.
EXAMPLE
Move from analyzing Resort to Sales
Your report displays data for Resort, which belongs to the Resort hierarchy. The
report also contains Year, which belongs to the Sales hierarchy, but the data for
Year is not currently displayed. If you drill across from Resort to Year, you can
then drill down on the next dimension in the Sales hierarchy. You can also drill
across to other hierarchies, or back to the hierarchy you were originally working
in. Drilling across opens up new paths that you can follow when analyzing data.
Before you can drill across, your report must contain dimensions from more than
one hierarchy. If this is not the case, you can:
Retrieve data for dimensions from more than one hierarchy by expanding
your scope of analysis, or
Create new hierarchies inside the report.
Drill By - More
The list in the Drill By sub-menu displays five dimensions only by default. To
display the full list of dimensions:
1. Right-click a value and click Drill By More on the shortcut menu.
The Drill By - All Available Dimensions dialog box appears.
NOTE
You can change the setting in the Drill By menu to display more items. See
Setting options for working in drill mode on page 270 for more information.
Drilling on charts
You can also drill on chart blocks in the same way you drill on tables and
crosstabs.
1. Rest the cursor over a part of the chart.
A tooltip appears to indicate the next dimension down in the hierarchy and the
cursor turns to a magnifying glass.
2. Double-click.
The chart is updated and the value you drilled on is displayed in the Drill
toolbar.
NOTE
You cannot drill on the data series of 2D and 3D Area charts.
Drilling on charts
248 Accessing Data and Data Analysis
To do this:
1. Rest the cursor over the Revenue column. A tooltip shows you can drill down
on both Service Line and Quarter.
2. Double-click on the Revenue column in the cell that displays revenue for
Hawaiian Club in FY1998.
This is the highest value in the column.
BusinessObjects moves Resort and Year to the Drill toolbar. The values in the
Drill toolbar are Hawaiian Club and FY1998. Service Line and Quarter appear
in the table and BusinessObjects updates the Revenue column..
NOTE
If the Insert and Replace commands are not available when you click on data,
this means there is no compatible variable with which to replace the selection.
report.
NOTE
You cannot drag and drop variables onto charts.
The following tables summarize how you can move data around between the
Report Manager, Drill toolbar and tables and crosstabs.
Report Manager to drill toolbar
You can drag a variable from the list in the Report Manager and drop it in the Drill
toolbar.
Insert highlighting
Replace
highlighting
TIP
You can drag the drill toolbar from its docked position under the other toolbars
and place it where it is convenient for you in your workspace.
NOTE
For information on creating measure objects locally, see "Formulas, Local
Variables and Functions" on page 465.
In drill mode, you can expand a measure in order to view its component parts in
the report and analyze numeric data.
Collapsing a measure is the opposite of expanding it. Instead of viewing the
measure's component parts, you display its aggregated values once more.
EXAMPLE
Analyzing profit margin
The data for Customer, Service and Margin are displayed in a report. Margin is a
local variable with the following syntax: Product Price - Product Cost.
When you expand Margin, the data for Product Price and Product Cost appear in
the report. When you collapse the expanded measure, the report shows the data
for Margin only.
To expand a measure
To expand a measure while working in drill mode:
1. Right-click the cell or chart element that displays the measure you want to
expand.
2. Click Expand on the shortcut menu.
The measure's component parts are displayed in the block.
To collapse a measure
To collapse a measure while working in drill mode:
1. Right-click the cell or chart element that displays the measure you want to
collapse.
2. Click Collapse on the shortcut menu.
The data for the measure's component parts disappears.
NOTE
If the Expand and Collapse commands are not available when you click on a
measure, it means the variable was not created locally in the report and therefore
cannot be analyzed.
NOTE
The filters displayed in the Drill toolbar when the snapshot was taken are turned
into global report filters.
Extending analysis
You can bring new data into your report if it does not contain all the data you need
for your analysis. You do this by extending the scope of analysis in the Scope of
Analysis window or editing your query to retrieve more data from the database.
3. Choose the dimensions to include in your scope of analysis and click OK.
The dimensions are now displayed in the list in the Report Manager window.
NOTE
BusinessObjects shows you which values are currently displayed in the Drill
toolbar by placing a filter icon next to them.
Extending analysis
258 Accessing Data and Data Analysis
NOTE
You can choose one dimension only at a time.
EXAMPLE
Focus analysis on high-profile resort using drill filters as query conditions
You are interested in analyzing the excellent revenue results in the US. You have
drilled down on Country and see that the resort Hawaiian Club has generated the
best revenue. You now want to concentrate on this one resort and find out some
information on the country of origin of the customers for that resort, data that is
not currently available in your report.
To do this you first need to turn the drill filters option on:
1. Click Options on the Tools menu.
The Options dialog box appears.
2. Click the Drill tab.
You drilled down on Country and the table displays revenue for US resorts
only.
Extending analysis
260 Accessing Data and Data Analysis
1. Right-click on Hawaiian Club in the Resort column and click Drill Through on
the shortcut menu.
The Drill Through dialog box appears.
The dimensions already available in the report are grayed out. The Country
dimension has a filter to display data only for the US and the Resort dimension a
filter to display data only for Hawaiian Club. These filters will be used as query
conditions and only data concerning the US resort Hawaiian Club will be retrieved
from the database.
2. Choose Country of Origin from the Customer hierarchy and click OK.
BusinessObjects retrieves the data, displays Country of Origin in the table
and moves Resort to the Drill toolbar.
Notice that France is no longer available in the Country list and Hawaiian Club is
the only name in the resort list. The table now displays data for Hawaiian Club
only.
Extending analysis
262 Accessing Data and Data Analysis
Editing hierarchies
The changes you make to a hierarchy that was created by a universe designer
affect your work in drill mode only. For example, if you delete a hierarchy, you can
no longer use it in drill mode. However, the hierarchy remains unchanged in the
universe so you can still use the hierarchy to define scope of analysis when
building a query on the universe. The universe designer is the only person who
can edit or delete hierarchies at the universe level.
2. In the Available Hierarchies box, click the + sign to view the contents of the
hierarchy folder.
3. In the Available Dimensions box, click the + sign to the left of the folder to view
the list of dimensions.
4. Make the required changes and click OK to close the Hierarchy Editor.
To add a dimension to an existing hierarchy
Click the dimension you want to add to the hierarchy, then click Add.
The dimension you clicked appears in the hierarchy's folder in the Available
Hierarchies box.
If the Hierarchy Editor does not list the dimension that you want to add to your
hierarchy, you may have to expand your scope of analysis. See Expanding scope
of analysis on page 257.
NOTE
You cannot combine dimensions from different data providers in a single
hierarchy.
Creating hierarchies
You can create your own custom hierarchies from any dimensions available in
the report. The dimensions you include in a hierarchy can be local variables,
derived variables, or dimensions returned by data providers.
NOTE
You can also use a date-type user object as the basis for a time hierarchy. For
information on user objects see Creating user objects on page 331.
NOTE
You cannot combine dimensions from different data providers in a single
hierarchy.
NOTE
You cannot change the qualification of data returned by a query on a universe.
5. In the Definition tab of the Variable Editor, click an option button to change the
qualification, then click OK.
6. Click Close in the Variables dialog box.
Re-qualifying variables
1. Click View Data on the Data menu.
2. The Data Manager dialog box opens.
3. In the Data Providers box of the Data Manager, click the icon that represents
the column of data whose qualification you want to change.
4. Click the Definition tab.
5. The name, type, qualification and values for the column are displayed.
6. In the Qualification box, click an option button to change the column's
qualification.
7. Click OK.
chapter
272 Accessing Data and Data Analysis
Overview
Slice-and-dice mode enables you to switch the position of data in a report, for
example by moving columns to rows to create a crosstab.
You can also use slice-and-dice mode to:
work with master/detail reports
display and remove data
rename, reset and delete blocks
turn tables and crosstabs into charts, and vice versa
apply, edit and delete breaks, filters, sorts, rankings and calculations
You access slice-and-dice mode through the Slice and Dice Panel, a pop-up
window that provides a graphical representation of the report you are working on.
You carry out slice-and-dice tasks by dragging and dropping icons that represent
your data.
e
b
c
d g
You can rename, transform, reset or delete a block by clicking its tab with the right
mouse button, then clicking a command on the shortcut menu that appears.
A master/detail report and its representation in the Slice and Dice Panel
The Slice and Dice Panel makes it easy to work with master/detail reports. You
can:
build a master/detail report
reorganize a master/detail report by replacing the master or by building a
master/master detail report
undo a master/detail report by removing the master
deactivate sections of master/detail reports
The following sections describe how to perform these tasks.
You can perform this task in drill mode. To do so, switch to drill mode and select
the data you want to use as master. Click your right-mouse button and on the
shortcut menu that appears, click Set as Master.
You want to obtain the number of guests per quarter for all resorts, rather than
the number of guests per resort, as shown in this illustration:
You obtain this result by deactivating the Resort section for the table. The Slice
and Dice Panel enables you to perform this task with mouse clicks. After you
have done so, BusinessObjects dynamically recalculates the number of guests
for all resorts while leaving the data in the chart unchanged.
To deactivate a section of a master/detail report
1. Open a master/detail report, then open the Slice and Dice Panel.
2. Click the tab of the block (table, chart or crosstab) that you want to
recalculate.
3. In the Section box, with your right-mouse button click the master of the section
that you want to deactivate.
4. Click Deactivate this section on the shortcut menu.
5. Click Apply.
The block appears in the section above the section that you deactivated.
NOTE
If you select a master that has masters beneath it, the pop-up menu gives you an
additional option to deactivate the master plus all its child masters. Similarly, if
you select a deactivated master that is not at the top of its master hierarchy, the
menu gives the option to reactivate the master plus all its parent masters. See To
deactivate or activate two or more sections at the same time on page 282.
In the Slice and Dice Panel the Block Structure box shows dimensions and
measures that appear horizontally in a table, crosstab or chart. :
Dimensions and
measures as
represented in the
Slice and Dice
panel.
You can use the Slice and Dice Panel to move variables horizontally, using drag-
and-drop. You can also swap two variables.
The following illustrations show the crosstab and the 3-D matrix chart that
correspond to the representation in the Block Structure box above.
Crosstab
In slice-and-dice mode you can perform the following tasks with crosstabs and 3-
D matrix charts:
build a crosstab or 3-D matrix chart from a table or 2-D chart, respectively
reduce a crosstab or 3-D matrix chart to a table or 2-D chart, respectively
reposition data that appears in rows or on the Z-axis
move data between rows and columns (in crosstabs), and between the Z-axis
to the X-axis (in 3-D matrix charts)
turn crosstabs into 3-D matrix charts and vice versa
The following sections describe how to perform these tasks, with the exception
of turning crosstabs into 3-D matrix charts and vice versa. This task is described
in Transforming blocks in Slice-and-Dice mode on page 289.
To do this... Then...
Use data that is already displayed in take an icon from the Block Structure
the report, or Section boxes.
Use data that is not yet displayed, take an icon from the Available
Variables box.
TIP
You can reset one or more blocks using the procedure described above. To reset
the whole report, click the Reset button on the Slice and Dice Panel toolbar.
Resetting a block or a report removes any formatting you have applied.
transform.
2. Click your right-mouse button, then select a command:
3. Click Apply.
None of the above functionalities is specific to slice and dice mode; however, the
Slice and Dice Panels graphical interface provides a user-friendly way to apply
them. Moreover, it is useful to be able to perform slice and dice operations, then
apply one or more of these features to the report. For example, if you build a
master/detail report that displays revenue by resort, you can quickly calculate the
total revenue per resort.
In the sections that follow, you learn how to use the Slice and Dice Panel to apply
sorts, ranking, calculations, breaks and filters on report data. References to more
information on the features are provided in their respective sections.
part
Filtering and Ranking Data
chapter
298 Accessing Data and Data Analysis
Overview
A BusinessObjects report can contain a great deal of data. This chapter presents
the various ways in which you can organize and present report data to bring
certain key information to the instant attention of your readers.
You can limit the amount of information displayed in a report to focus on a
selection only by using filters.
You can order the information by using ranking or sorting.
You can highlight interesting data with special formatting by using alerters.
EXAMPLE
Filter data to show sales revenue for two regions only
You can filter the data for Region by BusinessObjects now displays the values
selecting two of its values: East Coast and for these objects only.
In this example you want to show the sales revenue results for two regions only.
To do this, you insert a filter on the Region column and choose to display East
Coast and Mid West only.
Notice how the filter also affects calculations. The sum is different in the two
tables.
Inserting a filter
You can insert a filter on data in tables, crosstabs or charts.
To insert a filter
1. Click the row, column or chart element you want to filter.
2. Click the Insert Filter button on the Report toolbar, or click Filter on the Insert
menu.
The Apply a Filter On dialog box appears. It displays the values you can select
Insert Filter
for the filter:
3. Hold down the Ctrl key and click the values you want to include in the report,
then click OK.
The dialog box closes, and the report includes only the values you selected.
The Insert Filter button on the toolbar is dimmed.
To remove the filter, click inside the filtered data, then click Insert Filter.
Managing filters
You can manage filters in the Filters dialog box in the following ways:
Select different values for existing filters.
Add new filters.
Insert filters on variables that are not displayed in the report.
Specify whether a filter be applied on the whole report or on a specific block.
Remove filters.
The following sections describe these tasks.
Filters in the
Global folder affect
the whole report.
Filters in other
folders affect the
table/crosstab/chart
to which the folder
refers.
3. In the Filters On list, click the variable whose filter you want to edit.
In the Values box, the values that are currently displayed in the report are
highlighted (East and Midwest, in the illustration above.)
4. To select different values, you can:
- Click values that are already selected. The highlighting disappears, which
shows that the values will not appear in the report.
- Select previously unselected values. Before you do this, check Show All
Values to display all the values for the variable.
- Click Select All Values. Doing this enables you to keep the filter, yet view all
the data for the selected variable.
5. When you are done, click OK or Apply.
Adding filters
The Filters dialog box enables you to add filters to the report. To add a filter:
1. Click inside the report then click Filters on the Format menu.
The Filters dialog box appears.
2. Double-click a folder in the Filters On box:
- Filters in the Global folder affect the whole report.
- Filters in the BlockName folder are block-specific.
3. Click Add.
The Variable(s) to Filter dialog box appears. It lists all the variables in the
document that are not currently filtered, whether or not they are displayed in
the current report:
TIP
You can drag-and-drop a filter between folders. This enables you to change the
way a filter is applied. For example, if you drag a filter from a Block Name folder
to the Global folder, then click Apply or OK, you apply the filter on the whole report
rather than on one block.
Removing a filter
When you remove a filter, BusinessObjects displays all the data for the variable
on which you applied the filter. For example, if you applied a filter that displays
revenue for the East and Midwest regions only, then you remove that filter,
BusinessObjects displays revenue for all regions.
To remove a filter:
1. Click in the data on which you applied the filter.
Insert Filter 2. Click Insert Filter on the Report toolbar.
NOTE
You can also choose the Filters command from the Format menu, highlight the
filtered variable in the Filters On box, then click Remove.
EXAMPLE
Display only those stores with weekly revenue over $200 000
You publish a weekly report on sales revenue per store but only want to show the
results of your better performing outlets.
To do this, you define a complex filter that displays only those stores whose
revenue is equal to or over $200,000. To do this, you write a formula that states
that revenue must be greater than or equal to $20,000. The syntax is as follows:
=(<Revenue>>=20000)
Each week, when you refresh your report with the new sales data, only those
stores with a revenue over $200,000 will be listed in the table.
NOTE
If there is a syntax error in the formula you enter, BusinessObjects displays an
error message. Click OK to return to the formula. BusinessObjects automatically
selects the incorrect part of the syntax. Correct the error and click OK; you cannot
use the formula if it contains an error.
Ignoring filters
You can force BusinessObjects to ignore any filters you have inserted on a report
so that it calculates on all data, not just the filtered values. To do this, you use the
NoFilter function. The syntax is:
=NoFilter(formula)
The example below shows how this works.
You filter the City column so that the report displays the data for New York and
Washington only.
In the first table, the sum includes New York and Washington revenues only. The
formula to calculate this sum is:
=Sum(<SalesRevenue>)
In the second table, formula for calculating the sum includes the NoFilter function.
As a result, the sum includes revenues for all cities. The formula is as follows:
=NoFilter (Sum(<SalesRevenue>))
Notice the difference in the two sums.
Ordering data
You can change the order in which data appears in rows and columns by
applying a sort on the data. For example, you can sort a column of city names to
have the cities appear in alphabetical order. You can apply a sort on text, dates
or numbers. You apply sorts from the Sorts toolbar.
Sorting data
There are three types of sorts that you can apply to data
NOTE
The default sort order for all types of data is ascending.
You apply sorts from the Sorts toolbar. To access this toolbar, click Sorts on the
Report toolbar
Ascending sort Custom sort
Descending sort
Inverting a sort
1. Click the data you have already sorted
2. Click one of the sort buttons on the toolbar.
For example, if you want to invert an ascending sort, click Descending Sort
button.
Ordering data
308 Accessing Data and Data Analysis
Removing a sort
The Sort buttons work as toggle buttons turning sorts on and off. To remove a
sort:
1. Click the data you have already sorted.
2. Click the button you used to apply the sort.
3. Either
- choose an option from the Sort Option list box:
Option Description
Default Sorts the values in the order they were in when
the Custom Sort dialog box appeared. This
option cancels the order you have specified but
does not close the dialog box.
Ordering data
310 Accessing Data and Data Analysis
Option Description
Alphanumeric Displays values in alphabetical or numerical
order.
Month Displays the months of the year in chronological,
not alphabetical, order. Only applicable for a
variable that returns the months of the year.
Day Displays the days of the week in chronological,
not alphabetical, order. Only applicable for a
variable that returns the days of the week.
or
- drag and drop the values in the list into the desired order
- use the Move Up and Move Down buttons to place the values in the desired
order
4. Click OK to close the Custom Sort dialog box.
NOTE
You cannot use custom sorts and alerters. For example, if you set up an alerter
to highlight months greater than May, BusinessObjects will use the alphabetical
sort order instead of the chronological sort order.
The following example shows a table that has two custom sorts.
EXAMPLE
How can I get months to sort correctly?
In this table the months have been sorted to display in chronological order and
the product lines have been manually sorted.
REMINDER
BusinessObjects sorts months and days according to the Regional Settings
made in the Windows Control Panel. See the BusinessObjects Users Guide:
Report Techniques and Formatting for more information on checking these
settings.
Ordering data
312 Accessing Data and Data Analysis
EXAMPLE
Sort customers by nationality and then by name in alphabetical order
This table sorts data first by applying an ascending sort to the country column and
then by applying a secondary ascending sort to the customer column.
Primary sort -
BusinessObjects sorts the
table by the country first.
Secondary sort -
BusinessObjects sorts the
table by customer name after
sorting by country.
If your report contains a table or a 2-D chart, the dialog box contains one tab
only. If your report contains a crosstab or a matrix chart, the dialog box has
both tabs, Across Edge and Down Edge. The Down Edge tab displays the
sorts applied to columns. The Across Edge tab displays the sorts applied to
rows or on the Z-axis of the chart.
3. Click the tab you want to work in, then click the sort that you want to prioritize.
4. Click Move Up to give the sort higher priority, or Move Down to give it lower
priority.
The sort icon moves up or down one place in the list of sorts.
5. Click OK or Apply.
The sort priority you defined is applied to the report.
Ordering data
314 Accessing Data and Data Analysis
To remove a sort
Click the Sort in the Current sorts list and click Remove.
EXAMPLE
Display the three top-selling product lines only
In the example below, the table shows sales revenue for the product lines in the
efashion retail chain. The table on the left shows revenue for all product lines. In
the table on the right, the product lines column shows only the top three-selling
lines.
data for customers, click the column where this data appears.
2. Click Apply Ranking on the Report toolbar, or click Ranking on the Format
menu.
Apply Ranking
3. The Select Top/Bottom Variable Name dialog box appears. It displays the
options you can select for the ranking:
To... Do this...
Select the largest n values, Click Top and select the value of n.
(BusinessObjects selects 3 by default
when you click Top.)
Select the smallest n values, Click Bottom and select the value of n.
(BusinessObjects selects 3 by default
when you click Bottom.)
Select the top n% of values, Click Top, click In percentage of total
number of values, then select the value
of n.
Select the bottom n% of values, Click Bottom, click In percentage of
total number of values, then select the
value of n.
Display subtotals relating to the values Click Display subtotals.
that appear in the report and the values
that are omitted from the report,
Display percentages relating to the Click Display percentages.
values that appear in the report and the
values that are omitted from the report,
Select the measure on which the Choose the measure in the Based On
ranking is based, combo box.
4. Click the ranking values you want to display in your report, then click OK or
Apply.
The report displays ranked data for the values you selected only. The Apply
Ranking button on the toolbar is dimmed.
Displaying subtotals
When you click Display subtotals BusinessObjects adds the following
calculations to the report:
the sum of all the rows included in the report by the ranking
the sum of all the rows excluded from the report by the ranking
the overall sum of all the rows in these two categories
Displaying percentages
When you click Display Percentages BusinessObjects adds the following
calculations to the report:
each included row expressed as a percentage of all included rows
the total number of included rows expressed as a percentage of all rows
(included and excluded)
the total number of excluded rows expressed as a percentage of all rows
the total number of included and excluded rows expressed as a percentage
(which is always 100%)
b
c
d
NOTE
If you have created a local variable using values from different data providers,
you will not be able to rank data based on this variable. The variable will not be
displayed in the list in the Ranking dialog box.
EXAMPLE
Show sales revenue for top three months, compare with overall revenue
This report displays the top three revenue-making months. It shows the
combined revenue for September, January and March (Sum) and the total
revenue for the other nine months of the year (Sum Other).
TIP
To remove the ranking, click inside the ranked data, then click Apply Ranking.
Removing a ranking
When you remove a ranking, all the data that it excluded re-appears in the report.
For example, if you applied a ranking that displays the top 10 customers by
revenue, then you remove that ranking, the report displats the revenue for all
customers.
To remove a ranking, first click inside the data on which you applied the ranking.
You can then:
Click the dimmed Apply Ranking button on the Report toolbar.
Click Ranking on the Format menu, remove the Top and Bottom check
marks, then click OK or Apply.
Apply Ranking
Managing ranking with filters and sorts
To rank data in a report, you must remove any sorts or filters currently applied to
that data. If any sorts or filters exist when you try to apply a ranking,
BusinessObjects displays the following message:
Hiding Data
In the Used Variables box, click the variable you want to hide, then click Hide.
To hide more than one variable at the same time, hold down the Ctrl key, click
the variables, then click Hide.
Hidden variables are grayed in the Used Variables box.
NOTE
When you hide a dimension, BusinessObjects does not recalculate measures.
Hiding a dimension is not the same as removing it from a report.
Showing data
To display a previously hidden variable, click it in the Used Variables list, then
click Show.
Highlighting data
You can highlight data in a BusinessObjects report using alerters. Alerters use
special formatting to make data that fits certain conditions stand out from the rest
of the data. This helps draw attention to trends and exceptions in report data.
EXAMPLE
Which sales representatives generate revenue over $500 000
You want to identify excellent salespeople who generate revenue over $500 000,
and poor salespeople who generate revenue below $50 000.
You define a condition for your good salespeople: "Revenue >= 500000" and
define a format that will be applied for values that fit this condition: "Good job!" in
green.
You then define a condition for your not-so-good salespeople: "Revenue <=
50000". and define a format that will be applied for values that fit this condition:
"Work harder!" in red.
You insert an extra column after revenue and name it Performance. You then
apply the alerter to the performance column.
NOTE
You cannot use alerters on charts.
Creating an alerter
There are 4 steps involved in creating an alerter:
1. Select the data you want to use.
2. Name and describe the alerter.
3. Define the range of values.
4. Define how the alerter will be displayed in the cell.
Once you have created an alerter you can apply it, hide it or display it.
Highlighting data
324 Accessing Data and Data Analysis
Highlighting data
326 Accessing Data and Data Analysis
Turn an alerter on
1. Click the cell, column or row where you want to display the alerter.
2. Click Alerters on the Format menu.
3. Click the check box next to the alerter that you want to activate.
4. Click Apply or OK.
3. Click the check box next to the alerter that you want to deactivate.
4. Click Apply or OK.
Copy an alerter
1. Click Alerters on the Format menu.
2. Click the alerter you want to copy.
3. Click Copy.
The Edit Alerters dialog box appears.
In the Definition tab, the name of the initial alerter appears in the Name box
followed by no2. If you renamed your first alerter so its name is not the same
as the variable name BusinessObjects gives the new alerter the variable
name.
4. Type a new name and description for the new alerter.
5. In the Conditions tab, define the first range of values for the alerter.
6. Define the way the result appears in the cell.
7. Repeat Step 5 and Step 6 to define a second range of values if you wish, then
click Apply or OK.
Edit an alerter
1. Click Alerters on the Format menu.
2. Click the alerter you want to edit.
3. Click Edit.
4. Change the definition of the alerter.
5. Click Apply or OK.
Highlighting data
328 Accessing Data and Data Analysis
Delete an alerter
1. Click Alerters on the Format menu.
2. Click the alerter you want to delete.
3. Click Remove.
chapter
330 Accessing Data and Data Analysis
Overview
This chapter describes how to benefit from the most powerful query features in
BusinessObjects. You learn how to
create your own objects
apply complex conditions
work with multiple conditions
combine the results of multiple queries into one data set
view, edit and reuse the SQL generated by BusinessObjects queries
use one query as input to another
EXAMPLE
Obtaining total ordered revenue by creating a user object
To obtain the revenue generated by an order, you create the Total user object
with the following formula:
=Quantity Ordered*Product Price
where Quantity Ordered and Product Price are objects in your universe. When
you include the Total user object in a query, BusinessObjects makes the
calculation and places the results in the report.
NOTE
You cannot schedule reports that contain user objects and keep the user objects;
they are removed when the report is refreshed. For more information refer to the
InfoView Users Guide.
The following sections describe how to create, edit and delete user objects using
the Universes command.
4. Type the name of the user object in the Name field in the Definition tab.
5. Select the type of the user object (Character, Number or Date) in the Type list.
6. Type a description of the object in the Type list.
The descriptive text appears when you select the user object in the Query
Panel.
7. Under Qualification, click Dimension, Measure or Detail.
8. Click the Formula tab to write the formula for the user object.
For information on how to write the formula, refer to To write the formula of a
user object on page 334.
9. Click OK.
The user object you have created appears in the User Objects dialog box. The
next time you build or edit a query on the universe, the user object you have
created will appear in the User Objects class.
REMINDER
You can create a user object by clicking User Objects on the Query Panel
toolbar. Using this method you can create user objects only in the universe you
selected for the query you are working on. The workflow is the same as the one
User Object described in this section.
appears.
Type function
arguments here
To illustrate how you can benefit from complex conditions, heres an example.
EXAMPLE
Which customers made reservations for 2001 and 2002?
You want to market new products to customers who made reservations for 2001
and 2002. All you need is that list of names - and you obtain it by applying a
complex condition on Reservation Year, without using Reservation Year as a
result object in the query. Heres how to do it:
1. Insert the Customer object in a query on the Island Resorts Marketing
universe.
2. Drag the Reservation Year object to the Conditions box and click the <select
The following table helps you to select the operator you need:
Wildcards are special characters that can denote any single character, or any
number of characters. BusinessObjects supports the standard wildcard
characters, which are:
Wildcard Description
% Replaces several characters, or in the
response to a prompt. For example, N%
returns all values beginning with an N (New
York, Nevada)
_ Replaces a single character in a constant. For
example, GR_VE returns Grave, Grove,
Greve.
Using In list
The In list operator lets you select multiple values for a document. These multiple
values can be a condition on a query that you want to build or can be the basis
for an interactive document in which BusinessObjects prompts other users to
select values from the list you created to view data limited to their needs.
You type your list of values in the text field of the Enter or Select Values dialog
box or if you click Values in this dialog box you can select them from a list. When
you type values, separate each value with a comma (,).
The maximum number of values allowed in a list is 256.
NOTE
If you use a different operator, you might also have to use a different operand.
If... Then...
you want to obtain a single result row, click Globally, then click Next.
you want to obtain several result rows, click By one or more objects, select
the objects from the list, then click
Next.
or more objects.
8. Select how you want to synchronize your calculation.
If... Then...
you want to make a calculation click Independently of your objects,
independently of your objects, then click Next.
you want to make a calculation for click For each value of one or more
each value of one or more of your objects, select the objects from the list,
objects, which allows you to limit the then click Next.
calculation to particular objects,
The next screen asks you to set the number of values to compare.
9. Select whether you want to compare the object with at least one value or with
all values.
If... Then...
you want to compare the object with at click At least one value, then click
least one value, which allows you to Finish.
limit the values compared with the
object,
you want to compare the object with all click All values, then click Finish.
values,
The Query Panel reappears with the query defined with a condition on a
calculation.
10. Click Run.
EXAMPLE
When did each customer last pay for a product?
You want to find out the date of each customers last invoice so that you can
contact those customers who have not been buying your products. To obtain this
data, you need to apply a complex condition with a calculation. The calculation
compares the invoice dates for each customer, then returns only the last date.
Heres how to do it:
1. Insert the Customer and Invoice Date objects in a query on the Island
NOTE
You can create subqueries explicitly. See Applying a condition with a subquery
on page 352.
This is the object in the outer query whose value is compared against the
result of the inner query. In the example, the object is Invoice Date.
the aggregate function to apply to the object.
In the example you applied the Maximum function because you were
This determines the grouping in the subquery. In the example you chose
Globally because you were interested simply in the customers latest invoice
date, not a latest invoice date by some other criteria.
Synchronization..
This determines the subquery links to the main queryIn the example you chose
the Customer object because you were interested in each customers latest
invoice date.
This determines how many values in the subquery the database compares
against the values in the outer query. In the example you can choose either
option because the subquery returns one row only for each customer.
a. Invoice Date is the object used in the calculation, so the SQL joins the
two queries using the Sales.Invoice_date field.
b.The calculation level is global so the sub-query has no grouping.
c.The queries are synchronized via the Customer object so the SQL
creates a correlated subquery on Customer.last_name.
d.The query compares all the values in the inner query against the outer
query.
example greater than, less than) that you include in the condition determines
whether the data returned by the subquery is, for example, excluded from the
main query result.
The operands that generate a subquery are described here:
NOTE
The subquery's tab always appears to the right of the main query. A number
appears in the tab, (Subquery n.n). BusinessObjects increments the subquery
number to show the relationship between a query and its subquery or subqueries.
EXAMPLE
Which customer made the earliest reservation?
You want to offer a bottle of champagne to the customer who made the earliest
reservation. To obtain the name and address of this customer:
1. Insert the Customer object and the Address object in a query on the Island
Resorts Marketing universe.
2. Drag the Reservation Date object to the Conditions box.
3. Double-click the Less than or equal to operator.
4. Double-click the Create a subquery (ALL) operand.
The Subquery 1.1 tab now appears in the Query Panel.
5. In the Subquery 1.1 tab, insert the Reservation Date object in the Result
Objects box.
The Query Panel now looks like this:
6. Click Run.
The name and address of the customer who made the earliest reservation.
appears in the report:
Deleting a subquery
A subquery is generated by a condition containing the Create a subquery (ALL)
operand or the Create a subquery (ANY) operand. Therefore, you delete a
subquery by deleting the condition in the main query.
To delete the condition:
1. Right click the condition icon in the Conditions box.
2. Click Delete on the shortcut menu.
EXAMPLE
Which customer made the earliest reservation? (using calculation)
To discover this using a complex condition with a calculation:
1. Insert the Customer and Address objects in a query on the Island Resorts
Marketing universe.
2. Drag the Reservation Date object to the Conditions box.
3. Double-click the Equal to operator.
4. Double-click the Calculation operand.
The Complex Condition wizard appears.
5. Select the Reservation Date object then click Begin.
6. Select the Minimum function then click Next.
The Minimum returns the earliest (smallest) reservation date.
7. Select Globally then click Next.
8. Select Independently of your objects then click Next.
Note that you are interested in the earliest overall reservation date so you do
not link the date to an object in the main query.
9. Select All Values then click Finish.
10. Run the query.
The query returns the same result as the query defined using a subquery to
answer the same question. Examine these steps in relation to the description of
complex conditions in the example When did each customer last pay for a
product? on page 345 if you are still unclear why this is so.
EXAMPLE
Return list of resorts/revenues where resort country revenue > $1000000
In this example you have a report containing a data provider that lists all countries
whose revenue is greater than or equal to $1,000,000. You can use this data
provider to build the new data provider that lists all resorts within these countries
and the resort revenues. To do this:
1. Click Table on the Insert menu.
2. With your mouse, draw a rectangle where you want the new block to appear.
3. When you release the mouse button, the New Table wizard appears.
To... Do this...
Change a group's operator from AND Double-click the AND or OR operator.
to OR and vice versa
Indent or outdent conditions within a Click the AND or OR operator with your
group of conditions right mouse button.
Click Shift right or Shift left on the
shortcut menu
Move a condition from one group to Click the condition and hold down your
another mouse button.
Drag the condition to another group of
conditions, then release your mouse
button.
AND and OR
BusinessObjects automatically links multiple conditions using operators in the
Conditions box in the Query Panel:
AND specifies a result that is true for both conditions.
- For example, the following group of predefined conditions on a query
containing the Customer object specifies customers who stayed at Bahamas
Beach in 1999:
OR specifies a result that is true for either the first or the second condition.
- For example, the following group of predefined conditions on a query
containing the Customer object specifies any customers from 1998 and any
customers who stayed at Bahamas Beach:
You can replace AND with OR, and vice versa, by double-clicking it. When you
apply three or more conditions on a query, double-clicking the operator creates
an indentation in the group of conditions.
TIP
Avoid groups of conditions such as Year Equal to 2001 AND Year Equal to 2002.
This example would return no data, because Year cannot be equal to two
different values. To obtain, for example, the list of customers from both 2001 and
2002, you would have to build a combined query using the INTERSECT operator.
For information on combined queries and how to build them, refer to Building
combined queries on page 365.
Order of precedence
When you have a group of conditions, BusinessObjects objects evaluates them
in order. For example, in the following list of conditions, BusinessObjects first
determines whether the sales revenue >= 2000000 or the quantity sold is > 1000.
Only after it has evaluated whether either of these conditions are true does it
compare this evaluation with the condition that checks whether the margin is >=
1000000.
because BusinessObjects now determines which stores have a quantity sold >=
10,000 or margin >= 1,000,000, and then determines which of these has sales
revenue >= 2,000,000.
EXAMPLE
Which customers bought a given product in a given time period?
You need the list of customers who stayed at the Bahamas Beach resort in 2001
or 2002. This requires two conditions: Resort=Bahamas Beach and Year = 2001
or 2002. Heres how to do it:
1. Include the Customer object in a query on the Island Resorts Marketing
universe.
2. Click Predefined Conditions below the Classes and Objects box.
The list of predefined conditions in the universe appears.
Predefined 3. Click the + sign to the left of the Resort class, and double-click Bahamas
Conditions resort.
4. Click the + sign to the left of the Sales class, then double-click Year 2001.
5. Double-click Year 2002.
The conditions are linked by an AND operator.
6. Double-click the AND that links Year 2001 with Year 2002.
BusinessObjects changes AND to OR, and indents the group of conditions.
7. Click Run.
NOTE
Building combined queries allows you to combine or exclude data from the query
result by using operators to combine the results of multiple queries. You can
contrast this with using the In list and Not in list operators when you apply a
complex condition on a query. The In list and Not in list operators include or
exclude data from a query result based on a list of values that you enter.
3. If you want to use a different operator, click the Query 2 tab with your right-
mouse button, then click the operator you want on the shortcut menu:
Use... To...
UNION Combine the data from two objects in a single column in the report.
UNION is especially useful for working with incompatible objects.
For example, you need to find out the dates on which your
customers made reservations or paid their invoices. This query
requires two incompatible objects: Invoice Date and Reservation
Date. If you include these objects in a regular query,
BusinessObjects returns two blocks of data. By building a combined
query with UNION, with Invoice Date in one tab and Reservation
Date in the other, the data appears in one column in the report.
UNION is the default operator.
Here is the symbol for the UNION operator:
INTERSECT Obtain data common to two sets of results, such as customers from
a given region and a given age group.
The example, Which customers bought a given product in a given
time period? on page 363, illustrates the use of INTERSECT.
Here is the symbol for the INTERSECT operator:
MINUS Exclude the results of one query from the main query result. For
example, you can use MINUS to find out which customers bought
product A but not product B. You cannot obtain this data with a
condition such as Product different from B, because the condition
would include customers who bought A and B.
Here is the symbol for the MINUS operator:
NOTE
You can delete one of the queries you have combined by clicking its tab with your
right-mouse button, then by clicking the Delete command on the pop-up menu
that appears.
EXAMPLE
Which customers bought products in both 2001 and 2002?
Finding customers who match two criteria is a common business goal. You
cannot obtain the list of paying customers from two years by
Applying a complex condition with the In list operator; in this case, you would
obtain customers from either 2001 or 2002, or possibly both.
Two conditions linked by AND (Year equal to 2001 and Year equal to 2002)
because this will return no data.
Two conditions linked by OR (Year equal to 2001 or Year equal to 2002)
because this does not guarantee that the customer bought in both years.
You need to build a combined query that returns the intersection of customers
from 2001 and 2002. Heres how to do it:
1. Include the Customer object in a query on the Island Resorts Marketing
universe.
2. Drag the Year object to the Conditions box.
3. Double-click Equal to, then Type a new constant, then type 2001.
4. Press Enter, then click Combine Queries on the Query Panel toolbar.
Combine
- The existing query appears in the Query 1 tab.
Queries
- A second tab, Query 2, also appears and is now active.
- Customer is already a result object in Query 2.
5. In the Query 2 tab, drag the Year object to the Conditions box.
6. Double-click Equal to, then Type a new constant, then type 2002.
7. Press Enter, then click the Query 2 tab with your right-mouse button.
The operators you can use to combine the queries appear on a pop-up menu:
8. Click Intersect.
The INTERSECT symbol appears on the Query 2 tab as shown here:
9. Click Run.
A list of customers who bought products in both years appears in the report.
NOTE
It is possible that BusinessObjects will have created a complex SQL query to
resolve the query, for example if the query contains incompatible objects or
certain types of conditions. Such SQL queries can be split into several SELECT
statements, which BusinessObjects indicates as folders in the left pane of the
SQL Viewer dialog box.
2. To edit the script, click inside it and type the changes you want.
3. Click Regenerate to go back to the SQL of the original query.
Regenerate
4. Check Do Not Generate SQL before running if you want to keep the changes
you have made.
- This option automatically parses the script when you click OK.
- If you do not click this option, any SQL changes you have made will be lost
when you click OK.
Parse 5. Click Parse to check the validity of the script.
NOTE
If the universe designer has set the up the universe with a restrictive connection,
BusinessObjects prompts you to enter your database username and password
before parsing the script. For more information on restrictive connections, see
Restrictive connections on page 40
chapter
372 Accessing Data and Data Analysis
Overview
This chapter describes lists of values (LOVs) and how you can use them to make
your reports more efficient.
EXAMPLE
Showing cities and regions in a list of cities
The Island Resorts Marketing universe has a City object. However, it is possible
for cities in different regions to have the same name. To identify a city precisely,
you want to display the citys region along with the citys name in a list of values.
To do this:
2. Select the Island Resorts Marketing universe and click List of Values.
3. Navigate to the City object beneath the Customer class.
4. Click Edit.
The Query Panel appears showing the query for the City objects list of
values.
5. Add the Region object to the query.
6. Click Run.
Now when you see the City list of values dialog box it shows the cities and their
regions.
If you select Hierarchical View, the List of Values dialog box shows the cities
organized hierarchically within their regions.
9. Click OK.
6. Click Browse and select the Excel sheet containing the values.
7. Select the worksheet containing the values in the Sheet Name dropdown list.
8. Select the range of cells (for example A1:A4) containing the list of values in
the Range Definition box
or
Select the named range containing the list of values in the Named Range
dropdown list.
9. Select First Row Contains Column Names if the range contains the column
name.
10. Click Run.
Button Action
Display BusinessObjects displays the values in the List of
Values of Object Name dialog box.
To view the list in table or hierarchy format, click
Tabular View or Hierarchical View respectively.
These options are useful if the list of values contains
more than one object; that is, it combines two or
more columns of values:
In Tabular View, the columns appear next to
each other.
In Hierarchical View, the values from the first
column appear as a folder. The folder contains
the values of the second column. If there is a
third column, the second column appears as a
folder that contains these, and so on.
Refresh BusinessObjects runs the query for the list of values,
and a refreshed list appears.
Purge BusinessObjects empties the .lov file corresponding
to the list of values.
TIP
You can populate a purged list of values by clicking Refresh.
chapter
388 Accessing Data and Data Analysis
Overview
This chapter explains how to create and display simple calculations in tables and
crosstabs. The final section of this chapter describes all you need to know about
converting currencies to and from euros in BusinessObjects
The following chapters give further information on using calculations in
BusinessObjects:
Formulas, Local Variables and Functions on page 465 explains how you can
use the power of the BusinessObjects formula editor to write your own
calculations.
Calculation Contexts and Extended Syntax on page 407 explains the more
sophisticated aspects of writing formulas and gives some background about
how the BusinessObjects calculation engine works.
Calculation Troubleshooting on page 437 explains the error messages and
other problems you may encounter when inserting formulas and calculations
in your reports and explains how to fix these problems.
For information on using calculations in charts, see the BusinessObjects
Users Guide: Report Techniques and Formatting.
Creating Calculations
Accessing Data and Data Analysis 389
Calculations
BusinessObjects has standard calculation functions that enable you to make
quick calculations on the data in reports. These calculations are available directly
from a menu. The most commonly used calculations are also available on the
Report toolbar. This section describes how to make calculations using the menu
and toolbar functions.
You can also add calculations to your reports by writing your own formulas. This
is described in Formulas, Local Variables and Functions on page 465.
To... Choose...
Calculate the sum of the selected data, Sum
Count all rows for a Measure object. Count
Count distinct values for a Dimension or Detail
object.
Count the number of rows in the body including all Count All
duplicate and empty rows,
Calculate the average of the selected data. Average
Display the maximum value of the selected data, Maximim
Display the minimum value of the selected data, Minimum
Calculations
390 Accessing Data and Data Analysis
To... Choose...
Display the selected data as a percentage, Percentage
Calculate the difference between two selected Variance
values,
Calculate the difference between two selected Variance
values and display it as a percentage, percentage
The result of the calculation is inserted in a new cell in the table or crosstab.
NOTE
Variance syntax containing the Where operator will work in all cases except when
you have two cascading Wheres (a variance using a Where operator that
contains a formula that also uses a Where operator) or in certain contexts, for
example the variance of the variable "<Revenue>" in Report.
Creating Calculations
Accessing Data and Data Analysis 391
If you look at the Revenue column, Count and Count All return 12. For a measure
object, the Count function counts all rows.
a. Sum
b. Percentage
c. Count
a b c d e
d. Variance
e. Variance percentage
NOTE
The calculation commands available on the menu and toolbar depend on the
data you have selected in the table or crosstab.
Detail objects
Calculations
392 Accessing Data and Data Analysis
Calculation examples
The following section contains several examples of making calculations using the
Calculations menu.
EXAMPLE
Displaying total revenue and subtotals
You want to calculate and display the total revenue in a table. To do this:
1. Click in the Revenue column.
2. Click Sum on the Calculations toolbar.
Sum
- BusinessObjects displays the total revenue in the footer at the end of the
table.
- The sum button on the Calculations toolbar is dimmed.
Sum button
dimmed
You now decide you want to insert a break on this table to display subtotals for
each resort.
Insert break
3. Click inside the Resort column and click Insert Break.
The data is broken up and an empty row is inserted at the end of each resort
section.
4. Click in the Revenue column.
5. Click Sum once to remove the existing calculation.
6. Click Sum again to insert the subtotals.
BusinessObjects displays a subtotal for each resort and a total at the end of
Creating Calculations
Accessing Data and Data Analysis 393
the table:
BusinessObjects inserts a
subtotal for each resort,
Calculations
394 Accessing Data and Data Analysis
EXAMPLE
Displaying average, maximum and minimum revenue
The following table has four different calculations for revenue. Notice that the
Average revenue, the Maximum and Minimum revenues and the Sum are all
displayed in separate rows in the order they were applied. Each figure is
identified by the name of the calculation. When you add a Percentage calculation,
BusinessObjects adds an extra column that shows each row as a percentage of
the total.
EXAMPLE
Calculating the difference in revenue between two quarters
In this example you have a crosstab that displays revenue per resort per quarter
and total revenue per quarter. You want to show in the table the difference in
revenue between two quarters. To do this:
1. Select Q2 with the mouse, then, holding down the Ctrl key, select Q1.
2. Click Variance Percentage on the Calculations toolbar.
BusinessObjects displays the difference in revenue between Q1 and Q2 for
Variance each resort as a percentage in a new cell called Q2-Q1.
Percentage
3. Select Q4 with the mouse.
4. Hold down the Control key and select Q3.
BusinessObjects displays the difference in revenue between Q1 and Q2 for
Creating Calculations
Accessing Data and Data Analysis 395
NOTE
You can also use the Shift key to select columns and rows. If you use the Shift
key, BusinessObjects does not take into account the order in which you selected
the columns and rows and always selects cells from top to bottom and from left
to right. If you carry out the calculation above using the Shift key,
BusinessObjects will calculate Q1-Q2.
NOTE
When you move a cell containing a calculation to a different part of the report, the
calculation result depends on where exactly the cell is positioned as this can
change the context in which the calculation is made. For more information on this
point see Calculation Contexts and Extended Syntax on page 407.
EXAMPLE
Displaying total revenue as a table title
You have a report showing overall total and maximum revenues, and total and
maximum revenue by resort and service line. You want the total revenue to
appear at the top of the report. To do this:
Calculations
396 Accessing Data and Data Analysis
1. Select the Sum cell at the bottom of the report and drag it to the top of the
report.
2. Click Cell on the Insert menu and type Total Revenue in the inserted cell,
then align it next to the cell you placed at the top of the report.
Creating Calculations
Accessing Data and Data Analysis 397
3. Select the block at the bottom of the report that contains the overall sum and
maximum calculations and press the Delete key to delete it.
Calculations
398 Accessing Data and Data Analysis
Euro currency If your operating system cannot display the euro symbol, you can use the official
symbol ISO three-letter code, EUR, instead.
EXAMPLE
Converting to euros: six- digit conversion rates
The conversion rate for Dutch guilders (NLG) is 2.20371, with 1 digit before the
decimal and five after.
The conversion rate for Belgian francs (BEF) is 40.3399, with 2 digits before the
decimal point and four after.
To convert to euros from an EMU-compliant currency, you divide the local
currency amount using the six-digit conversion rate for that currency and then
round the result to display the appropriate number of decimal digits.
To convert from euros to an EMU-compliant currency, you multiply the amount in
euros by the six-digit conversion rate for the target currency and then round the
result to display the appropriate number of decimal digits.
Creating Calculations
Accessing Data and Data Analysis 399
Conversion errors
When you convert an EMU-compliant currency to or from euros, you use the fixed
six-digit conversion rate and then round the result to the appropriate number of
decimal digits. Rounded numbers are less accurate than the original numbers
and the round error on a given amount may be fairly negligible or quite
substantial. BusinessObjects allows you to display round errors after you have
converted amounts to and from euros to assess the importance of the difference.
Converting to euros
You can convert an amount from one of the eleven EMU currencies into euros
using one easy mouse click.
To do this:
1. Select the column, row or cell that contains the data you want to convert.
2. Click Euro, then click Convert To Euro on the Data menu.
- If BusinessObjects recognizes the currency, it carries out the conversion
and displays the result.
- If BusinessObjects does not recognize the currency, it displays the Select
Currency dialog box.
3. Choose the currency from the list box and click OK.
The data is converted. If the source data was formatted as currency, the
converted data is formatted with the euro currency formatting defined in the
Conversion Rates table.
3. Choose the currency you want to convert the euros to and click OK.
The data is converted. If the data in euros was formatted as currency, the
converted data is formatted with the currency formatting defined in the
Conversion Rates table.
Creating Calculations
Accessing Data and Data Analysis 401
NOTE
The Display Rounding Errors command is only available if the selected cell
contains a number that has been converted to or from euros.
Conversion rates
BusinessObjects stores the conversion rates and other information for the EMU
currencies and uses this information to carry out conversions to and from euros.
You can edit this information and add other currencies to this list.
This dialog box shows the following information about each currency:
This dialog box displays the information that BusinessObjects currently uses
for the selected currency.
5. Make any necessary changes by typing in the new information over the old
information in the text boxes.
6. Click OK when you have finished.
The Edit Conversion Rate dialog box closes.
The new information concerning the selected currency is now displayed in the
list in the Conversion Rates dialog box.
7. Click OK to close the Conversion Rates dialog box.
Creating Calculations
Accessing Data and Data Analysis 403
EXAMPLE
Adding US dollars to the currency list
You want to add US dollars to the list of currencies since you regularly use dollar
to euro conversion in your business. You have today's dollar/euro exchange rate.
Since the price of the dollar against the euro fluctuates daily, you will have to
update dollar currency information regularly.
Triangulation
If you want to convert from one EMU-compliant currency to another EMU-
compliant currency, you cannot simply use cross rates. You have to use a
procedure called triangulation. To triangulate, you convert the first currency into
euros using a six-digit conversion rate and then convert the euros into the second
currency using another six-digit conversion rate.
EXAMPLE
Triangulation: converting between EMU-compliant currencies
In the following example, you want to convert an amount in German marks into
Belgian francs. To do this, you first have to convert the German marks into euros
using the six-digit conversion rate for German marks. You then round the euros
to no less than three decimal digits. Finally you convert the euros into Belgian
francs using the six-digit conversion rate for Belgian francs. You can carry out this
conversion by writing a BusinessObjects formula.
The following BusinessObjects formula converts 100 DEM to 2063 BEF.
Creating Calculations
Accessing Data and Data Analysis 405
Creating Calculations
Calculation Contexts and
Extended Syntax
chapter
408 Accessing Data and Data Analysis
Overview
This chapter is designed to help you use the powerful calculation capabilities
delivered with BusinessObjects.
Semantically-dynamic calculations
In BusinessObjects, you create a report by building a query that retrieves data
from a database. Typically, your query contains:
Dimensions, which retrieve character-type data (customer names, product
names), or dates (years, quarters, reservation dates).
Measures, which retrieve numeric data that is the result of calculations. For
example, in the BusinessObjects demo universe, Revenueis the calculation
of number of items sold multiplied by item price.
When you run the query, BusinessObjects retrieves the data corresponding to
the dimensions and measures you selected. BusinessObjects calculates
measures dynamically, based on the dimensions with which they appear. Heres
an example.
EXAMPLE
Revenue per region per year, and revenue per region
The report illustrated below contains two tables: revenue per region per year, and
revenue per region.
BusinessObjects dynamically calculates the Revenue measure according to the
dimensions in the table. If you remove the Year column, BusinessObjects returns
revenue per region:
This section explains how BusinessObjects defines input and output contexts in
different parts of a report. This information is important if you
want to understand the different results BusinessObjects returns from the
same formula in different parts of a report
cannot obtain the results you need from the default calculation behavior
need to fix errors such as #COMPUTATION
EXAMPLE
Calculate revenue in various default contexts
The following report displays revenue per city per quarter in 2000. The user has
placed calculations in different parts of the report:
Total revenue at the top of the report
Revenue in the Year section
Revenue in the table, and
Average revenue in the break footer.
The table below the illustration explains the default input and output contexts
BusinessObjects uses to obtain the result of each calculation.
a. Total revenue
for the report.
b. Total revenue
by year.
c. Total revenue
by year and
quarter.
d. Average
revenue by
year, quarter
EXAMPLE
The extended syntax of an aggregate formula
The report shown here calculates running total resort revenue per country:
You obtain the running totals by applying the RunningSum function on the
Revenue column. The basic formula for the calculation is
=RunningSum(<Revenue>)
The extended syntax of the formula, in which the explicit input and output
contexts are shown, is
=RunningSum(<Revenue> In Body) In <Country>
where Body is the input context, and Country, the output context.
You can use your knowledge of extended syntax to:
understand the results BusinessObjects returns by default (see below), and
change the default input and output contexts of a formula to get the results
you need. For information on how to do this, refer to Using extended syntax
for advanced calculations on page 416.
EXAMPLE
Calculating the number of cities per region
In a table containing the dimensions City and Region, if you insert a count,
BusinessObjects counts the cities one by one, using the following formula:
=Count(<City>)
By default, BusinessObjects makes the calculation based on the dimensions in
the table (Region, City). Theres only one city per city, so BusinessObjects
returns 1 every time.
Extended syntax enables you to specify that you want BusinessObjects to count
the cities per region. To obtain this result, you must extend the formula:
=Count(<City>) In <Region>
Thus, in the example on page 416 (number of cities per region), we defined an
output context, Region. Heres an example of a calculation with an input context
defined by the user.
EXAMPLE
Calculating the minimum revenue per city for each region
You display Region, City and Revenue in a table. When you remove City from the
table, BusinessObjects automatically calculates revenue per region, because
Region is now the only dimension in the body.
The only way to display minimum revenue per city for each region is to define an
input context, because the local context does not contain the City dimension.
BusinessObjects allows you to do this, because even though you have removed
City from the report display, it is still available in the document.
EXAMPLE
A formula containing input and output contexts
The following formula returns the minimum revenue per city per region:
=Min(<Revenue> In (<Region>,<City>)) In <Region>
The input context consists of Region and City, while the output context is Region.
TIP
You can also use the Formula Editor to add contexts to a formula. The advantage
is that you can double-click variables to add them to the formula, instead of
having to type them.
Formula Editor
To display the Formula Editor, click Formula Editor on the left of the Formula
Bar.
Reset contexts
You use a reset context in a cumulative aggregation, such as running total
revenue per quarter. The reset context consists of one or more dimensions which
reset the value of the calculation to zero each time a dimension value changes.
This is best explained with an example.
EXAMPLE
Calculating running total revenue per country
You want to calculate running total revenue per country per year, and naturally
you want the calculation to be reset for each country. When the value of Country
changes, you want the calculation to begin at 0.
To obtain this result, you display Country, Year and Revenue in a table, and apply
a break on Country. You then add the cumulative aggregation
=RunningSum(<Revenue>;<Country>)
in which you specify Country as the reset context. Heres what you get:
Now, to calculate running total revenue, you insert a break on Year, then change
Revenue to
=RunningSum(<Revenue>)
Heres the result:
Notice that BusinessObjects calculates the running totals for both Year and
Region. In other words, the figures are added from left to right, and from top to
bottom.
To reset the running sum for either Year or Region, you add a reset context to the
formula. The formula to reset the running sum to 0 for each year is
=RunningSum(<Revenue>;<Year>)
and the result is as shown:
NOTE
Users of previous versions of BusinessObjects may have used the keywords Col
and Row to define reset contexts in crosstabs. These keywords are no longer
necessary. You can use them, but they have no added value. For example
=RunningSum(<Revenue>; Col <Year>)
and
=RunningSum(<Revenue>; <Year>)
return the same result.
In is the default operator for defining a context. However, you can modify the
context youre defining by replacing In by ForEach or ForAll. The following table
provides a definition of ForEach and ForAll:
Operator Definition
ForEach Adds dimensions to the input or output context.
ForAll Removes dimensions from the input or output context.
EXAMPLE
Using ForEach and ForAll
A table containing Region, City and Revenue returns the revenue per city per
region.
The Year dimension is also available in the document. You want to display
maximum revenue per city per year, but you dont want to add Year to the table.
Instead, you add Year to the local context by using ForEach:
=Max(<Revenue> ForEach <Year>)
Finally, you want to display maximum revenue per region, but want City to remain
in the table. In other words, you have to remove City from the local context
without physically removing the City column. You achieve this by using ForAll.
Heres the formula and the result:
But what if you put a break or a section on country? The result is that the quarters
are ranked for each country separately, as shown in the table to the right..
The problem is that the rank is the same for all quarters in all resorts.
What you want to do is rank the quarters for each resort in the crosstab. To do
this, you have to specify that you want to calculate rank for each resort in the
output context. The syntax is:
=Rank(<Quarter> ,<Revenue>) ForEach <Resort>
And the result is:
EXAMPLE
Calculating a grand total by using the Report keyword
You want to display the grand total revenue across all dimensions in a report.
This calculation does not require extended syntax if the formula is placed in a cell
at the very top of the report, because in this case the default output context
contains all the dimensions in the report. But you want to display the information
elsewhere, for example inside a table footer.
To obtain this result, you could define an output context by listing all the
dimensions in the report. A much simpler solution is to use the Report keyword
in the following formula:
=Sum(<Revenue>) In Report
Wherever you display this formula in the report, you obtain the grand total.
NOTE
A formula in which the Report keyword is used to define the output context
always returns a single value.
EXAMPLE
The formula BusinessObjects writes for a simple calculation
You create a master/detail report that shows revenue per resort per year. You
insert a sum on Revenue. This is a simple calculation requiring no extended
syntax.
BusinessObjects, however, writes a full formula in which it specifies input and
output contexts. The formula is
=Sum(<Revenue> In Body) In (<Year>)
where Body corresponds to Resort (the dimension in the table containing the
calculation, the local context), and Year is the output context.
You can view the full formula by clicking the cell containing the sum, then resting
the mouse pointer over the Formula Bar. The formula appears in a tooltip.
You can also view the full formula by clicking Define As Variable on the Data
menu.
Benefits
In simple aggregations such as the one in the example above, you rarely need to
understand the extended syntax BusinessObjects uses. But what if you dont
understand the numbers BusinessObjects displays in a report? What if youre
having a hard time fixing an error such as #COMPUTATION?
In these cases, you can use the extended syntax BusinessObjects provides to
Understand the computation behind the report display, then
Edit your formula to get the result you want. The formula displayed in the
tooltip is a base for you to work from.
Quick reference
This section provides a quick reference to the terms and concepts discussed in
this chapter.
The information below is organized by category:
Basic terms such as document, microcube, aggregation, etc.
Calculation contexts (local, body, input, output and reset)
Context operators (In, ForEach, ForAll)
Keywords (Report, Block, Body, CurrentPage).
Term Definition
Aggregation A calculation that returns totals, percentages, etc. in which any
of the following functions are used:
Average, Count, Max, Min, StdDev, StdDevP, Sum, Var, VarP.
Cumulative A calculation that returns running totals, percentages, etc. in
aggregation which any of the following functions are used:
RunningAverage, RunningCount, RunningMax, RunningMin,
RunningSum.
Dimension Qualification of an object, variable or formula that returns text
(names, IDs, etc.) or dates.
In a report, dimensions make up calculation contexts.
Document A BusinessObjects file (extension .rep).
Extended The syntax of a formula for an aggregation, in which the input
syntax and output contexts for the aggregation are displayed.
You can use extended syntax to define your own input and
output contexts
You have to use extended syntax to define reset contexts.
Formula The definition of the content of a cell. Can contain functions,
operators, variables and text.
Quick reference
434 Accessing Data and Data Analysis
Term Definition
Measure Qualification of an object, variable or formula that returns
numeric data, such as revenue.
The result of a measure is by default determined by the
dimensions in the context in which the measure is placed in a
report.
Microcube Set of data returned by a query.
Because documents can contain data from different sources in
BusinessObjects, any given document can contain multiple
microcubes.
Report Pages in a document where data is displayed. A document can
contain many reports; each report has a tab at the bottom of the
application window.
A report can display only a subset of data from the document.
You can use any dimension - displayed or not - as input or
output for a calculation.
Variable A named formula.
BusinessObjects always stores query results as variables.
Calculation contexts
A calculation context consists of one or more dimensions that determine the input
and output of aggregate calculations.Important: In BusinessObjects 5.1.x, the
Context Definition
Local Dimension or dimensions that govern the part of the report
where the calculation is inserted (e.g., a master variable in
a section).
Body Dimension or dimensions that are present in the part of the
report (e.g., a block) where the calculation is inserted.
Context Definition
Input One or more dimensions that go into an aggregate
calculation. By default, the input context for a calculation is
the defined by the dimension(s) in the body.
You can define your own input context using extended
syntax.
Output One or more dimensions that determine the result of an
aggregate calculation. By default, the output context is
defined by the dimension(s) in the local context.
You can define your own output context using extended
syntax.
Reset One or more dimensions that reset a cumulative
aggregation such as running total to 0 when the value of the
dimension(s) changes.
You specify reset contexts using extended syntax.
NOTE
In BusinessObjects 5.1.x and later, the SQL for contexts is generated differently
from previous versions. Therefore, if you run a query that was built in a previous
version to 5.0.x, you receive #SYNTAX, #COMPUTATION and #ERROR
messages in the upgrading report.
Context operators
In the formula for an aggregation using extended syntax, an operator introduces
the input and/or output context.
Operator Definition
In The default operator. Includes the specified dimension(s) in
the context.
ForEach Modifies a context by including the specified dimension(s).
ForAll Modifies a context by excluding the specified dimension(s).
Quick reference
436 Accessing Data and Data Analysis
Keywords
In extended syntax, a keyword stands for the dimension(s) in a specific part of a
report. The keyword enables you to define contexts in aggregate formulas by
using one word rather than listing the dimensions in the context.
Keyword Definition
Block Corresponds to the dimensions in the current section.
Can only be used in a formula placed inside a block.
Body When the formula is Corresponds to...
placed...
Outside a block The dimensions in the
current section.
Inside a block The dimensions in the block.
Report Anywhere in the report All the dimensions in the
document.
CurrentPage Inside the current page The dimensions in the
current page.
chapter
438 Accessing Data and Data Analysis
Overview
This chapter describes solutions for computation errors that might occur in
BusinessObjects. A computation error always starts with # and appears the cells
where the data should be.
The bulk of the information in this chapter focuses on the most common errors,
#COMPUTATION and #MULTIVALUE. For the full list of errors covered here,
please refer to the table of contents or the index.
If you need help with #COMPUTATION and #MULTIVALUE errors in your
reports, you are strongly advised to first read Calculation Contexts and Extended
Syntax on page 407, because these errors often result from the use of extended
syntax.
Calculation Troubleshooting
Accessing Data and Data Analysis 439
#COMPUTATION
This section provides descriptions, examples and solutions for the following
errors in BusinessObjects:
#COMPUTATION in cumulative aggregations such as running average
revenue per city
#COMPUTATION in non-aggregate formulas, for example using IF THEN
ELSE statements.
NOTE
The information presented here requires that you understand BusinessObjects
extended syntax, which is described in Using extended syntax for advanced
calculations on page 416.
EXAMPLE
#COMPUTATION resulting from a running sum with a reset context
Youve displayed running totals per country per year, and reset the calculation
per country. The formula is as follows:
=RunningSum(<Revenue>;<Country>)
#COMPUTATION
440 Accessing Data and Data Analysis
You now set a break on Year, because you want to display the running total for
each year. You copy the formula from the running total column and paste it in the
break footer. #COMPUTATION appears:
Why? Because the reset context in the formula you pasted is Country, but you
placed the formula in the footer of the break on Year. Thus, the reset context
(Country) is not in the output context (Year).
To fix this error, you need to display the Formula Bar and change the reset
context from Country to Year. The correct formula is:
=RunningSum(<Revenue>;<Year>)
Alternatively, you could set the break on Country, but you would obtain a different
result.
REMINDER
If you do not define an output context in the formula, BusinessObjects makes the
calculation using the local context. For further information, refer to Understanding
input and output contexts on page 410.
Calculation Troubleshooting
Accessing Data and Data Analysis 441
EXAMPLE
#COMPUTATION caused by a conditional formula in a break footer
You can use an IF THEN formula to set a condition for displaying data in a report.
The following formula
= If (<Year>="FY1998") Then <Revenue>
displays the Revenue measure only when the year is 1998.
#COMPUTATION
442 Accessing Data and Data Analysis
In the report illustrated here, the formula is inserted in a break footer, and this
causes #COMPUTATION:
Why? The input context required to display revenue for 1998 is Year, whereas
the output context of the break footer is Resort. To fix this error, you add Year to
the output context using the ForEach operator:
=(If (<Year>="FY1998") Then <Revenue>) ForEach <Year>
Finally, you add Max (or Min) to return the single value you need:
=Max((If (<Year>="FY95") Then <Revenue>) ForEach <Year>)
BusinessObjects now displays Revenue for 1998 in the break footer.
Calculation Troubleshooting
Accessing Data and Data Analysis 443
#MULTIVALUE
This section provides descriptions, examples and solutions for #MULTIVALUE in
BusinessObjects:
#MULTIVALUE in aggregations such as maximum revenue per year
#MULTIVALUE in break headers and footers
#MULTIVALUE in aggregations
The expression aggregations refers to any calculation containing an aggregate
function such as Sum, Count, Min, Max etc. In reports, aggregations let you
answer questions such as What is the minimum revenue per city for each
region?.
This section provides a description of why #MULTIVALUE occurs in
aggregations, with an example, and offers a solution.
NOTE
The information presented here requires that you understand BusinessObjects
extended syntax, which is described in Using extended syntax for advanced
calculations on page 416.
EXAMPLE
#MULTIVALUE in an aggregation
Look at the following table:
The desired result in the right-hand column is revenue for a dimension that is not
present in the table, for example, Year. The formula
#MULTIVALUE
444 Accessing Data and Data Analysis
=<Revenue> In <Year>
returns #MULTIVALUE because Year is specified as the output context but it is
not present in the local context (the table).
NOTE
The formula in this example does not begin with an aggregate function (Min, Max,
etc.). If you omit the function in this way, BusinessObjects calculates a sum by
default. However, if you had specify Sum or another aggregate function in the
formula above, for example
=Sum(<Revenue>) In <Year>
BusinessObjects returns #COMPUTATION.
If the Year dimension is available in the document, you can, using extended
syntax, calculate revenue per year without displaying Year in the table. To do
this, you must define a formula with an input and an output context, like this:
=Sum(<Revenue> In (<Region>,<City>,<Year>) In <Year>)
Calculation Troubleshooting
Accessing Data and Data Analysis 445
Heres an example.
EXAMPLE
#MULTIVALUE in a break footer
The table below shows the running total revenue for two customers. When you
insert Age in the break footer, BusinessObjects returns #MULTIVALUE:
This error occurs because variables with a 1:1 relationship, (Customer and Age),
are inserted at the same break level. By default, a break is based on one variable
only.
#MULTIVALUE
446 Accessing Data and Data Analysis
Calculation Troubleshooting
Accessing Data and Data Analysis 447
Description
A report section displays data in a master cell and in a block or blocks. If you use
two variables at the section level, #MULTIVALUE can occur. Heres an example.
EXAMPLE
#MULTIVALUE in a section containing name and address
You want to display customer names and addresses in a section, and the
customers revenue details in a table. You build a table containing Customer,
Address, Invoice Date and Revenue, then drag Customer out of the block to
create a section.
The next step is to drag Address out of the block, and drop it next to Customer.
Heres what you get:
Why? Because by default, there is only one master variable per section.
#MULTIVALUE
448 Accessing Data and Data Analysis
3. In the dialog box, click the variable that returns the error.
Calculation Troubleshooting
Accessing Data and Data Analysis 449
4. The next step depends on the type of variable you just clicked:
#MULTIVALUE
450 Accessing Data and Data Analysis
#######
Description
The cell is not wide enough to display the data it contains in full.
Solution
Double-click the cells right border. BusinessObjects widens the cell to autofit the
data.
Calculation Troubleshooting
Accessing Data and Data Analysis 451
#ALERTER
Description
This error occurs when an alerter contains a missing variable. For example, if the
definition of the alerter contains the Revenue variable, #ALERTER appears if
Revenue does not exist in the report.
The definition of the alerter itself may also be the cause of this error. For example,
if you try to compare a measure with a dimension (Revenue greater than
Country), #ALERTER is returned.
Solution
You can:
Obtain the missing data by adding the corresponding object to the query (Edit
Data Provider command, Data menu)
Edit the alerter so that its definition contains only available data (Alerters
command, Format menu)
Deactivate the alerter (Alerters command, Format menu, then uncheck the
alerter in the dialog box).
Check that the definition of the alerter does not contain a comparison such as that
of a measure with a dimension.
TIP
To use the Alerters command on the Format menu, first click any cell containing
data.
#ALERTER
452 Accessing Data and Data Analysis
#DICT.ERROR
Description
In BusinessObjects, you can format a report by applying a template. You do this
by choosing Report, then clicking Apply Template on the Format menu. The
Apply Template dialog box appears.
A template contains a set of variables, also referred to as the variable dictionary.
The report you wish to format also contains a variable dictionary. When you apply
a template, unless you click Options button in the Apply Template dialog box in
order to specify the correspondence between the two variable dictionaries,
BusinessObjects automatically replaces the variables in the template with the
variables in the report. In some cases, BusinessObjects cannot match the
variable dictionaries and returns #DICT.ERROR.
Solution
To fix this problem:
1. Click the cell containing #DICT.ERROR, then click Variables on the Data
menu.
The Variables dialog box appears.
2. Click the variable or formula that you want to display in the selected cell.
3. Click Replace.
The Variables dialog box closes, and the variable or formula appears in the
report.
Calculation Troubleshooting
Accessing Data and Data Analysis 453
#DICT.ERROR
454 Accessing Data and Data Analysis
#DIV/0
Description
Occurs when a formula performs a division by 0. For example, the formula
=<Revenue>/<Quantity Sold>
returns 20 if Revenue is 100 and Quantity Sold is 5. But if Quantity Sold is 0, then
the result is #DIV/0.
Solution
Using an IF THEN ELSE statement, you can set up a value or text, for example.,
No Sale, which will appear when a division by zero occurs. To do this:
1. Click Formula Bar on the View menu.
2. Click inside the cell where #DIV/0 appears.
3. Write the following formula in the Formula Bar:
=If IsError (<VariableName>) Then No Sale Else
(<VariableName>)
4. Press the Enter key.
TIP
You can use an IF THEN ELSE statement such as the one in the above
procedure to return default values for errors other than #DIV/0.
Calculation Troubleshooting
Accessing Data and Data Analysis 455
#ERROR
Description
This error occurs when the definition of a formula or a variable within a formula is
incorrect. For example, the formula that returns percentages based on a
measure, such as
=<Nb Customers>/Sum(<Nb Customers>)
returns #ERROR if the measure, in this case Nb Customers, itself contains an
error.
Solution
You need to break down the formula into its component parts in order to find
which part contains the error. Heres how:
1. Insert a new cell in the report by clicking Cell on the Insert menu.
2. Select the cell containing the error, then click Copy on the Edit menu.
3. Select the new cell, then click Paste on the Edit menu.
4. The formula containing the error appears in the new cell.
5. Click the new cell, then in the Formula Bar, select one part of the formula.
6. Copy and paste the selection into the cell where the error first occurred, then
press Enter.
7. Repeat this step until you find the part of the formula that contains the error.
8. Fix the error, then paste the whole corrected formula back into the cell where
the error first occurred.
#ERROR
456 Accessing Data and Data Analysis
#IERR
Occurs in complex formulas within formulas. The three common causes are:
Formulas combining measures and dimensions, where a dimension is
missing from the calculation context
Aggregations containing multiple formulas
Formulas with complex WHERE clauses.
TIP
When you make calculations by combining formulas, #IERR might occur
because the formulas within the formulas contain errors. If none of the solutions
in this section remove #IERR, try breaking down the formula into its component
parts, and test each one. This procedure is described under #ERROR on page
455.
TIP
For information on calculation contexts, refer to "Calculation Contexts and
Extended Syntax" on page 407.
Solution
You add the missing dimension to the context using the ForEach operator, and
apply the Sum function. So, if
=If(<Customer>=Prince) Then <Revenue>
returns #IERR, the formula you need is as follows:
Calculation Troubleshooting
Accessing Data and Data Analysis 457
Solution
Turn the formula within the formula into a variable, then rewrite the whole formula
using the new variable.
A variable is a formula with a name. Once you have made your variable, to
include it in your formula, all you have to do is write its name, rather than a
complex formula within a formula. Heres an example.
EXAMPLE
Solving #IERR by turning part of a formula into a variable
You want to know the week your top ten customers placed their first order. In a
table containing the list of customers, you add a column and insert the following
formula:
=Min(Week(<Order Date>))
If #IERR occurs, the first thing to do, using the Variables command on the Data
menu, is to create a variable called WeekOrderDate from the formula
=Week(<Order Date>)
Then, rewrite the original formula using the new variable, as follows:
=Min(<WeekOrderDate>)
Note that the original formula might work. The purpose of this example is to show
how to fix #IERR should it occur in similar formulas.
#IERR
458 Accessing Data and Data Analysis
Solution
Turn conditions specified after WHERE into variables. Then, you can rewrite the
whole formula, using the variables instead of the original formulas in the WHERE
clause.
This is the same solution as for #IERR in an aggregation containing a complex
formula. Refer to Solving #IERR by turning part of a formula into a variable on
page 457 for more information.
Calculation Troubleshooting
Accessing Data and Data Analysis 459
#OVERFLOW
Description
The calculation returns a number that is too big for BusinessObjects to compute.
The maximum is 17e +/- 308, or 15 digits.
Solution
Check the maximum value of the function used in the formula. For example, the
maximum value for the Fact function is 709.
The BusinessObjects online help on functions includes maximum values where
appropriate.
#OVERFLOW
460 Accessing Data and Data Analysis
#SYNTAX
Description
#SYNTAX occurs when a variable used in a formula no longer exists in the
document. For example, the formula
=<Product Price> * <Quantity Sold>
returns #SYNTAX if the user deletes either object from the query.
The missing variable can correspond to
an object returned by a query, or
a local variable that you have defined in the report.
Solution
The way you fix this problem depends on the data available in the report:
Calculation Troubleshooting
Accessing Data and Data Analysis 461
#UNKNOWN
Description
Occurs when the object corresponding to a variable displayed in the report has
been removed from the query.
When you remove an object from a query BusinessObjects does not always
remove it from the report, More specifically:
NOTE
If the missing variable is used in a formula, BusinessObjects returns #SYNTAX.
Solution
You have to add the missing object to the query. Heres how to do it:
1. Click Edit Data Provider on the Data menu. If the List of Data Providers
dialog box appears, click the query you want to edit, then click OK.
The Query Panel appears.
2. Double-click the missing object in the Classes and Objects box.
The object appears in the Result Objects box.
3. Click Run.
BusinessObjects replaces #UNKNOWN with the variable corresponding to
the object you added.
NOTE
If you do not want to add the missing data to your report, simply clear the cell
containing the error. Select the cell, then press the Del key on your keyboard. To
delete the cell, click Delete on the Edit menu.
#UNKNOWN
462 Accessing Data and Data Analysis
Tip What to do
1. All formulas must begin with = Type = before your formula.
If you forget =, BusinessObjects
displays the formula as text!
2. The extended syntax of a formula 1. Click the cell containing the
shows you the contexts formula.
BusinessObjects applies by default. 2. Rest your cursor over the
There are two easy ways to see the Formula Bar.
extended syntax of a formula. The extended formula appears
in a tooltip.
- or -
1. Click the cell containing the
formula.
2. Click Define as Variable on the
Data menu.
3. Click Evaluate the formula in its
context.
The extended formula appears
in the dialog box.
3. If you remove a dimension from a 1. Click the table containing the
table, a calculation that needs that dimension you want to hide.
dimension can return an error. To 2. Click Table on the Format
avoid this, you can hide the menu.
dimension: it wont appear in the 3. In the Pivot tab, click the
report, but it will be included in the dimension.
calculation.
4. Click Hide, then click OK.
4. The best way to fix #MULTIVALUE Click Break on the Format menu.
is to include the variable returning For more information, refer to
the error in the current break. Solution for #MULTIVALUE in a
break header or footer on page 445
Calculation Troubleshooting
Accessing Data and Data Analysis 463
Tip What to do
5. If you get #MULTIVALUE when you 1. Click the cell containing
insert a variable in a column header #MULTIVALUE.
of a table, try fixing it by applying a 2. Click Sort on the Insert menu.
sort.
6. When you create or edit a formula in If a variable name is highlighted
the Formula Bar or the Formula in full, add parentheses and
Editor, you press enter to validate check the spelling.
the formula. If theres a syntax error, If one end of a variable name is
BusinessObjects tells you so and highlighted, add a parenthesis.
highlights the anomaly in the
formula itself. This helps you fix the
specific problem.
7. You can edit formulas directly in the 1. Double-click the cell containing
report, without using the Formula the formula you want to edit.
Bar or the Formula Editor. 2. Edit the formula in the cell, then
press Enter when youre done.
8. You can display the Formula Editor Click the Formula Editor button:
from the Formula Bar.
9. You can view and edit all the Click Structure on the View
formulas displayed in a report by menu.
switching to Structure view.
10. BusinessObjects lists all the Click Report Manager on the View
formulas you create in a document menu. Click the Data tab and
in the Data tab of the Report expand the Formulas folder.
Manager.
11. BusinessObjects also lists formulas 1. Click Variables on the Data
in the Variables dialog box. In this menu.
dialog box, you can view, edit or 2. Double-click the Formulas
insert any formula you have folder.
created. 3. To edit a formula, select it then
click Edit.
4. To insert a formula, select it then
click Insert or Replace.
Calculation Troubleshooting
Formulas, Local Variables and
Functions
chapter
466 Accessing Data and Data Analysis
Overview
This chapter gives you an introduction to using BusinessObjects formulas, local
variables and functions. It explains how to set up your own formulas and
variables in BusinessObjects reports using BusinessObjects syntax, how to use
BusinessObjects functions, and also includes several examples of business
calculations.
Calculation Contexts and Extended Syntax on page 407 describes how to build
more powerful calculations by using extended syntax to define calculation
contexts. This chapter also has a calculations Quick reference on page 433 that
recaps some of the key BusinessObjects terms.
Calculation Troubleshooting on page 437 gives solutions to computation errors
that may occur in BusinessObjects when you are writing or using formulas.
Formulas
When you run a query, BusinessObjects makes calculations on the data at the
query level and returns the results as variables. You can also make calculations
on report data using the built-in calculations available on the calculations menu
or toolbar. This section explains how you can set up your own personalized
calculations on data in your reports by writing BusinessObjects formulas.
Setting conditions
You can use BusinessObjects formulas to set conditions. For example, you can
set up a condition to hide sections in a report if the sales revenue falls below a
certain level.
You can also set up conditional filters. For example, you want to display just the
outlets that have generated weekly revenue above a certain sum. By setting a
filter with a condition, when you refresh the report with the new weekly data, only
those outlets that satisfy the condition will be displayed in the report.
You can use conditions in Broadcast Agent when you are setting up reports for
scheduled processing to specify under what conditions your documents should
be processed.
Formulas
468 Accessing Data and Data Analysis
Creating formulas
There are three ways of creating formulas. You can:
type your formula directly into a cell
type your formula in the Formula Bar
use the Formula Editor
a b c d e
a. Opens the Variable Editor
b. Defines the formula displayed in the Formula Bar as a variable
c. Clears the Formula Bar text box of any non-validated changes you make in the
Formula Bar
d. Validates the formula displayed in the text box
e. Opens the Formula Editor
The Formula Bar has five buttons and a text box where the formula is displayed.
If you click inside any cell in a report, the contents are displayed in this text box.
Depending on the type of cell you clicked in, this could be text, the name of a
variable or a formula.
Formulas
470 Accessing Data and Data Analysis
Then Else and context operators such as ForAll, ForEach and In. The list of
operators in this window is updated as you add elements to the formula so that
only the operators that are compatible with the current syntax are displayed.
To understand how the Formula Editor works, let's look at an example.
EXAMPLE
Calculating a running total
In the table below you want to display a running total for the monthly sales
revenue.
To do this:
1. Insert a new column after the Sales Revenue column and name it Running
total.
2. Click inside the Running total column.
This is where you are going to insert the formula.
3. Click Edit Formula on the Data menu.
The Formula Editor appears.
4. Double-click the equal sign (=) sign in the Operators list.
The equal (=) sign is displayed in the Formulas box.
5. In the Functions box, open the All functions & aggregates folder.
6. Scroll down until the function RunningSum is displayed in the Functions box.
7. Double-click RunningSum.
BusinessObjects displays RunningSum in the Formulas box. Notice that the
cursor is inside the brackets. This is where BusinessObjects will insert the
variable.
8. In the Variables box, double-click Sales Revenue.
Sales revenue is added to the formula. Notice the angle brackets which are
automatically added to a variable by the Formula Editor.
9. Click OK.
The Formula Editor closes and the calculation is displayed in the
RunningSum column.
BusinessObjects stores the formula in the Formulas folder of the Report Manager
Data tab.
Syntax errors
If there is a syntax error in a formula, an error message is displayed and the part
of the formula that contains the error is highlighted.
Formulas
472 Accessing Data and Data Analysis
Local variables
A local variable is a named formula. Local variables appear in the list of variables
in the Report Manager Data tab; you can use them to build tables, charts and
crosstabs in the same way as you use variables returned by a data provider.
If the Edit Variable is not available (grayed out) the variable was returned by
the data provider and cannot be edited.
Local variables
474 Accessing Data and Data Analysis
5. In the Qualification box, choose whether you want the local variable to be
defined as a Dimension, Measure or Detail object.
6. Click OK.
The new variable is displayed in the list of variables in the Report Manager
data tab.
EXAMPLE
Highlighting above-average margin
You have set up a formula to calculate average margin and now decide you want
to highlight all those stores that have made above average margin. In
BusinessObjects you can highlight data in this way using alerters but you cannot
apply an alerter on a column or row of data that contains a formula. However, you
can use an alerter on a variable. By turning your formula into a variable you can
highlight your above-average stores.
To transform a formula into a variable:
1. Select the column of data that contains the formula.
2. Click Define As Variable on the Data menu.
3. Type in a name for the variable in the Define the Variable dialog box.
5. Click OK.
The variable is now displayed in the variables folder in the Report Manager
Data tab and you can set up an alerter using the variable.
For further information on calculation contexts, see "Calculation Contexts and
Extended Syntax" on page 407.
Local variables
476 Accessing Data and Data Analysis
EXAMPLE
Group quarters to display revenue per semester
You have a report showing the sales revenue per quarter, as follows:
You want to display revenue per semester. You do this by grouping the quarters.
The Quarter variable returns four values - Q1, Q2, Q3, Q4. By grouping Q1 and
Q2 into one value (H1), and Q3 and Q4 into a second value (H2) you create a
new variable, Semester, and then calculate revenue by semester. You then add
Semester to a drill hierarchy and use it in your analysis in drill mode.
To do this:
1. Select Q1 in the table.
2. Holding down the Ctrl key, select Q2.
3. Click Group Values on the Report toolbar.
The Rename grouped values box opens.
Group Values
4. Type in the new name, H1, in the Rename Group box and click OK.
BusinessObjects groups Q1 and Q2 together and displays the new name, H1,
in the table.
5. Repeat Step 1 to Step 4 to group the values for Q3 and Q4 and name the new
value H2.
The table now looks like this.
You can rename the new variable to make its name more meaningful To do this:
1. Right-click on the Quarter+ In Table 1 variable in the Report Manager window.
2. Click Edit Variable on the shortcut menu.
The Edit box opens.
3. Type in a new name, Semester, in the Name of the Variable text box and click
OK.
The new name, Semester, is displayed in the Variables list and in the table.
Your table now displays sales revenue per semester.
NOTE
For more information on setting up and using drill mode, see Analyzing Data in
Drill Mode on page 237.
Editing formulas
You can edit a formula directly in the cell or in the Formula Bar or you can use
the Formula Editor.
1. Click the cell that displays the result of the formula you want to edit.
2. Then:
Type your changes into the cell and press Enter to validate them
Click inside the Formula Bar, and edit the formula and click Validate Formula
to validate the formula.
Click Edit Formula on the Data menu, make your changes in the Formula
Editor and click OK to validate them.
BusinessObjects displays the result of the formula in the cell.
NOTE
You can delete local variables only, not variables returned by a data provider.
Functions
BusinessObjects contains many built-in functions which greatly extend its
capabilities. Functions are pre-defined formulas. A function consists of the
function name followed by a pair of parentheses. The parentheses can contain
arguments and arguments supply functions with values on which to operate.
Arguments can be objects, constants or other functions.
Some commonly used functions are available directly from the BusinessObjects
menus and toolbars. When you choose one of these functions, the necessary
arguments are added automatically.
The entire set of functions is organized in nine folders in the Functions box of the
Formula Editor:
Using Functions
When you select a function in the list in the Functions window, a description of
the syntax the function requires is displayed at the bottom of the Formula Editor
window.
Functions
484 Accessing Data and Data Analysis
When you add a function to the Formula window, any necessary commas are
added. The following example shows you how to use a BusinessObjects function
to rank data according to revenue generated.
EXAMPLE
Ranking cities according to sales revenue
In this example, you want to rank the cities in your table according to sales
revenue generated this quarter.
To do this:
1. Add a new column to the table and name it Revenue Rank.
Click in the Revenue rank column.
2. Click Edit Formula on the Data menu.
The Formula Editor appears.
3. Open the All functions and aggregates folder and scroll down to the Rank
function.
4. Double-click on Rank.
BusinessObjects
adds parentheses
and commas
automatically.
Click here to
get more
information on
the function.
BusinessObjects shows
the syntax for the
selected function here.
TIP
To find a function quickly in the Functions list, open the All functions & aggregates
folder and then type the first letter of the function you want to find.
BusinessObjects highlights the first function beginning with that letter.
Functions
486 Accessing Data and Data Analysis
EXAMPLE
Calculating a 3-week rolling average
Using a rolling average smooths out the fluctuations of a measure variable that
fluctuates over time, for example stock prices, which change daily. A rolling
average is obtained by calculating the average of the current value and the
specified number of previous values. In BusinessObjects, you use the Previous()
function to set up a rolling average.
This example shows you how to create the variable to calculate a three-week
rolling average for sales revenue.
1. Right-click on any variable in the Report Manager Data tab and click New
Variable on the shortcut menu.
The Variable Editor appears.
2. Click the Definition tab.
3. In the Name box, type 3 weeks rolling.
4. Under Qualification, choose Measure.
5. Click the Formula tab.
6. In the Formulas box, type the formula:
=(<Sales revenue>+Previous(<Sales
revenue>)+Previous(Previous(<Sales revenue>)))/3.
This formula adds the sales revenue for the current week to the sales revenue for
the two previous weeks and then divides the total by three to obtain an average
for those three weeks. To create this formula, we use the BusinessObjects
Previous() function.
7. Click OK.
The new variable is added to the list in the Report Manager Data tab and you
can use it in the tables and charts in your report.
EXAMPLE
Combining first and last names in a single cell
The BusinessObjects Concatenation() function allows you to combine two
character strings. The character string may be a piece of text or a character-type
variable. The syntax for this function is:
Concatenation(character string, character string)
To display a persons first and last name in a single cell, the following syntax:
=Concatenation(<First Name>,<Last Name>)
will give the following result: JohnGardner
You would typically wish to have a space between the first and last name. To do
this, you need to use the following syntax:
=Concatenation(<First Name> ,(Concatenation(" " ,<Last Name>)))
You can also use the concatenation operator (&) to concatenate strings. If you
are combining several character strings and want to add spaces, using the &
operator is a simpler solution than using the Concatenation() function. The syntax
to achieve the same result as shown above using the & operator is:
=<First Name>&" "&<Last Name>
Notice that the space you typed is surrounded by quote marks.
EXAMPLE
Combining text and data in a single cell
You can use the same syntax as in the example above to add a comment to data
in a table cell or a master cell. The table below shows sales figures for Austin for
Q1 2001, but quarter is not displayed in the table. By editing the master cell
contents, you can add a more explanatory title for each section in the report as
shown below:
If you want to place a filter on the City section after combining text and data in the
master cell, youll notice that the Insert Filter button on the Standard toolbar is
unavailable. To insert a filter:
1. Select the master cell.
2. Click Filters on the Format menu.
The Filters dialog box appears.
3. Click Add.
The Variables to Filter dialog box appears.
4. Select City and click OK to return to the Filters dialog box.
In the Values box, select the cities you want to filter and click OK.
EXAMPLE
Combining text and numbers in a single cell
The Concatenation() function and & operator allow you to combine character-
type data only. If you want to combine text or character-type data with numbers
you must first convert the number into a character string. Otherwise,
BusinessObjects displays the error message 'Incompatible data type'. You can
convert a number to a character string using the FormatNumber() function.
EXAMPLE
Combining text and dates in a single cell
In the same way, if you want to combine text with dates using the & operator or
the Concatenation() function, you must first convert the date into a character
string. Otherwise, BusinessObjects displays the error message 'Incompatible
data type'. You can convert a date into a character string using the FormatDate()
function.
EXAMPLE
Comparing yearly margin growth using the Where function
A common requirement in business is to compare data from different dates or
periods so you can evaluate how key indicators such as revenue and margin
have progressed. The BusinessObjects Where function allows you to identify
data with the values of another variable so that you can compare related data.
In the example below, you want to compare yearly margin. Your BusinessObjects
document contains the variables for year, margin and city. Using this data, you
can write a BusinessObjects formula to assign margin to a specific year and then
calculate margin growth from one year to the next.
To do this:
1. Right-click on any variable in the list of variables in the Report Manager Data
tab and click New Variable on the shortcut menu.
The Variable Editor appears.
2. Click the Definition tab.
3. In the Name box, type 2001 Margin.
4. In the Qualification section, choose Measure.
5. Click the Formula tab.
6. In the Formulas box, type the formula:
=<Margin> Where (<Year>="2001")
This formula calculates the margin for the year 2001 only. Note that we use the
BusinessObjects Where operator in the formula to specify the year.
7. Click OK.
BusinessObjects adds the new variable to the list in the Report Manager Data
tab.
8. Repeat the procedure above to create one variable called 2002 Margin and
one called 2003 Margin using the following syntax:
=<Margin> Where (<Year>="2002")
=<Margin> Where (<Year>="2003")
BusinessObjects adds the new variables to the list in the Report Manager Data
tab.
You could have simply created a formula to calculate the margin for each year.
The advantage of creating a variable is that you can then re-use it more easily in
other formulas. For example, you can now easily calculate the percent increase
in margin between the 2001 and 2002 using the variables you have just created
and display the increase in a new column in the table. The formula for the 2001-
2002 growth is as follows:
=FormatNumber((((<2002 Margin> - <2001 Margin>)/<2001 Margin>)
* 100) ,"0.0")&"%"
and the formula for 2002-2003 growth is:
=FormatNumber((((<2003 Margin> - <2002 Margin>)/<2002 Margin>)
* 100) ,"0.0")&"%"
EXAMPLE
Using function output as input to another function
You can use the output of a function as the input to another function. In this way
you can combine functions to create complex formulas. For example, the
UniverseName() function returns a string containing the name of a universe on
which a data provider is based. You use this function by supplying the the name
of the data provider as a string argument, for example:
UniverseName(Sales).
The problem with hard-coding a data provider name in this way is that, if the data
provider name is changed, the function will no longer work.
You solve this by using the output of the DataProvider() function as input to the
UniverseName() function. DataProvider() takes a variable as input, so
DataProvider(<Sale Date>)
returns the name of the data provider of the Sale Date variable. As a result, the
formula
UniverseName(DataProvider(<Sale Date>))
always returns the universe name, even if the data provider name is changed.
EXAMPLE
Determining the first and last days of the previous month
It is commmon to run reports against the last complete months data. In order to
do this you need to determine the first and last days of the previous month. You
do this by creating variables that return these dates and then using these
variables in your report. These variables combine numerous functions and use
function output as the input to other functions.
First, create a variable that returns the date of the first day in the previous month
as a string in the form YYYYMMDD (for example 20020601).
To do this:
1. Click Variables on the Data menu.
The Variables dialog box appears.
2. Click Add.
The Variable Editor appears.
3. Type FirstDayOfPrevMonthAsString in the Name box.
4. Click the Formula tab.
5. Type the formula
FormatNumber(Year(CurrentDate()),"0000")&
FormatNumber(MonthNumberOfYear(CurrentDate()) - 1 ,"00")&"01"
6. Click OK to close the Variable Editor.
7. Click OK to close the Variables dialog box.
This formula shows how you can combine multiple functions, using the output of
functions as the input to other functions to create complex formulas. The table
below breaks down the formula.
Function Returns
CurrentDate() The current date
Year(CurrentDate()) The current dates year
as an integer
MonthNumberOfYear(CurrentDate()) The current dates month
as an integer
(Subtract 1 from this to
give the previous month
as an integer)
FormatNumber(Year(CurrentDate()),0000) The current dates year
as a string
FormatNumber(MonthNumberOfYear( The previous month
CurrentDate())-1),00) number as a string
The formula you typed takes the last two functions in the table, concatenates
them (using the & operator) and concantenates 01 to the end (for the first day
of the month) to give a string in the form YYYYMMDD (for example
20020601).
EXAMPLE
Calculating total revenue for all resorts when some are filtered out
In this example you have a report containing the top two resorts in a report
showing resorts, their countries and their associated revenues. You restrict the
report to the top two resorts by placing a rank on the Resort column.
Why is this different from the result above? By default the Sum function takes into
account only the revenues in the block; the sum shown is the total revenue for
the Hawaiian Club and Bahamas Beach resorts. The French Riviera resort is
filtered from this report by the rank on the Resort column. However, you need to
include its revenue in the calculation of total overall revenue. The NoFilter()
function makes this possible. This function tells BusinessObjects to ignore filters
when calculating, so the formula
NoFilter(Sum(<Revenue>))
returns the total revenue for all resorts.
part
Launching BusinessObjects with
the Run Command
appendix
504 Accessing Data and Data Analysis
Overview
This appendix explains how to run BusinessObjects by using the Run command
on Windows. You can use the Run command as an alternative way of double-
clicking the BusinessObjects icon. You can also specify command line options
such as your user name, password and other options.
Option Description
-user [user name] The user name assigned to you by your supervisor.
User names that include spaces must be written in
double quotes, for example user name.
-pass [password] The password assigned to you by your supervisor.
This option is mandatory if you enter the -user
option. Passwords that include spaces must be
written in double quotes, for example my
password.
TIP
In the file you declare after the -vars option, you can also specify the variables
such as DBUSER, DBPASSWORD and DBDSN. (The names of such variables
depend on the database at your site). These variables can be used to define a
restriction on an object, for example. For further information on these variables,
refer to BusinessObjects Variables in the Database Guide included in your
BusinessObjects package.
NOTE
User names and passwords that contain spaces must be written in double
quotes, e.g., user name. You must use upper-case characters when specifying
the variables that manage security, as in the example above.
appendix
510 Accessing Data and Data Analysis
Overview
You can customize BusinessObjects 6.x using the Microsoft Visual Basic for
Applications programming language. BusinessObjects 6.x has a Visual Basic
Editor that you can use to develop macros, add-ins and VBA data providers. The
Visual Basic Editor is the standard Microsoft VBA editor that you may already be
familiar with if you use Microsoft Office products.
This chapter describes how to use macros and add-ins in BusinessObjects. For
information on building VBA data providers, see Using Visual Basic for
Applications procedures on page 98.
What is a macro?
A macro is a series of commands and functions that are stored in a Visual Basic
for Applications module and can be run whenever you need to perform the task.
If you perform a task repeatedly, you can automate the task with a macro.You
create macros using the Visual Basic Editor.
What is an add-in?
Add-ins are programs that add optional commands and features to
BusinessObjects. Add-ins are usually created by those responsible in your
company for adding customized features to BusinessObjects. All you probably
need to do is install and uninstall add-ins that are sent to you.
Before you can use an add-in, you must install it on your computer and then load
it in BusinessObjects. Add-ins (*.rea files) are installed by default in the UserDocs
folder in the BusinessObjects folder. Loading an add-in makes the feature
available in BusinessObjects and adds any associated commands to the
appropriate menus.
Unloading an add-in removes its features and commands from BusinessObjects,
but the add-in program remains on your computer so you can easily load it again.
You can use your own Visual Basic for Applications programs as custom add-ins.
For information about making a Visual Basic for Applications program an add-in,
see the BusinessObjects SDK Reference Guide.
Using macros
Macros are created and stored inside BusinessObjects documents (.rep files) or
BusinessObjects add-ins (.rea files). You can run macros either from the Macros
dialog box or from the Visual Basic toolbar if macros have been assigned to the
macro buttons.
Running a macro
1. Click Macro, then Macros on the Tools menu or click Macros on the Visual
Basic toolbar.
The Macros dialog box opens.
2. From the Macros in: list box, choose the documents where the macros are
stored. You can display the macros available in the active document, all
macros in all open documents, macros in a selected open document or
macros in add-ins.
The macros stored in the selected document(s) are displayed in the Macro
Name list.
3. Select the name of the macro you want to use and click Run.
Using macros
512 Accessing Data and Data Analysis
NOTE
If VBA is not installed and you open a document that contains macros, you
receive an error message warning you that macros will not be executed. In this
situation, your document might return incorrect or incomplete data. The Olap
Connect and Web Connect data providers also require VBA in order to function
correctly.
a b c
3. Click check box 1 to activate the first button on the Visual Basic toolbar.
4. Click the button to the right of the Macro Name box.
5. The Macros dialog box opens.
6. Click on the macro you want to use from the list and click Select.
The name the macro is displayed in the Macro Name box.
7. In the Tooltip box, type the tooltip that you want to use for the macro.
The tooltip appears when you rest the cursor over the button on the Visual
Basic toolbar.
Using macros
514 Accessing Data and Data Analysis
Using add-ins
BusinessObjects add-ins are Visual Basic for Applications programs that add
optional commands and features to BusinessObjects. You can distribute add-ins
you have created to other users and retrieve and use add-ins that others have
created.
Installing an add-in
Click Add-Ins on the Tools menu.
The Add-Ins dialog box opens.
NOTE
When a user installs an add-in, it is only installed for that user. If that user logs
on under a different name, the add-in will not be available.
Using an add-in
You can run an installed add-in from the Macros dialog box, or you can associate
it with a button on the Visual Basic toolbar.
Uninstalling an add-in
1. Click the check box next to the add-in name in the Add-Ins dialog box to
remove the check mark
2. Click OK.
The add-in features and commands are removed from BusinessObjects, but
the add-in program remains on your computer so you can easily load it again
if you want to use it.
Using add-ins
516 Accessing Data and Data Analysis
To convert a script
1. Click Macro then Convert from ReportScript on the Tools menu.
The Open dialog box is displayed. By default, the Scripts folder is open and a
list of available scripts is displayed.
Image not available for Beta
2. Select the script you want to convert.
3. In the Convert in: list box, choose where you want the converted macro to be
saved.
You can convert the macro in the active document or in a new document.
4. Click Import.
The script is converted.
NOTE
The macro may sometimes need some slight tweaking in the Visual Basic Editor
after conversion to get it to work correctly. For information on how to do this, see
the Customizing BusinessObjects guide.
Index
####### error 450 B
#ALERTER error 451 Basic Authentication
#COMPUTATION error 439 querying a page using 175
#DICT.ERROR error 452 blocks
#DIV/0 error 454 using separate data providers for 205
#ERROR error 455 BOPASS variable 507
#IERR error 456 BOUSER variable 507
#MULTIVALUE error 443 breaks
#OVERFLOW error 459 and ranking 319
#SYNTAX error 460 applying in slice-and-dice mode 292
#UNKNOWN error 461 BusinessObjects
defined 25
A demo materials and samples 30
Abs function launching with the Run command 505
Excel equivalent 487 new features 31
accessing data sources 36 source of data 25
alerters upgrading from earlier versions 31
copying 327 BusinessObjects administrator
creating 323 and free-hand SQL 87
deleting 328
displaying/hiding 327 C
editing 327 calculations
naming 324 adding to reports 389
selecting data 324 examples of 392
setting conditions 325 re-using 395
setting formatting 325 Ceil function
switching off 326 Excel equivalent 487
switching on 326 cells
analyzing data autoqualifying 171
on-report analysis 233 Char function
overview 232 Excel equivalent 489
using an OLAP server 235 charts
using drill mode 234 displaying data in 208
using slice-and-dice mode 236 drilling on 247
Asc function combining data 40
Excel equivalent 489 complex condition calculations
Average function examining the SQL of 352
Excel equivalent 487
Index
520 Accessing Data and Data Analysis
Index
Accessing Data and Data Analysis 521
Index
522 Accessing Data and Data Analysis
E filters
error messages adding 302
####### 450 applying in slice-and-dice mode 292
#ALERTER 451 creating complex filters 304
#COMPUTATION 439 displaying names of in special fields 303
#DICT.ERROR 452 editing complex filters 305
#DIV/0 454 ignoring 305
#ERROR 455 inserting 299
#IERR 456 inserting complex filters 304
#MULTIVALUE 443 managing 300
#OVERFLOW 459 removing 303
#SYNTAX 460 selecting different values for 301
#UNKNOWN 461 Floor function
tips and tricks regarding 462 Excel equivalent 488
EuroConvertFrom function FormatDate
Excel equivalent 488 Excel equivalent 489
EuroConvertTo function FormatNumber
Excel equivalent 488 Excel equivalent 489
EuroFromRoundErr function formulas
Excel equivalent 487 creating using Formula Editor 469
Euros defined 467
converting from 400 guidelines on syntax 471
converting to 399 qualifying 266
converting to and from 398 free-hand SQL
displaying rounding errors in calculations 400 and sorts 69
displaying the euro symbol 398 creating a connection 80
EuroToRoundErr function creating interactive reports with 83
Excel equivalent 487 creating reports using 75
Exp function creating/editing a connection for 79
Excel equivalent 488 editing a connection for 81
extended calculation syntax 409 editing an SQL script 79
and Rank function 425 example of 83
context operators 435 example of query with prompt 86
ForAll operator 422 opening an existing script 77
ForEach operator 422 restrictions on scripts 87
keywords 429 viewing raw data 78
quick reference 433 writing a new script 77
functions
Excel equivalents of 487
F
Fact function
Excel equivalent 488 G
Fill function grouped values
Excel equivalent 489 adding to drill hierarchy 480
Index
Accessing Data and Data Analysis 523
H LeftTrim function
hidden data Excel equivalent 489
displaying 322 Length function
hiding report data 321 Excel equivalent 489
hiding data 321 lists of values
hierarchies 239 assigning data from a dBase file 383
adding dimensions to 263 assigning personal data from a text file 380
changing the order of dimensions in 264 assigning personal data from an Excel file 382
creating 264 assigning personal data to 380
creating custom hierarchies 264 customizing 375
custom hierarchies defined 262 defined 373
default 239 displaying, purging and refreshing 385
deleting 264 editing 376
drilling on multiple hierarchies 248 Ln function
drilling up on multiple hierarchies 249 Excel equivalent 488
drilling using custom hierarchies 262 local variables
editing 262 creating 473
in Island Resorts Marketing 240 creating by grouping values 476
qualifying data for 266 defined 472
removing dimensions from 264 qualifying 266
renaming 264 transforming formulas into 474
restrictions on editing 262 Log function
viewing 63 Excel equivalent 488
highlighting data see Alerters 323 Log10 function
Excel equivalent 488
Lower function
I Excel equivalent 489
InitCap function
Excel equivalent 489
Internet queries 121 M
conversion errors 174 master/detail reports
creating 138 activating/deactivating multiple sections 282
editing 166 building 277
saving 167 deactivating sections of 279, 280
saving preferences 168 ranking in 318
setting individual options 172 reactivating sections of 282
Internet Query Panel reorganizing 276
description of 134 structuring existing reports as 275
setting size 168 undoing 278
toolbar buttons 135 using different master 277
working in slice-and-dice mode with 273
Match function
L Excel equivalent 489
Left function matrix chart, 3-D
Excel equivalent 489 building from table or 2-D chart 286
Index
524 Accessing Data and Data Analysis
Max function P
Excel equivalent 487 personal data files 37
measure objects 55 benefits of 94
measures creating reports using 94
analyzing in drill mode 254 setting options 97
collapsing 255 Pos function
defined 254 Excel equivalent 489
expanding 254 Power function
Median function Excel equivalent 488
Excel equivalent 488 predefined conditions
Min function applying to queries 66
Excel equivalent 487 in Island Resorts Marketing universe 66
Mod function removing 67
Excel equivalent 488 printing
monovalued prompts from drill mode 269
defined 153 prompts
Month function adding to Web Connect queries 124
Excel equivalent 489 creating in Web Connect queries 154
MonthNumberofYear function defined 153
Excel equivalent 489 displaying values in a separate column 157
multivalued prompts in free-hand SQL 83
defined 153 monovalued 153
multivalued 153
O syntax in free-hand SQL scripts 84
objects using with Web Connect queries 153
changing order of in queries 60
detail 55 Q
displaying in Query Panel 59 Quarter function
including in queries 60 Excel equivalent 489
measure 55
moving from Drill toolbar to blocks 253
removing from queries 60
searching for in Query Panel 60
OLAP cubes
using to build reports 116
OLAP servers 38, 235
operators
Different From 342
Except 342
In List 342
Not In List 342
options
setting for drill mode 270
Index
Accessing Data and Data Analysis 525
queries reports
adding content to in Web Connect 136 adding columns to 212
applying complex conditions on 337, 338 combining data sources in 204
building in Query Panel 59 including data from different data sources 204
building on universes 52, 56 making copies of 256
building powerful queries 63 sharing 28
Business Objects Web Connect queries 123 Right function
corporate Web Connect queries 123 Excel equivalent 488
creating new Web Connect queries 133 RightTrim function
eliminating duplicate rows 70 Excel equivalent 488
generating SQL without retrieving data 70 Round function
Internet queries 123 Excel equivalent 488
running 61
running on different universes 72 S
saving definitions of 62
SAP 38
setting options 70
saving documents in Excel format 31
specifying number of rows to return 70
scope of analysis
using output in conditions 356
and hierarchies 63
query catalogs 121
defined 63
query panel
defining 63
building a query using 59
defining default 64
changing object order 60
defining manually 65
described 58
drilling through to the database 258
displaying 56
extending 257
including objects in queries 60
secured web sites
removing objects from queries 60
accessing using Web Connect 175
running queries from 61
security 29
searching for objects in 60
seperators
specifying in Internet queries 173
R Sign function
ranking Excel equivalent 488
and breaks 319 simple conditions
applying in slice-and-dice mode 291 applying 67
ranking data 315 deleting 69
displaying percentages 318 selecting different values for 68
displaying subtotals 317 Sin function
editing an existing ranking 319 Excel equivalent 488
ranking in master/detail reports 318
removing a ranking 320
RelativeDate function
Excel equivalent 489
Replace function
Excel equivalent 489
Report Manager
moving variables from 250
Index
526 Accessing Data and Data Analysis
Index
Accessing Data and Data Analysis 527
user objects
creating 331
creating a time hierarchy for 336
defined 331
deleting 336
editing 335
qualifying 268
reasons for creating 331
restrictions on 332
sharing with other users 332
V
Var function
Excel equivalent 487
variables
compatibility rules 207
VarP function
Excel equivalent 487
VBA procedures 37
accessing Outlook with 100
creating a report using 99
example of 102
using 98
Index
528 Accessing Data and Data Analysis
Index