Professional Documents
Culture Documents
Queries Guide
8497-1M
8497-1M
Hummingbird Ltd.
1 Sparks Avenue, North York, Ontario, Canada M2H 2W1
Telephone (Canada and USA): +1-877-FLY HUMM (+1-877-359-4866)
Telephone (Worldwide): +1-416-496-2200
Fax: +1-416-773-5825
BBS: +1-416-496-9233
E-mail: getinfo@hummingbird.com
Web Site: www.hummingbird.com
FTP: ftp.hummingbird.com
RESTRICTED RIGHTS LEGEND. Unpublished rights reserved under the copyright laws of the United States. The SOFTWARE
is provided with restricted rights. Use, duplications, or disclosure by the U.S. Government is subject to restrictions as set forth in
subparagraph (c) (1) (ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, subparagraph (c)(1)
and (2) (a) (15) of the Commercial Computer Software-Restricted Rights clause at 48 CFR 52.227-19, as applicable, similar clauses in
the FAR and NASA FAR Supplement, any successor or similar regulation.
Copyright © 2000 Hummingbird Ltd. All rights reserved. BI/Analyze, BI/Analyze CubeCreator, BI/Broker, BI/Broker Admin,
BI/Broker Repository, BI/Query, BI/Query Admin, BI/Query Reports, BI/Query Reports Chart Editor, BI/Query Update,
BI/Query User, BI/Suite, BI/Web, BI/Web Personal Portfolio, Genio Designer, Genio Engine, Genio Met@Data Explorer, Genio
Met@Data Studio, Genio MetaLink, Genio Repository, Genio Scheduler, and Genio Suite are trademarks of Hummingbird Ltd. and/or
its subsidiaries.
BI/Suite makes use of the Blowfish library, an SSL implementation written by Eric Young, © 1995–1997, Eric Young. All rights reserved.
Adobe, Acrobat, and Acrobat Reader are trademarks of Adobe Systems Incorporated.
DB2 is a trademark, and OS/2 is a registered trademark, of International Business Machines Corporation.
Hyperion Essbase OLAP Server is a trademark of Hyperion Solutions Corporation.
Ingres/Net is a trademark of Computer Associates International, Inc.
Java is a trademark of Sun Microsystems, Inc.
MetaCube is a registered trademark of Informix Software, Inc.
Microsoft, Microsoft Excel, Microsoft Word, Visual Basic, Windows, Windows 95, Windows 98, and Internet Explorer are registered
trademarks, and Windows NT is a trademark, of Microsoft Corporation.
NCR TeraCube and Teradata are registered trademarks, and WinCLI is a trademark, of NCR Corporation.
Netscape, Navigator, and Communicator are trademarks of Netscape Communications Corporation.
Oracle and SQL*Net are registered trademarks of Oracle Corporation.
Palm is a trademark of Palm, Inc. Quicksheet is a trademark of Cutting Edge Software, Inc.
Photo clipart copyright © 1996 PhotoDisc, Inc.
SequeLink is a trademark of Intersolv, Inc.
Sybase is a registered trademark of Sybase, Inc.
WhiteLight Server is a trademark of WhiteLight Systems, Inc.
All other copyrights, trademarks, and tradenames are the property of their respective owners.
DISCLAIMER. Hummingbird software and documentation has been tested and reviewed. Nevertheless, Hummingbird Ltd. makes no
warranty or representation, either express or implied, with respect to the software and documentation included. In no event will
Hummingbird Ltd. be liable for direct, indirect, special, incidental, or consequential damages resulting from any defect in the software or
documentation included with these products. In particular, Hummingbird Ltd. shall have no liability for any programs or data used with
these products, including the cost of recovering such programs or data.
Information in this document is subject to change without notice and does not represent a commitment on the part of Hummingbird
Ltd. Not all copyrights pertain to all products.
This guide contains proprietary information that is protected by copyright. All rights are reserved. This guide may not be photocopied,
reproduced, or translated into another language, in whole or in part, without prior written consent from Hummingbird.
This edition published October 2000. Available in PDF format only.
Printed in Canada.
Contents
Welcome to BI/Query 3 Starting BI/Query 21
About This Guide 3 Finding the Administrator Layer
in a Split Data Model 23
Conventions 3
Connecting 24
Illustrations 4
Related Documentation 4 Using a Default Connection File 25
Using Another Connection File 25
Guides 4
Entering Additional Information 26
Online Help 5
Technical Support 5 Disconnecting 26
Contents iii
Formatting Data 71 Creating Variables 108
Entering Data 71 Specifying Attributes and Operators 110
Default Format 71 Including Functions 113
Matching Display Formatting 71 Including Variables 114
Numbers 72 Including Prompts 115
Dates 73 Importing Variables from a File 116
Invalid Entries 73 Using Variables to Supply User Names 117
Converting Two-digit Years 73
Building Advanced Queries 121
Displaying Data 75
Qualifying One Attribute with
Formatting Numbers 76 Another 121
Formatting Dates 77 Qualifying an Attribute with a
Inserting and Deleting Characters 77 Subquery 122
Substituting Values 78 Modifying the SQL 125
Modifying a Query for Selected
Data Values Files, Prompts, and Results 126
Variables 83
Narrowing the Range of Results 128
Data Values Files 83
Combining Queries 129
Naming and Storing Data Values Files 85
Appending One Results Set to Another 130
Creating Data Values Results Files 86
Joining One Column to Another 132
Creating Data Values Query Files 90
Editing Combined Queries 136
Using Data Values Files to Alias Data 93
Using the Super Query window 137
Prompts 96
Editing a Component Query 138
Naming and Storing Prompts 97
Editing an Operation 139
Creating Single Prompts 97
Correcting Errors 140
Group Prompts 98
Creating Dynamic Relationships 142
Conditional Prompts 101
Building Queries with a Circular Path 144
Importing Prompts 106
With a Correlation 145
Variables 107
Without a Correlation 149
iv Contents
Exporting Information 155
Exporting Queries 155
Exporting Results 156
Copying and Pasting Results 157
Saving Results to a File 157
Exporting Results to an Application 158
Preparing Results for Export 159
Specifying Results Options 159
Setting Export Options 161
Exporting to Excel Using DDE 163
Common DDE Commands 163
Setting Export Options for Excel 164
Using Two Commands 164
Using the First Command only on Startup 165
Issuing Two Commands to Obtain
the Effect of Three 165
Combining Three Results Sets 166
Sending Current Results to Excel 167
Running a Macro That Calculates a
12-month Moving Total 168
Export Results Using Mail 169
Index 171
Contents v
Welcome to BI/Query
Conventions
This guide uses certain conventions to help you use it effectively.
Welcome to BI/Query 3
Illustrations
The illustrations in this guide are based on fictitious data. Some
illustrations may look somewhat different than what you see on your
monitor. Nevertheless, their functionality is the same.
Related Documentation
For information about installing and using BI/Query as well as using
other Hummingbird applications, see the documentation outlined
below. (For information about these applications, see “Hummingbird
BI/Suite” on page 9.)
Guides
The following guides describe the features, functionality, and
Electronic Documents
applications of Hummingbird’s BI/Suite software.
All guides are available
online as Adobe Acrobat
Portable Document For- Use This Guide To Do This
mat (PDF) files. If you
installed the documenta- BI/Query Determine system requirements and install
tion with the software, it’s Installation Guide BI/Query and BI/Query Reports.
accessible from the Start
menu. It’s also available on BI/Query Create and manage data models and update
the installation CD-ROM. Data Models Guide records in the database.
To open a PDF file, you BI/Query Produce reports using BI/Query Reports
need Acrobat Reader. It’s
Reports Guide from data obtained using BI/Query.
provided on the installation
CD-ROM and is also BI/Broker Configure and manage BI/Broker, and set
available at Adobe’s Web Administrator’s Guide up the security, publishing, and scheduling
site (http://www.adobe.com).
features it provides.
Using Acrobat 3.0 or later
allows you to take advan- BI/Broker Publish and secure data models, queries,
tage of its Find facility. Publishing and data sources, and reports in a common
Scheduling Guide repository using desktop applications. Also,
schedule queries, reports, and HyperCubes.
4 Welcome to BI/Query
Use This Guide To Do This
Online Help
Online help provides step-by-step instructions for using a product. You Tool tips allow
can access online help in a number of ways. you to find infor-
mation about
menu commands
To Do This Do This and toolbars. Position the
cursor over the item to dis-
Display contents Choose Help>Contents. play a brief description on the
status bar.
Locate specific information Choose Help>Search for Help On,
then specify what you’re looking for.
Get Help for a dialog box Click the Help button in the dialog
box.
Technical Support
The administrator of this product in an organization should be the first
contact for technical support. (The administrator is most familiar with
the organization’s particular configuration.) If the problem isn’t
resolved, the next step depends on where the product was purchased.
Welcome to BI/Query 5
Contacting Technical Support
You can report problems and suggest enhancements in BI/Suite
software by contacting Technical Support. Before we can investigate
your problem, we need certain information from you. This
information is outlined on our Web site on the Technical Support
page. You can use the form that’s provided, or you can provide the
information by phone or fax.
UK Tel: +44-118-902-9507
Fax: +44-118-978-9325
E-mail: uk-bi-support@hummingbird.com
6 Welcome to BI/Query
Troubleshooting Using the Trace Utility
A trace utility is installed with this software to help us troubleshoot
problems that our customers are having. The trace utility simplifies
problem-solving by monitoring the activity of our products. If
you’re having a problem with the software, Technical Support will ask
you to run the trace utility, reproduce the problem you’re having, save To make the trace
the trace information, and send them the resulting trace file. Technical utility easy to use
and administer,
Support will step you through the process and provide additional
you can run it on
information if necessary. only one machine at a time. If
you try to open the utility on
When your problem involves a BI/Suite desktop application, you must another machine running
run the trace utility on the machine that’s exhibiting the problem. BI/Suite components, a mes-
sage box appears, stating the
To run the trace utility name of the machine where
the utility is already running.
1 Double-click the trace.exe file in Program Files\Hummingbird BI\
Utility.
2 Make sure tracing is enabled. (If it is, a check mark appears beside
the File>Tracing Enabled command.)
3 Make sure Corba tracing is disabled and Com tracing is enabled.
(Choose File>Preferences. In the Preferences dialog box, click the
Disable Corba Messages check box to disable Corba tracing. Make
sure the Disable Com Messages check box isn’t selected.)
4 Run a BI/Suite application. (In BI/Query, click the system icon
above the File menu, then choose Debug. In the Debug Control
Panel dialog box, choose Trace Utility (via Com) from the Trace
Output list, then click OK.)
5 Reproduce the problem.
Professional Services
Hummingbird supports its products by offering consulting and training
services worldwide. Working alongside your own technical and non-
technical staff, our Professional Services group can help you identify
areas where improved information management can enhance your
business performance. And we can supply the expertise you need to
bring these opportunities to fruition.
Welcome to BI/Query 7
Hummingbird offers standard training to help users and administrators
become confident using our products. We also design courses that are
tailored to meet your organization’s specific needs. These courses can
take place at your workplace or at our own training centers.
Fax +1-613-548-7801
E-mail proservices@hummingbird.com
Web www.hummingbird.com
8 Welcome to BI/Query
Genio Suite includes the following components:
Hummingbird BI/Suite
Hummingbird BI/Suite is a fully integrated, scalable business intelligence
solution that allows users to better understand their business by asking
questions about information in the corporate database, analyze the
answers for more effective decision-making, present that information in
reports, and distribute it in a variety of ways, including over the World
Wide Web.
Welcome to BI/Query 9
Hummingbird BI/Broker
Hummingbird BI/Web
Hummingbird BI/Query
10 Welcome to BI/Query
The BI/Query product line consists of four separate applications:
Hummingbird BI/Analyze
Welcome to BI/Query 11
Contacting Hummingbird Sales
Regional sales offices are located worldwide. For a current list of
contacts and phone numbers, contact Hummingbird Sales at:
Fax +1-416-496-2207
E-mail getinfo@hummingbird.com
Web www.hummingbird.com
12 Welcome to BI/Query
Basic Concepts
Data object
Relationship
A data model includes data objects and the relationships between them.
Data Objects
Data objects are rectangular or graphical icons that represent tables in the
database. Each data object includes categories of information found in
that table. For example, a Retailers data object might represent a table
that contains such categories as the retailer’s name, city, country, and
credit limit. These information categories are called attributes.
Basic Concepts 15
Attributes
You specify the categories of information you want from the database
by selecting attributes in a window that opens from the data object.
Relationships
If you want a data The lines connecting the data objects indicate relationships among data
model to display objects. Data objects connected by a relationship have at least one
diamond relation-
category in common. For instance, the relationship between a
ship icons, choose
Tools>Preferences, then Regional Offices data object and a Staff data object might be that both
select Show Relationships. If contain an “office name” category. Relationships may be shown with a
you want it to display rela- diamond icon and a name as well as a line.
tionship names as well, also
select Show Relationship Data objects can have more than one relationship, so that you can get
Names.
different information using the same data objects. In the example
below, you could use the works in relationship to find information
about an employee who works in a particular department; you could
also use the managed by relationship to find information about an
employee who manages a particular department.
16 Basic Concepts
Building Queries
In order to retrieve information using the data objects and relationships
in a data model, you must first frame a question, called a query.
To build a query, you need to know the kind of information you want.
For instance, do you want information about products sold or about
the people who sold the products? Are you trying to find out about
receivables or about credit limits? You also must decide what portion of
the available information you want. Do you want sales figures for this
year only, or the last ten years, or just the current quarter? Do you want
receivables for all retailers, or just for those in, say, Japan?
Once you frame the question, you can begin to build the query. The
first step is selecting attributes from at least one data object. For some
queries, that may be all you need to do. For most, however, you will
go on to qualify, or restrict, the query in various ways in order to see
just the information that interests you.
Basic Concepts 17
Selected attributes specify what to Qualified attributes filter
retrieve from the database the information
You may also want to refine the query in other ways. Once you’ve
built it, you can submit it to the database or save it for later use.
Buttons
Data models may contain buttons to automate processes including
querying. You can create your own buttons to run queries. (See the
BI/Query Data Models Guide.)
18 Basic Concepts
Getting Started
Installing BI/Query 21
Starting BI/Query 21
Finding the Administrator Layer in a Split
Data Model 23
Connecting 24
Using a Default Connection File 25
Using Another Connection File 25
Entering Additional Information 26
Disconnecting 26
Getting Started
This chapter describes how to start BI/Query, open a data model, and
connect to the DBMS.
Installing BI/Query
For installation instructions, see the BI/Query Installation Guide.
Starting BI/Query
BI/Query consists of three applications: User, Update, and Admin.
When you start BI/Query, the BI/Broker Login dialog box may
appear. This indicates that your corporate querying environment
includes a central storehouse for data models, queries, results, and
reports called the BI/Broker Repository. You can log in to use the
repository, or you can work offline.
If you log in, you can publish data models, queries, and reports to the
repository, set permissions on them, and retrieve them. You can also
schedule queries and reports. (For more information, see the BI/Broker
Publishing and Scheduling Guide.) If you work offline, you don’t have
access to the repository. It doesn’t affect your ability to connect to the
database; you can still submit queries and work with the results.
To start BI/Query
1 Choose Start>Programs>Hummingbird BI Suite>BI-Query User
(or BI-Query Update or BI-Query Admin).
2 If the BI/Broker Login dialog box appears, to log in to the
repository, type your user name and password. If the Domain text
box appears and is enabled, type your domain name into it. (If
you’re unsure what information to provide in this dialog box, check
with your administrator.) Click OK.
OR
Getting Started 21
If you need to To work without access to the repository, click Work Offline.
publish, retrieve,
schedule, or set
permissions on
your work, you can log in to
the repository at any time.
Choose File>Work Online.
3 In the Welcome to BI/Query window, click the icon for the type
of data model you want to open. (The Repository Data Model
option is available only if you’ve logged in to the repository. The
New Data Model option is available only in BI/Query Admin.)
4 To open a data model you recently used, click Recent Data Model.
In the Recent Models dialog box, select the data model.
22 Getting Started
5 To open a data model stored on your computer or local network,
click Local Data Model. In the Open Data Model dialog box, open
the data model. (If a message appears, stating that a newer version of
the data model exists either in the repository or in the database,
click Yes to open the newer version.)
Getting Started 23
If you can’t select No matter which BI/Query application you use, if you open a split
a button or orna- data model, it’s the user-layer file that opens. The user-layer file contains
ment in Design
Mode using a path to the administrator-layer file, which allows BI/Query to
BI/Query User or BI/Query combine the two layers. Having two layers allows users to make
Update, it’s because you’re customizations to individual versions of the model without changing
using a split data model and
the core model.
the object is stored in the
administrator layer. Users can
However, if the administrator-layer file has been moved or renamed,
select and modify only ele-
ments in the user layer. Any the link between it and the user-layer file will be broken. If that
item in a dialog box that has a happens, when you open a split data model, BI/Query can’t find the
lock icon beside it was created administrator layer and displays a message. You need to locate the file,
by the administrator and also
then save the data model to save the link to the new location.
can’t be modified by the user.
Connecting
Before it queries the database, BI/Query must connect to the database
management system (DBMS). To do this, it uses a connection file that
contains information for that particular connection type. Typically, the
person who creates a data model includes at least one connection file
with it and sets it up to automatically connect to the DBMS each time
you open it or each time you submit a query.
24 Getting Started
If the data model doesn’t have a connection file associated with it, you
need to see the person who created it for information on obtaining
one. (You can also create your own connection files. See the BI/Query
Data Models Guide.)
3 Click Connect.
Getting Started 25
Entering Additional Information
If you need to supply any information that isn’t included in the
connection file, such as a password or user ID, you’re prompted for it
when you connect. If you’re unsure what information to supply, check
with your administrator.
Disconnecting
When you no longer need access to the DBMS, it’s good practice to
disconnect from it to reduce the load on the database server.
26 Getting Started
Building Queries
Apply a function to
an attribute or
Group or sort results
create your own
calculation.
Building Queries 29
Once you’ve built the query you want, you can submit it to the DBMS
right away and save it for later use by yourself and others.
Selecting Attributes
You specify the categories of information you want from the database
by selecting attributes in a data object. (See “Data Objects” on
page 15.) The selected attributes appear as column headings when your
query brings back the information. As soon as you select one attribute,
you have built a query. It is up to you to decide how much more you
want your query to include.
For example, if you select the Name attribute in a Retailers data object
and then submit the query to the database, it brings back the names of
all the retailers in the database table, in a column labeled Name. If you
also select the City attribute in the same data object and submit the
query, it brings back the retailers’ names, in a column labeled Name,
and the city in which each is located, in another column labeled City.
You can select as many attributes as you like in each data object. And
you can select attributes from as many data objects as you like within
one data model window. (If your data model has data objects in more
than one window, you can build separate queries in each window, then
use one of several methods for combining them. See “Combining
Queries” on page 129.)
To select attributes
1 Open a data model.
2 Double-click a data object for which you want to retrieve
information.
30 Building Queries
Double-click a data object to view its attributes
Building Queries 31
Qualifying Queries
In addition to using attributes to specify the categories of information
you want from the database, you can use attributes to place limits on
the amount of information that you receive. The process of limiting the
information this way is called qualifying the query.
When you submit this query, it brings back from the database a list of
the names and cities of those retailers who operate in France.
Data values
icon
Attribute Operator Qualification List
list text box icon
Condition box
32 Building Queries
Qualification Text Box
You can enter one or more items into the qualification text box to qualify If your database is
an attribute. For example, by qualifying the Country attribute with case-sensitive and
the Case-sensitive
France, Germany, and Spain, you can restrict the results to retailers
Comparisons
located in France, Germany, and Spain. You can type the values you preference is set, when you
want. To enter more than one value by typing, press the Down Arrow type a qualification, the char-
after each. Alternatively, click the list icon, then choose New Entry (see acters must be in the case in
which they are stored in the
“List Icon” on page 33). You can also select the values from a data database. If this preference
values list. (See “Data Values Icon” on page 34.) isn’t set, case isn’t important.
List Icon
You can use the list icon beside the qualification text box to add and
modify entries in a list of qualification values or to delete all entries.
Values that you enter in the qualification text box are displayed in a list
when you click the list icon. By clicking a value in the list, you can
display that value in the qualification text box. Alternatively, use the
Building Queries 33
Up or Down arrow keys on your keyboard to display each value in the
qualification text box.
List icon
The data values icon appears beside the list icon. It provides an easy
means of inserting one or more specific values (data values), prompts,
or variables into a qualification. Prompts prompt you for one or more
data values, while variables perform a user-defined operation. (See
“Using the Data Values Icon” on page 35.)
Operator List
Use the operator list in the qualification tree to specify the type of
restriction you want. For example, you can apply the Greater Than (>)
operator to find all the records that have a value greater than the
qualification you specified. (See “Restricting Qualifications with
Operators” on page 42.)
34 Building Queries
Operator list
Condition Box
Building Queries 35
text box or you can select them from a list using the Data Values icon
(or choosing Edit>Data Values). Selecting from a list of data values
avoids potential uncertainty about what values actually exist in the
database and about capitalization and spelling.
Unless the designer of the data model has disabled data values, clicking
the data values icon, then choosing Data Values, submits a default query
which retrieves all the unique values in the database for that attribute.
The values are displayed in the Data Values dialog box, where you can
select the one(s) you want to enter into a qualification.
If data values for an attribute haven’t been disabled, clicking the data values icon and
choosing Data Values displays all the values for the attribute stored in the database.
Alternatively, users may choose to substitute data values lists for the
default data values query.
In this qualification tree, clicking the Data Values icon displays a list of values.
36 Building Queries
If data values haven’t been disabled for an attribute, you can access all
the data values in the database instead of just those provided by the data
values list by choosing more from the list, then clicking Load All in the
Data Values dialog box. (For more detailed information on creating and
using data values lists, see “Data Values Files” on page 83.)
Prompts
Building Queries 37
When a query You can build a query with multiple prompts, allowing users of the
prompts you for query to quickly zoom in on increasingly detailed information when
one or more val-
ues, you can insert they submit the query. For more detailed information on creating and
them, or you can leave the using prompts, see “Prompts” on page 96.
prompt blank. (Leaving it
blank returns all of the possi- To qualify an attribute with a prompt
ble values for the attribute.)
To view the query’s SQL, in 1 In an attribute window, click the Qualify box for an attribute.
the attribute window, choose 2 With the cursor in the qualification text box, click the data values
Query>Show, then click icon, then select Prompts from the list.
Show Prompt Values. If you
specified prompt values, 3 In the Prompts dialog box, select a prompt. (If the prompt you
they’re displayed in the SQL. want isn’t listed, you can create it. See “Creating Single Prompts”
If you didn’t, the prompt on page 97.)
qualification is removed from
the WHERE clause to reflect
the actual query that will be
submitted to the DBMS.
Variables
You can also qualify a query with a variable that silently performs an
operation you define and supplies the result as the qualification. For
instance, you might want a query to provide information for the
current date only. You can qualify the query with a variable that
38 Building Queries
determines the date at the time the query is being submitted and uses
that date to restrict the information that is returned from the database.
That way, there’s no need to prompt the person submitting the query
for today’s date. (For more detailed information on creating and using
variables, see “Variables” on page 107.)
Reversing Qualifications
When you want to exclude certain information from a query, or when
it’s easier to specify the information you don’t want rather than the
information you do (for example, all retailers except those in
Building Queries 39
Germany), you can qualify the query to have the opposite meaning to
the condition specified.
To reverse a qualification
When you reverse 1 In an attribute window, click the condition box above a
a qualification, the qualification.
word not appears
in front of the 2 Choose Query>Qualification>Negate Clause.
condition box. If you change
your mind about the restric-
tion, click the word not to
remove it.
40 Building Queries
OR
To have the query satisfy either qualification, click the word and to
change it to or.
Combining Qualifications
When you’ve specified two or more qualifications in a query, you can
combine them so that they take precedence over those that aren’t
combined. For example, the qualification Country = France and
Country = Germany and Credit Limit < 60,000 is ambiguous. It’s
unclear whether its purpose is to produce a) retailers located in France
or Germany, all with a credit limit of under $60,000, or b) retailers
located in Germany with a credit limit of under $60,000 plus retailers
located in France. To avoid ambiguity, you can combine this query to
read: (Country = France or Country = Germany) and Credit Limit <
60,000; the results will consist of all retailers located in France or
Germany, all of whom have a credit limit of under $60,000.
Combining qualifications in this way is the equivalent of using brackets
in a mathematical expression — for example, 2 x (3-1) — to indicate
the part of the expression that should be calculated first.
Building Queries 41
To combine qualifications
1 In an attribute window, select the condition boxes above the
qualifications you want to combine.
2 Choose Query>Qualification>Combine.
When a qualifica- 3 To change the condition from and to or, click the word and.
tion is combined,
you can separate
it. Click the con-
dition box above it, then
choose Query>Qualifica-
tion>Uncombine.
42 Building Queries
match the qualification(s) you specify. For example, by setting the
Country attribute equal to Spain, the results include only retailers
located in Spain.
Using the operator list in the qualification tree, you can apply other
operators to restrict a qualification. Keep in mind that the >, >=, <,
and <= operators allow you to insert a single value when you submit
the query; the BETWEEN and NOT BETWEEN operators require
two values (for an upper and lower range); the =, IN, NOT IN, and
<> operators allow you to insert one or more values.
Operator list
Making Comparisons
When you need to compare values to find, for example, those that are
larger or smaller, earlier or later in the alphabet, or equal to a value, you
can specify the value on which you want to base the comparison in the
qualification text box and apply the appropriate comparison operator.
While comparisons are typically applied to numbers, they can also be
applied to characters and dates. With characters and dates, < means
earlier in the alphabet or in chronological order; > means later.
Building Queries 43
This Qualification Results in This
Credit Limit <= 2,000 Credit limits less than or equal to 2,000.
You may not be sure how an item is stored in the database, or you may
want to find records for which there is some kind of pattern. For
example, you may need information about a retailer and aren’t sure of
the spelling of the name but know that it begins with Cars. (Is it
Carson, Carsen, Carsin?) Similarly, you may need a list of retailers
whose postal code is 3011.
You can specify the characters you want to match in the qualification
text box and apply the Begins with, Contains, or Ends with operator.
When you submit the query, BI/Query looks for all instances of values
that match the qualification you specified. You can also type the %
symbol into the qualification text box to find a match for any string of
characters, regardless of where it falls.
The Does not begin with, Does not contain, and Does not end with operators
function in the same way as their counterparts but allow you to find
items that don’t contain the character string you specify. For example,
you can use them to find retailers whose postal code isn’t 3011.
You can apply these operators to character strings, not numbers or dates.
44 Building Queries
This Qualification Results in This
Zip/Postal code Does not All Zip and postal codes except those
end with 3011 ending with 3011.
Building Queries 45
enter the values as a qualification list (see “List Icon” on page 33) and
apply the BETWEEN operator. You can also find results that are
outside a particular range by applying NOT BETWEEN. If you qualify a
character field, be sure you use the case in which the value is stored in the
database.
A NULL value occurs when no value has been entered into the
database. It doesn’t represent a zero or a character space but is instead a
placeholder for missing information. Because NULLs don’t match
anything, you can’t retrieve them using standard comparison
qualifications such as Greater Than or Less Than. To include or
exclude rows for which information hasn’t been recorded, apply the IS
NULL or IS NOT NULL operator to an attribute.
46 Building Queries
your DBMS (database management system) supports. (For information
about the operators your DBMS supports, see the documentation for
your DBMS.)
3 Click OK.
Performing Calculations
You can use queries to perform basic calculations such as summing or
averaging results by applying a function to an attribute. You can also
carry out more sophisticated calculations by applying a user-defined
calculation to an attribute.
Building Queries 47
Grouping organizes the data into sets and retrieves a summary value for
each set. All selected attributes to which functions haven’t been applied
are grouped to ensure that the results set doesn’t calculate a summary
value for individual members of the group. (To group attributes
without applying functions, see “Grouping without Functions” on
page 54.) The following example shows how grouping works with
aggregate functions.
Suppose the database contains the following data about retailer sales:
If you want to retrieve a list of retailers, cities, and total retailer sales,
you might formulate a query in which you select the Name, City, and
Invoice Amount attributes (in that order) and apply the SUM function
to Invoice Amount. When you submit the query, the DBMS organizes
the data into groups (first by Name, then by City). Each row of results
in a group has identical values except the attribute to which the
function is applied.
The table below shows how the DBMS groups the data. The rows for
Billings, Toronto, represent one group, the row for Saddler, Toronto,
represents another group, and so on.
48 Building Queries
Name City Invoice Amount
The DBMS then applies the sum to each group. For most DBMSs,
when the results are displayed, each group is organized alphabetically,
numerically, or chronologically. The table below shows how BI/Query
displays the results. Groups are organized first alphabetically by name,
then alphabetically by city for retailers with the same name (such as
Triteck) but located in different cities.
Building Queries 49
Specifying Functions
You can choose from a wide range of functions to calculate the results
you want.
50 Building Queries
Apply This Function To Do This
Whenever you select more than one attribute for a query and then
either apply an aggregate function to at least one attribute or group at
least one attribute (see “Grouping without Functions” on page 54), the
Building Queries 51
When you group remaining attributes must also be grouped. BI/Query automatically
attributes, you can groups attributes in the order in which you selected them. You can
include a column
change the group order by clicking the Group boxes in the attribute
that counts the
number of rows in each window. For example, if you select the Name, City, and Invoice
group. Choose Query> Amount attributes (in that order), apply the SUM function to Invoice
Modifiers>Count All. Amount, and then run the query, BI/Query will group the Name
attribute first, then the City attribute. The results are grouped first by
Name of retailer.
If you click the Group box for City for the same query, a “1” appears
in the Group box to indicate that this attribute will be grouped first.
When you submit the query, it retrieves the names and cities of retailers
along with their total sales, as before, but now the total sales are
grouped first by city, then by retailer name.
If you look at the attribute window, you’ll see that “2” appears in the
Group box for the Name attribute and “3” in the Group box for the
Invoice Amount attribute. BI/Query has automatically grouped the
remaining attributes in the order in which you originally selected them.
52 Building Queries
Grouping before Calculating a Function
When you apply a function to an attribute, you can qualify the attribute
in the qualification tree in order to group results before calculating the WHERE Clause
When you group results
function. (See “Qualifying Queries” on page 32.) For example, in before calculating the
order to retrieve retailers’ largest sales, you might include the Retailer function, the SQL for the
Name and Invoice Amount attributes, qualify Invoice Amount to be query contains a WHERE
clause.
greater than $50,000, and apply the SUM function to it.
When you submit this query, BI/Query eliminates the records that
don’t meet the criteria you specified, groups the results, and calculates
the sum for each group. That is, it finds all sales that are greater than
$50,000, groups them by retailer name, then sums them.
When you apply a function to an attribute, you can qualify the attribute
HAVING Clause
with a group qualification in order to group results after calculating the
When you group results
function. The qualification is applied to the entire query, after all after calculating the func-
aggregate functions have been calculated (including any calculated tion, the SQL for the
attributes that are treated as aggregates) and the appropriate attributes query contains a HAV-
ING clause.
have been grouped. For example, instead of finding retailers’ largest
sales, you can find the largest retailers by summing all sales by retailer
first, then eliminating the sums that don’t meet your criteria. (For
information about calculated attributes, see “Creating Attributes That
Perform Calculations” on page 55.)
Building Queries 53
This list displays the Count function,
all columns to which an aggregate
function has been applied, and any
calculated attributes that are
treated as aggregates.
The SUM function for the Invoice Amount attribute is qualified with >50000 to
retrieve a list of total sales greater than $50,000.
Grouping is most often used with functions. But you can group
attributes without applying functions. In this case, grouping is similar to
using the Modifier>Distinct command to eliminate duplicates. It
divides a table into groups and returns one row for each group. For
example, a query in which the Country attribute is selected retrieves all
countries in the Retailers table.
54 Building Queries
SQL for the Query Results
If you group by Country, the results display one row for each group.
(Depending upon the DBMS, the results may be sorted alphabetically.
Building Queries 55
To create an attribute that performs a calculation
You can easily 1 In an attribute window, click the attributes you want.
edit and delete the
2 Click the Function box for the attribute below which you want to
calculated
add the calculated attribute, then select Calculation from the list.
attributes you cre-
ate. Click the Function box in 3 In the Edit Computed Attribute dialog box, type a name for the
the attribute window, then attribute into the Name text box.
select Edit Calculation or
4 In the Expression text box, specify a calculation. (Type it in or use
Delete Calculation from the
list. the keypad. Add a space between each item.)
The Profit attribute calculates Unit Price minus Unit Cost to give profit per product.
56 Building Queries
Choosing a Function
The Insert Function dialog
box displays a list of built-
in functions. For certain
DBMSs, a list of scalar func-
tions appears under Other
Functions. (A scalar func-
tion takes a predefined
number of parameters —
usually one or two — and
produces a value for each
result in turn. Aggregate
functions are often used
with a group by clause; sca-
lar functions aren’t.)
You can use most scalar
functions available in your
DBMS even if they don’t
appear under Other Func-
tions. Type the function
into the Expression text
box. (Check your DBMS
documentation for the
correct format.)
The Average Profit attribute calculates the average profit made on each product.
8 To specify a data type for the calculated attribute and whether it’s
numeric or character, click Data Type, then use the Choose Data
Type dialog box to specify the information.
Building Queries 57
Ordering Query Results
You can edit any In addition to selecting attributes, qualifying the query, and using the
operations that query to apply functions or your own calculations, you can group and
you perform on
query results
sort the information.
(including ordering columns
and sorting rows) from the
Super Query window. See Ordering Columns
“Editing an Operation” on
page 139. When the results of a query are returned, columns are displayed in the
order in which you selected the corresponding attributes in the
attribute window. For example, say that you select first the Name and
then the City attribute in a Retailers data object, then submit the
query. The results look like this:
You can order the columns so that City comes first, then Name. The
results look like this:
You can change the column order before you submit the query or after
you have results. When you change the order before submitting the
query, the DBMS does the ordering. You place fewer demands on the
DBMS by changing the order in the results, since BI/Query does the
58 Building Queries
reordering. However, if you change the column order in the results,
you can’t save the query as a data values query file (see “Creating Data
Values Query Files” on page 90) and you can’t save the SQL for the
query as a text file (see “Saving Results to a File” on page 157.)
3 Click OK.
Building Queries 59
3 Click OK.
Sorting Rows
When you submit a query, the rows of results are displayed as the
DBMS returns them from the database, unless you specify a different
way of sorting them. For example, suppose that you select the Name
and City attributes in a Retailers data object, then submit the query.
The first ten rows of results as they come back from the database look
like this:
If you sort the rows alphabetically by Name, the first ten rows look like
this:
60 Building Queries
If you choose to sort the rows by City, the results look like this:
The quick way to sort attributes while building the query is to use the
Sort boxes in the attribute window. Query results will be sorted first by
the data returned for the attribute with 1 in its Sort box, then by the
data returned for the attribute with 2 in its Sort box, and so on.
For example, suppose that you select the Name and Credit Limit
attributes in a Retailers data object, then click the Sort boxes for Credit
Limit and Name, in that order. When you submit the query, the results
are sorted numerically by credit limit first, then alphabetically by name.
Building Queries 61
You can sort attributes from more than one attribute window or in
reverse order; you can also sort the results after you’ve submitted the
query. (See “Sort Order Dialog Box” on page 63.)
The number 1 in the Sort box for Credit Limit indicates that the rows will be sorted by
credit limit first; the number 2 in the Sort box for Name indicates that the rows will be
sorted by Name second.
62 Building Queries
Sort Order Dialog Box
Using the Sort Order dialog box, you can specify a sort order before
you submit the query or after you have results. When you specify the
sort order before submitting the query, the DBMS does the sorting.
You place fewer demands on the DBMS by specifying the sort order in
the results, since BI/Query sorts the results. However, if you specify
the sort order in the results, you can’t save the query as a data values
query file (see “Creating Data Values Query Files” on page 90) and you
can’t save the SQL for the query as a text file (see “Saving Results to a
File” on page 157.)
3 To determine the order, under Sort Order, select columns and click
First, Last, Up, or Down.
4 To specify reverse order, click the column, then click Descending.
5 Click OK.
Building Queries 63
Submitting Queries
Once you’ve built a query, you can submit it to the database. The
results of the query are displayed in a separate window.
You can build your entire query and then submit it. Or you can specify
some initial qualifications, submit the query, review the results, and
then revise the query to retrieve exactly the set of results you want.
Saving Queries
It’s good practice to save any query that you want to use more than
once so that you don’t have to rebuild it each time. Once a query is
saved, it can be:
64 Building Queries
• automated by being linked to a button
• stored with the data model in the database
To save queries, you must have the Save Queries permission. You can
save a query to make it available in BI/Query. You can also save the
corresponding SQL string to make it available to other applications (see
“Exporting Queries” on page 155), provided that your query doesn’t
require manipulation of the results set (see “Ordering Query Results”
on page 58 and “Combining Queries” on page 129).
Saving a query in a results window saves the query that generated the
results. Saving in any other window saves the current query.
BI/Query saves queries with the extension .qry and stores them in the
Queries folder by default, but you can also store them elsewhere. Data
values queries are saved in the DataVals folder. (See “Creating Data
Values Query Files” on page 90.)
To save a query
1 Make sure you have the Save Queries permission.
2 Build a query. (You can submit the query before or after saving it.)
3 Choose Query>Save.
4 In the Save Query dialog box, specify a file name.
Building Queries 65
5 To save the query in a location other than the Queries folder, click
Export and specify the name and location of the file.
6 Click Save.
Loading Queries
You can load and submit queries that you’ve saved as well as queries
that have been stored with the data model.
66 Building Queries
3 To submit the query without first displaying it, click Submit.
OR
To display the query, click Load.
Saving Results
You can save query results to a file in order to use them again in
BI/Query or to use them in other applications, such as word processors
and spreadsheet programs.
BI/Query saves results as two separate files with the extensions .qrd and
.qrr. The .qrd file contains the results stored in text format so that other
applications can open them. (BI/Query automatically supplies the .qrd
extension when you save results.) The .qrr file stores additional
Building Queries 67
information that BI/Query needs to open the results file (such as
formats for each column and the SQL used to retrieve the results).
When you load results in BI/Query, you see only the .qrd file. If you
need to delete a results file, delete both the .qrd and .qrr files.
The results are stored on your computer so that you can manipulate
them locally instead of in the database, thereby reducing the demands
on the server.
To save results
1 In the results window, choose Results>Save As>Results.
OR
To submit results directly to a file, choose Query>Submit
Query...>To File.
2 In the Save Query Result to File dialog box, specify the name and
location of the file, then click Save.
68 Building Queries
Formatting Data
Entering Data 71
Default Format 71
Matching Display Formatting 71
Numbers 72
Dates 73
Invalid Entries 73
Converting Two-digit Years 73
Choosing a Date Range 74
Choosing a Date Range Type 74
Displaying Data 75
Formatting Numbers 76
Formatting Dates 77
Inserting and Deleting Characters 77
Substituting Values 78
Formatting Data
Data formats govern how you enter numbers, dates, and text characters You specify data
and how these are displayed in query results. For example, numbers can formats for reports
in BI/Query
be represented as 99999, 99,9999, and 99.999, and dates can be
Reports. (See the
represented as 1/14/1998, 1998.1.14, and January 14, 1998. BI/Query BI/Query Reports Guide.)
lets you specify different formats for different purposes.
Entering Data
The format in which you type dates and numbers in query
qualifications, prompts, and variables is the data-entry format.
Default Format
The default data-entry format is normally based on the Control Panel
settings on your computer. Any changes you make to these settings
take effect immediately.
Formatting Data 71
page 75.) Using the results display format rather than the default data-
entry format is useful when you want to display an integer (such as
2017434411) as a phone number (201-743-4411) or when a currency
is specified as a number and you want the data to appear with the
currency symbol. (You can’t change the data-entry format for character
data types.)
Avoid using an attribute format for numbers and dates that “hides”
information. For example, with a format such as MMM/D, if you type
Sept 15, 2001 into a qualification, BI/Query inserts Sept 15, 2001 into
the SQL for the query, but displays Sep 15 in the qualification tree. If
you change the value to Sept 25, BI/Query interprets your change as
being a complete value (Sep 25, not Sept 25, 2001). The “hidden” year
is lost, and the query retrieves unnecessary or incorrect data.
BI/Query hides the year when the attribute uses a “hidden” format.
BI/Query is flexible in recognizing the data you type. You can use the
format specified in the Control Panel or a comparable one. If
BI/Query is able to interpret the format, it automatically converts it to
the default data-entry format.
Numbers
You can type numbers (including currencies) without formatting them.
BI/Query converts them to the format you’ve specified.
72 Formatting Data
Dates
You can type dates using any format comparable to the one you’ve To ensure that
specified. For example, if the date format you’ve specified is BI/Query inter-
prets dates cor-
1/14/2001, you can type dates in the format 2001.1.14, 1.14.2001,
rectly, make sure
January 14, 2001, or even 2001 Jan 14. As long as you include the day, that you type dates using all
month, and year and BI/Query is able to unambiguously interpret the four digits of the year.
format, it converts the date to the specified format.
Invalid Entries
BI/Query alerts you when you type data in a format it can’t interpret.
To return to the entry and correct it, click Cancel in the alert window.
(If you’re not sure what format to use, check the Regional Settings in
your Control Panel.) If you want BI/Query to accept the entry you
typed, click Add { }; your entry appears within the brackets. When
you submit a query, BI/Query enters the entry as straight text into the
SQL string. This is an escape mechanism designed for users with
advanced knowledge of SQL database access.
Formatting Data 73
Choosing a Date Range
If you change the To enable BI/Query to convert two-digit years correctly, you must
date window after first specify the start day for a 99-year range of dates in your data. For
typing two-digit
instance, if you know that you won’t need to enter dates earlier than
years, the new
date window doesn’t apply to 1930, you can specify a range that begins with 1930. BI/Query
the dates you’ve already automatically ends the range with 2029. For this range, whenever you
entered. enter or import a two-digit number greater than or equal to 30 (from
30 to 99), BI/Query converts it to a four-digit number that begins with
19. For instance, when you type 45, it’s converted to 1945. Whenever
you enter or import a two-digit number less than or equal to 29 (from
00 to 29), BI/Query converts it to a four-digit number that begins with
20. For instance, when you type 15, it’s converted to 2015.
Once you’ve selected a range, then you need to establish whether it’s a
sliding or fixed range.
The start and end years of a sliding range are incremented by one each
time the current year changes. For example, a range of 1930 to 2029
chosen in the year 1999 becomes, in the year 2000, a range of 1931 to
2030. If in the year 2000 you will no longer need to enter the two-digit
year 30 as 1930 and will want instead to enter it as 2030, you can use
the sliding range.
The start and end years of fixed ranges don’t change. If, for example,
you choose a range of 1930 to 2029 as a fixed range, BI/Query will
always accept the two-digit year 30 as 1930 and the two-digit year 29
as 2029, no matter in what year you enter them.
The type of date range you specify in one product applies to all
Hummingbird Business Intelligence products.
74 Formatting Data
3 Click Sliding or Fixed.
4 Click OK.
Displaying Data
When results are returned from the database, the format in which To view an
they’re displayed (the display format) may not be how you want them attribute’s default
display format,
represented in the results window. BI/Query offers a wide range of click the question
display formats for formatting columns of data. You can change the mark beside the attribute in
default display format for each attribute in an attribute window, and the attribute window.
save those changes if you have permission to save the data model. (For
information on saving a data model, see the BI/Query Data Models
Guide.) Or, after results are returned, you can specify a display format
from the results window. If you save the results set, the formats you
specify in the results window are saved with it.
You may need to change the display format for a particular set of
results. Whether you select a single cell or an entire column, the
formatting is applied to all the results in the column.
Formatting Data 75
3 Click OK.
Formatting Numbers
You can select from a number of predefined formats for numeric data.
You can also modify one of these formats by including, for example, a
dollar sign or percent symbol as a prefix or suffix. You can also
highlight negative values in red, hide zero values, and display values in
exponent notation.
To format numbers
1 In the Specify Display Format dialog box, click Numeric.
76 Formatting Data
Formatting Dates
You can select from a number of predefined formats for dates, and you
can include the time.
To format dates
1 In the Specify Display Format dialog box, click Date.
Formatting Data 77
2 Type a format into the Format String text box using the following
special characters:
# inserts a character from the original data
_ suppresses a character in the original data
* inserts the remaining characters in the original data
\ inserts the next character(s) you type; use it to include one of the
special characters (for example, to insert the # character, type \#)
3 Click OK.
Substituting Values
You can substitute values in a results column to highlight trends, focus
on general information rather than specific details, and flag exceptions.
For example, it may be useful to assign a single value (the word
Unsatisfactory) to a range of values (all sales below a certain amount) so
that you can easily identify areas that require further attention. You can
also apply a color for emphasis in any corresponding reports. (The color
is displayed only in standard reports, not reports created using
BI/Query Reports.)
78 Formatting Data
2 Select an operator from the list beside the Comparison Value text To insert a row,
box. place the cursor in
the row below
3 Type the value you want to replace into the Comparison Value text which you want
box. to insert the row, then click
4 To change the value, type a new value into the corresponding Insert Row. To delete a row
Replacement Value text box. you’ve specified, choose the
first (blank) item from that
5 To specify more than five sets of values, use the scroll bar to display row’s operator list.
more blank rows.
6 To specify a color for the new value in the corresponding standard
report, click the color button and specify a color.
7 Click OK.
Formatting Data 79
Data Values Files, Prompts, and Variables
Before you submit the query, you can insert one or more data values
into a qualification, either by typing them or by choosing them from a
list. Lists of data values are provided by data values files.
You can also build a query that you qualify using one or more prompts,
and then save the query for later use. Whenever you submit such a
query, you’re prompted to insert the data values to be used in the
qualification. Depending on what values you choose to insert when
prompted, the same query can be used to retrieve different subsets of
data. You can type data values in response to a prompt, but prompts
can also have data values lists associated with them. And you can
combine data values files and prompts so that you can insert values into
one prompt that are based on values you inserted into another.
You can also build a query that you qualify using variables and then save
the query for later use. Whenever you submit such a query, the variable
runs automatically, performs pre-defined operations, and supplies the
resulting data value(s) for the qualification. You can include prompts in
variables and you can include one variable in another.
There are two kinds of data values files. Data values query files query the
database and retrieve a subset of values to create the list; data values
results files display a stored set of values. Data values query files provide
the most accurate lists; the first time you use them in a session, they
query the database to supply the values. Data values results files are
produced by storing the results of a query or, sometimes, produced
manually. BI/Query doesn’t update the lists corresponding to them.
Results files reduce the load on the database server because they
eliminate the need to query the database.
A data values file contains a subset of all of the possible values in the
database. These values appear as a list when you click the Data Values
icon (see “Data Values Icon” on page 34). If no data values file is
available for a particular attribute, when you click the Data Values icon
and choose Data Values, BI/Query runs the default query and retrieves
all of the values.
The Data Values dialog box displays no values when the administrator has disabled the
default data values query.
How data values files are named determines which file BI/Query uses
and whether it’s used in a qualification or a prompt.
Data values query and results files are stored in the DataVals folder. The
file names you give these files determine the order in which BI/Query
selects the files in the DataVals folder as well as whether the
corresponding data values are available in a qualification or in a prompt.
The following table shows the order in which BI/Query uses data
values files, their names, and where they’re used.
If none of these data values files is found, BI/Query uses a default query to supply the
data values in the database (unless the administrator has disabled the default query).
When you click the data values icon in a prompt dialog box in order to
display a list of data values that can be used in the prompt, BI/Query
checks to see if there’s a data values file with the same name as the
prompt. If there is, BI/Query uses it; otherwise, it checks to see if there
is a data values file named after the data object and attribute used in the
query. If there is, BI/Query uses it.
If BI/Query doesn’t find a data values file, and if data values for an
attribute haven’t been disabled, BI/Query runs a default query that
retrieves all the unique values in the database for the attribute and
displays the results in a list.
If data values haven’t been disabled for an attribute, you can access all Creating data val-
the data values in the database instead of just those in the data values ues results files is
useful when the
results file. Select more from the data values list, then in the Data Values data changes
dialog box, click Load All. infrequently. If a file needs to
be updated often, create a data
You can create a data values results file from results you’ve retrieved in values query file instead. (See
BI/Query as well as by using a text editor or spreadsheet program. “Creating Data Values Query
Files” on page 90.)
In BI/Query
You can use any text editor or spreadsheet program to create a data
values results file that contains a set of customized data values. To do so,
create a data values results file first; it will serve as a template for the
customized data values. This is necessary because BI/Query stores data
values results files in two separate files: the .qrd file, which stores results
in text format, and the .qrr file, which stores additional information that
the application needs to read the text file. Without the .qrr file,
BI/Query can’t open the .qrd file. Once you create these files, you’ll
replace the data values in the .qrd file with the customized data values.
When you type values into the text editor or spreadsheet program, type
them in the order and case you want them to appear in BI/Query,
pressing Enter after each value.
7 Click OK.
8 In the results window, choose Results>Save As>Data Values.
9 In the Data Values dialog box, name the file. (See “Naming and
Storing Data Values Files” on page 85.)
10 Click OK.
11 In a text editor or spreadsheet program, open the .qrd file you
created, modify it, and save it under the same name.
Or, type a list of values in a new document file, pressing Enter after
each one, then save the file using the same path and file name as the
.qrd file.
12 To test the file in BI/Query, click the attribute used to create the
original results, click its Qualify box, then click the data values icon
in the qualification tree.
Qualification prompt
dialog box
If data values haven’t been disabled for an attribute, you can access all
the data values in the database instead of just those returned by the data
values query by clicking Load All.
Just as with data values results files, when you create a data values query
file, you’ll want to eliminate duplicate values from your results. You
can select just the attribute, in order to retrieve all of the values in the
database for that attribute, or you can qualify the attribute to retrieve
only specific values.
To set up data aliasing, you create a data values results file or data values
query file that contains two columns; in the first column are the actual
values, in the second are the aliases. Only the data in the second
column is displayed in the list of data values. Instead of selecting a value
for a qualification that may be difficult to understand or remember,
such as a staff person’s ID number, you’ll be able to select a more
meaningful value, such as the person’s last name. You select the name
from a list of data values and BI/Query inserts the ID number into the
qualification edit box for the query.
When you qualify the ID# attribute, click the data values icon in the
qualification tree, BI/Query displays staff last names as a list.
ID for Peterson
4 Name the file after the first attribute (for example, Staff.ID #).
For tables that contain a large number of rows, prompts improve query
performance and prevent users from submitting queries that retrieve
more data than they need. For example, regional sales managers may
need sales information only for countries in their region. When they
submit queries against the table containing countries, the queries
prompt them to specify the countries they want.
You can submit queries using single prompts, group prompts, which
are made up of a number of individual prompts, and conditional
prompts, in which the data values returned for one prompt are based on
the value you specify for another.
You can type data values into a prompt or insert them from a data
values list. (See “Data Values and Data Values Lists” on page 35.)
5 Click OK.
Group Prompts
A group prompt is made up of two or more single prompts. All the
prompts can have the same group name and be displayed together in
one or more dialog boxes depending on the number of prompts in the
group. For example, a group prompt can be made up of prompts for
the Country and City attributes so that a query that qualifies those
attributes prompts you to select first a country, then one or more cities.
When queries are qualified with more than one prompt, grouping
them in a dialog box allows users to see all the prompts at once and
reduces the number of steps in the query. It also relates one prompt to
another. (See “Conditional Prompts” on page 101.)
The dialog box that displays a group prompt displays the default title
Please Enter Qualification Values. You can create your own title for this
dialog box by creating a prompt that begins a the group name, two
exclamation marks, and Title (for example, Retailer!!Title). You must
use the word Title with a capital T. The prompt string you type
becomes the title.
4 In the Prompt String text box, type a title for the prompt.
5 Click OK.
Conditional Prompts
Conditional prompts are group prompts in which the data values available
for one prompt are determined by the value specified for another. For
example, a prompt for cities provides only those cities located in the
country you specify for the country prompt. You create a conditional
When you select data values from a list instead of typing them into a
prompt, conditional prompts eliminate inappropriate values from the
list and make it easier for you to find the appropriate values.
Conditional prompts are also useful in a data model that doesn’t allow
users to build their own queries, because they provide a means of
drilling down to obtain increasingly detailed information. (See the
BI/Query Data Models Guide.)
Make sure your group prompt prompts you in the order you want. For
example, to ensure that you’re prompted first for a country, then for a
city, name the first prompt Retailer!1Country and the second prompt
Retailer!2City.
Now you create a data values query file that returns unique values for
the attribute that corresponds to the second prompt. Be sure to
eliminate duplicate values from your results.
This query retrieves a list of cities for the country specified for the Retailer!1Country
prompt.
5 Save the query as a data values query file using the name of the
second prompt in the group prompt. (See “Creating Data Values
Query Files” on page 90.)
The Country attribute is qualified by the Retailer!1Country prompt, and the City
attribute is qualified by the Retailer!2City prompt.
Clicking Data Values submits the data values query file (Retailer!2City) and displays
the results in the Data Values dialog box.
9 In the Data Values dialog box, select the value(s) you want.
(Depending on the operator you applied to the qualification, you
can select one or more values.)
10 Click Insert.
Importing Prompts
You can distribute prompts by copying and renaming your Prompts file
(located in the Queries folder); other users can then import the prompts
contained in this file. You can also import prompts stored in someone
else’s Prompts file.
To import prompts
1 Choose Edit>Prompts.
2 In the Prompts dialog box, click Import.
3 In the Select Import File dialog box, select the file that contains the
prompts you want to import, then click Open.
4 In the Import Prompts dialog box, select the prompts you want
under Prompts to Import, then click Import.
Variables
A variable (or automatic variable) is a predefined operation that can be
used to qualify an attribute. (See “Variables” on page 38.) The
operation is performed when you submit the query and the results are
then used to qualify the query. Variables can also be used to qualify data
objects in a data model. (See the BI/Query Data Models Guide.)
Variables are stored in the Prompts file in the Queries folder and
therefore must have names that are different from those given to
prompts. You can import variables stored in another user’s Prompts
file. (See “Importing Variables from a File” on page 116.)
Creating Variables
You can test that When you submit a query qualified with a variable, the variable is
an expression executed as a complete expression — that is, the variable is substituted
returns the results
you want by creat-
for the entire qualification, including the attribute and operator. As a
ing a calculated attribute that result, a variable must contain information about what attribute to
uses the same expression. Use qualify and what operator to use, as well as the operation to be
the attribute in a query, then performed.
verify the results. (For infor-
mation on creating calculated
attributes, see “Creating
Attributes That Perform Cal-
culations” on page 55.)
When the query is submitted, the variable Customers Exceeding Credit is substituted for
the entire qualification shown above. Customers Exceeding Credit performs the
operation retailers.receivable >retailers.credit, substituting “retailers.receivable” for the
attribute Credit Limit and “>” for the operator “=”.
This variable determines today’s date. You can use it to qualify a query for sales at
the end of a quarter rather than qualify the query with a specific date.
A variable that names an attribute and operator will always qualify that
attribute using that operator, even if you insert it into the qualification
of a different attribute in the query. For example, suppose that in a
Retailers data object, you create a query by selecting Name and Credit
Limit. You decide to qualify the query with the Customers Exceeding
Credit Limit variable. The variable performs the operation
retailers.receivable>retailers.credit
retailers.receivable>retailers.credit
retailers.receivable>retailers.credit
For any attribute you qualify
with the Customers Exceeding
Credit variable, the results
are the same, because it
substitutes the Current
Receivable (retailers.
receivable) attribute and
the “>” operator.
Using Placeholders
A variable that includes placeholders for the attribute and the operator
always qualifies the attribute into which it is inserted and uses the
operator you specify in the qualification tree. (When you submit a
You can use placeholders to create variables that return different results
depending on the attribute qualified and the operator used.
Including Functions
Variables often include functions that perform some type of calculation.
Using the DBMS function for the current date, for example, a variable
A list of built-in SQL functions appears under Functions. For certain DBMS types, a
list of scalar functions appears under Other Functions.
3 Click Insert.
4 To include the value to which you want the function to be applied,
edit the expression.
Including Variables
You can use variables as building blocks for more complex variables.
^Attribute^^Operator^ <<Today>> - 1
The Today variable determines today’s date and allows you to create a variable that
determines yesterday’s date.
Including Prompts
When you need to qualify a variable but you don’t want to restrict it to
a specific value, you can include a prompt so that you can insert a value
each time the variable is used. (For more information on prompts, see
“Prompts” on page 96.)
This variable includes the weekofyear! group prompt, which prompts you to specify first
the week you want, then the year. The variable returns results based on the week and
year you specify.
4 In the Import Variables dialog box, select the variable(s) you want
under Variables to Import, then click Import>>.
The DBUserID variable supplies the database user name for the user Users must be
currently logged in to the database. Similarly, the BIUserID variable logged on to
BI/Broker when
supplies the BI/Broker user name for the user currently logged on to
submitting que-
BI/Broker. (See BI/Broker Users Guide.) ries that execute the BIUser-
ID variable. Otherwise, the
The creator of your data model can include a data object that associates variable can’t supply the user
data with one of these user names. Then you can qualify queries with name. This is true even
the user name variable to ensure that only the data associated with that though the user is submitting
a local copy of the query that
user is returned to that user. (For information on how to associate data would not otherwise require
in your database with a database user name or a BI/Broker user name, logging in to BI/Broker.
see the BI/Query Creating Data Models guide.)
Let’s say you want to retrieve information about retailers with the
highest credit limit. You’re aware that the highest credit limit allowed
for your retailers changes from time to time. You build and save a
3 Make the change(s) you want. (When you specify attributes in the
SQL string, use their database names, not the names in the attribute
window.)
4 If BI/Query displays a warning, click OK to overwrite the SQL
string.
OR
Click Cancel to undo your changes.
The original query returns a list of retailer names, locations, and sales amounts.
Cells you select using Ad Hoc Drill Down are light grey.
3 To retrieve results that match these items, resubmit the current query.
OR
To retrieve different results for these items, modify the current
query, then submit it.
4 To work with the same subset of results later, save the new query.
These results have no range applied. These results are for retailers with credit
limits between $200,000 and $600,000.
Combining Queries
To focus on specific information and create more complex queries, you
can create a query that combines results. This super query gives you the
flexibility to perform join operations not specified in a design window
or supported by your DBMS. You can also combine results from
different databases and design windows, and place two or more related
results sets (for example, retailer sales for Europe and retailer sales for
North America) in one report. However, you can’t save a super query
as a data values query file (see “Creating Data Values Query Files” on
page 90) and you can’t save the SQL for the super query as a text file
(see “Saving Results to a File” on page 157.)
The data types of the columns in the first results set must match the
corresponding columns in the second results set. For example, if the
first results set contains two columns, and their data types are character
and numeric, respectively, the first two columns of the second results set
must also be character and numeric.
The two results sets can have a different number of columns as long as
the extra columns appear at the end of one set. Or you can exclude the
extra columns by hiding them. If the two results sets contain columns
with the same data type but in a different order, you can reorder them.
(For more information, see “Ordering Columns” on page 58.)
Name aSales
Unisystems $10,145
Ziptech $6,430
Query Results 2
Appended Results
Unisystems $10,145
Ziptech $6,430
Appending rows from the second results set to the first. If the results sets have
different column names (for example, Retailer Name and Ret.Name), BI/Query uses
the name of the first set.
6 Click OK.
• the design window doesn’t provide joins for the attributes you need
to join
• the data model doesn’t include permission to create relationships
between tables
• the database doesn’t support outer joins
• you want to combine results from more than one database
When you join results, you need to specify which columns should be A left outer join includes all
joined and how. That’s because you’re creating a relationship between rows from the left results set
the two tables. With the exception of columns containing float and and those that match from
the right.
money data types, connecting columns must have the same data type.
By default, BI/Query joins the columns you specify and includes only
the rows that have an exact match. In SQL terminology, this is an
equijoin. (BI/Query actually performs a type of equijoin called a natural
join, displaying the columns on which you join only once in the A right outer join includes all
rows from the right results
combined results set instead of twice.) In the example below, data set and those that match
about sales and payments have been retrieved from different tables. An from the left.
equijoin allows you to display only those sales for which payment has
been received.
You can also join results and have BI/Query include all rows from a
results set even if they don’t match. In SQL terminology, this is an outer
An outer join may even include
join. The example below shows that applying an outer join allows you all rows from both results sets,
to display all sales, regardless of whether payment has been received. even if they don’t match.
You can also apply a left or right outer join, as illustrated in the
diagrams on page 133.
BI/Query sup-
Query Results 1 ports ANSI
SQL/92 syntax
Sales # Sales Amount for left and right
outer joins for certain data-
101 $15,000 bases and connectivities. (For
more information, see the
102 $52,303 online Help.)
213 $995
331 $2,561
511 $8,000
514 $2,303
818 $612
Query Results 2
101 $15,000
102 $52,303
331 $2,561
818 $612
Equijoin on Sales #
213 $995
511 $8,000
514 $2,303
To join columns
1 Create one of the queries you want to join.
2 Choose Query>Super Queries>Show Super Query.
3 In the data model, create or load another query.
4 In the Super Query window, choose Query>Add Operation>Join.
5 In the Join Columns dialog box, make sure the current query is
selected in the Choose a Query for the Bottom Branch text box.
You can join on up to four columns. This is especially useful when the
primary key consists of two or more fields. By default, BI/Query applies
an equijoin, including only the rows in both results sets that have an
exact match in the joined columns. The columns you join appear once
in the combined results set. You can specify a different join using the
Include All Left Rows and Include All Right Rows check boxes.
Only rows that have an exact Leave Include All Left Rows and
match (equijoin). Include All Right Rows unchecked.
All rows from the left results set Click Include All Left Rows.
and those that match from the
right (left outer join).
All rows from the right results Click Include All Right Rows.
set and those that match from
the left (right outer join).
All rows from both results sets, Click Include All Left Rows and
even if they don’t match. Include All Right Rows.
Toolbar
Operation
Component queries
Splitter bar
Message pane
The top pane displays the structure of the query using a tree list. Each
Icons
component query and each operation is included in the tree and is Query
represented by an icon. The operations performed on a component
Append
query’s results appear above the component query in the tree. For
example, if the results of a component query are reordered, then sorted, Join
the tree list shows three branches — first the component query, then Range
the reorder operation and the sort operation above it.
Reorder
If a join or append operation is performed on two of the component Sort
queries, it’s shown in the window above the queries and their
associated operations. Any operation that appears above a join or
append operation is applied to the results of the join or append.
The bottom pane of the Super Query window (called the message pane)
displays information about an item in the query. When you select a
component query, the message pane displays the query’s SQL string.
When you select an operation, the message pane shows information
about what the operation does to the query results. And if there’s an
error in the query, the message pane displays information about why
the error occurred and how to correct it.
Editing an Operation
You can change how an operation manipulates query results by editing
the operation. You begin in the Super Query window. When you
double-click the operation you want to edit, BI/Query opens the
appropriate dialog box, where you can make your changes. When you
click OK, BI/Query replaces the old operation with the new one.
You can’t edit an If any errors occur as a result of your changes, you need to correct them
append opera- before you can save or submit the query. (See “Correcting Errors” on
tion, but you can
page 140.)
delete it. Click the
append operation and choose
Query>Super Queries> To edit an operation
Delete Operation. 1 To load a query, choose Query>Load. In the Load Query dialog
box, select a query, then click Load.
OR
Choose Query>Super Queries>Show Super Query.
2 In the Super Query window, click an operation, then choose
Query>Super Queries>Edit Operation.
3 In the dialog box that appears, edit the operation.
4 Click OK.
Correcting Errors
Each time you edit a query in the Super Query window, BI/Query
checks for errors. You can’t save or submit a query that contains errors
— you need to correct the errors first. When you edit a query, you
may introduce an error because the parts of the query are
interdependent. For example, removing an attribute from a component
query when that attribute is used in a sort operation results in an error
in the sort.
Errors occur on operations, but you can correct them by editing either
the operation or its associated component query. For example, you can
correct the error described above by editing the component query to
include the missing attribute or editing the sort operation to sort on a
different attribute.
To correct an error
1 In the Super Query window, click the operation causing the error. Error icon
The table below lists some common errors and their solutions.
Queries with a circular path are typically built by advanced users who
understand how to use join conditions in order to retrieve the
information they need.
With a Correlation
When you build a query with a correlation, BI/Query creates a When administra-
temporary copy of the data object. This allows you to ask two different tors design a data
model, they can
questions of the same object.
create permanent
copies of a data object using
You begin by selecting the relationships joining the data objects you
correlation names. In some
want to include in your query. The last relationship you select cases, this allows users to
determines how the circular query is formed. The data objects avoid building circular que-
connected to that relationship are the ones you’re presented with when ries. (See the BI/Query Data
Models Guide.)
you’re prompted to create a correlation. And that relationship is applied
to the data object you create a correlation for.
For example, if you select the Managed By relationship last and create a
correlation for Employees, BI/Query creates a second, temporary copy
of Employees called Empo__Manag. (To name the correlation,
BI/Query uses the first five characters of the data object’s name, two
underscores, then the first five letters of the relationship you selected
last.) The result is two copies of Employees: one connected to
Departments through the Work In relationship, the other, temporary
copy connected to Departments through Managed By.
When you double-click the original data object in the design window,
you’re prompted to specify which attribute window you want to use
— the one for the original data object or the one for its correlation.
You can use one attribute window to ask one question, then the other
attribute window to ask the second question.
For example, suppose you want to use the data objects illustrated above
to find out which employees work for managers who make over
$60,000. You need a correlation because you’re asking for two kinds of
information from the Employees data object — the names of the
employees and who is a manager making over $60,000. You’d use the
Employees data object to find out the names of the employees, and
you’d use its correlation to find out who is a manager making over
$60,000. (You use the correlation for the second question because it’s
the one that uses the join condition in the Managed By relationship.)
When you submit the query, the DBMS processes it in two stages.
Behind the scenes, the DBMS first obtains a preliminary results set
(names of all employees and the departments they work in) by joining
each row in Employees with each row in Departments, then applying
the join conditions for Work In.
Results 1 X Emplo__Manag
----------------------------------------------------------------- = Results Final
Managed By
select
Employees.LastName,
from
Departments,
Employees,
Employees Emplo__Manag
where
(
(
Emplo__Manag.Salary > 60000.0000
)
)
and
Departments.DepartmentID = Employees.DepartmentID
and
Departments.Manager = Emplo__Manag.EmployeeID ;
Double-click Employees to open the attribute windows for Employees and for its
correlation.
Choosing Employees opens the attribute window for the original Employees data
object. Choosing Emplo__Manag opens the attribute window for its correlation.
Without a Correlation
When you build a query without a correlation, BI/Query doesn’t
create a temporary copy of a data object in the circular path. This
allows you to ask one question using all the data objects and all the join
conditions in the circular path. The results are usually more restricted
because the rows returned from the database must meet all the join
conditions in the circular path.
In a circular query without a correlation, the DBMS returns only the rows that meet the
join conditions in both the Work In and Managed By relationships.
For example, suppose you want to use the data objects illustrated above
to find out which employees make over $60,000 and manage the
When you submit the query, the DBMS processes it in two stages.
Behind the scenes, the DBMS first obtains a preliminary results set
(names of all employees who make over $60,000 and the departments
they work in) by applying the join condition for Work In to
Departments and Employees.
Departments X Employees
---------------------------------------------------------------- = Results 1
Work In
The DBMS then applies the join condition for Managed By to the
preliminary results set to obtain the final results (employees who make
over $60,000 and manage the department they work in).
Results 1
-------------------------------
- = Results Final
Managed By
select
Employees.LastName,
from
Departments,
Employees
where
(
(
Employees.Salary > 60000.0000
)
)
and
Departments.DepartmentID = Employees.DepartmentID
and
Departments.Manager = Employees.EmployeeID ;
Exporting Queries
If you have the Save Queries permission, you can export the SQL for a
query to a text file, provided that the query does not manipulate the
results. (See “Ordering Query Results” on page 58, “Narrowing the
Range of Results” on page 128, and “Combining Queries” on
page 129.) The SQL can then be used in other applications. For
instance, you can use saved SQL in stored procedures in the database.
When you export a query from a results window, BI/Query saves the
query that generated that results set. When you export from any other
window, BI/Query saves the current query.
Exporting Results
Query results are useful in BI/Query — and they’re also valuable when
they’re exported to other applications. BI/Query exports results as text
files that can be used by any application. For example, you can augment
a report prepared in Microsoft Word by including actual data that
you’ve retrieved from a query or you can transfer results to a worksheet
in Microsoft Excel to perform advanced statistical analyses.
Save Query Includes the name of the query that generated the
Name results. This is useful when you’re exporting to
applications that use worksheet macros to perform
certain operations depending on which query
generated the data.
3 If the executable for the application isn’t in your path, click the
button to the right of the Execute Command Line text box. In the
Select Application dialog, find and select the application, then click
Open.
4 If you’re exporting using DDE, and it isn’t supplied automatically,
supply the name that the application registers with the DDE server
into the Service Name text box.
5 Under Commands, click DDE or Menu Item.
[open(“c:\msoffice\excel\test.xls”)]|[run
(“test.xlm!macro1”)]
Button A [open(“c:\msoffice\excel\test.xlm”)]
[run(“test.xlm!macro1”)]
Button B [run(“test.xlm!macro2”)]
Button C [run(“test.xlm!macro3”)]
Button A [run(“test.xlm!macro1”)]
Button B [run(“test.xlm!macro2”)]
Button C [run(“test.xlm!macro3”)]
2 Create a button that selects the current query, then exports the
results using the default paste to Excel. This method reduces the
number of buttons but requires you to load each query in
BI/Query before running it. You must also reposition the cursor in
Excel each time so that the next set of results does not overlap.
3 Paste to a specific worksheet. Open the macro sheet by following
one of the instructions in “Issuing Two Commands to Obtain the
Effect of Three” on page 165. Then use the following macros:
Button A [open(“c:\msoffice\excel\test.xls”)]
[run(“test.xlm!macro1”)]
Button B [run(“test.xlm!macro2”)]
Button C [run(“test.xlm!macro3”)]
If your Excel worksheet always uses the same format, set up a template
worksheet. Specify an export command that opens the template and
pastes the results, such as [open(“c:\msoffice\excel\template.xls”)][paste()].
Once the results are copied, save the template with another name.
Index 171
calculations (continued) copying, using Clipboard, 157
with queries, 47–57 correlation names, 145
canceling ad hoc drill-down mode, 127 Count All command, 52
Case-sensitive Comparisons preference, 33 COUNT DISTINCT function, 51
characters, special, 77–78 COUNT function, 50, 54
circular queries, 144–151 creating
no correlations, 149–151 attributes, 51, 55–57
with correlations, 145–149 circular queries. See circular queries
Clipboard, exporting to, 157, 157 data models. See BI/Query Data Models Guide
colors, using, 78–79 data values
Column Order command, 59 query files, 90–93, 103
columns results files, 88–90
in results nested queries, 123–124
hiding, 130 prompts, 97, 99–100, 102
joining, 132–136 queries. See queries
ordering, 58, 130 relationships, 142–144
Combine command, 42 subqueries, 123–124
combining variables, 108–115
qualifications 35, 41–42 customer support, 5–6
queries, 129–136
comparison operators, 43–44
computed strings, 78–79 D
condition box, 39–40, 42
conditional prompts, 97, 101–106 data
conditions, applying. See qualifying aliasing, 93–96
Connect command, 25–26 entering, 71–73
connecting to DBMS, 26 formats, 71–75
default connection files, 25–26 colors, 78–79
supplying connection information, 26 dates, 71–72, 73, 77
connection files, 26 default, 71
omitting information, 26 numbers, 71–73, 76
Connections command, 25 strings, 77
contacting Hummingbird groups, 49–55
Professional Services, 7–8 substituting values, 78–79
Sales, 12 data models
Technical Support, 6 creating. See BI/Query Data Models Guide
Contents command, 5 data objects, 15
Control Panel settings, 71, 71–73 editing, 24
conventions in this guide, 3 files, 23
converting two-digit years, 73–75 opening, 23
Copy command, 157 split, 23
Copy Query to Model command, 139 data objects, 15
172 Index
attributes, 15 exporting to Excel, 163–169
connecting, 142–144 default
qualifying, 96 connections, 25–26
relationships between, 142–144 data format, 71, 75
data types, 55 text styles, 71
Data Values command, 36 deleting
Data Values folder, 85 calculated attributes, 55
Data Values Results command, 88, 90 characters in a string, 77
data values, 35–36, 83–96 qualifications on attributes, 33, 35
access, 84 displaying
aliasing data, 93–96 data values, 34–37
disabling, 84 data, 71, 75–79
displaying, 34–37 Distinct command, 88, 89, 92, 103
files, 83–96 documentation
icon, 34–37 conventions, 3
in variables, 108 electronic, 4
prompts, using with, 85–86, 103 related documents, 4–5
qualifying attributes with, 34, 35–36, 83 duplicate information, suppressing, 50
query files, 83–86, 90–93 Dynamic Relationships permission, 143
creating, 90–93, 103 dynamic relationships, 142–144
naming, 85–86
prompts with, 85–86, 103
results files, 83–90 E
creating, 86–90
naming, 85–86 edit mask, 78–79
prompts with, 85–86 Edit Operation command, 140
spreadsheet, using to create, 89–90 Edit Queries permission, 125
text editor, using to create, 89–90 editing
database, connecting to, 26 buttons, 24
Date Entry command, 74 calculated attributes, 55
dates data formats, 75–79
calculating in variables, 107, 109 ornaments, 24
entering, 33 qualifications. See qualifying
fixed, 73–75 queries, 125–126
formats, 71–72, 73, 77 SQL string, 125–126
sliding, 73–75 electronic documents, 4
DBMSs e-mail address, Hummingbird, 6, 8, 12
connecting, 26 enhancements, suggesting, 6
default connection files, 25–26 equal joins, 133–136
Teradata, 55 errors, editing, 140–142
DDE, 157, 158, 162–169 Excel, exporting to, 162, 163–169
commands, 163–164 exception reporting, 78–79
Index 173
exporting, 155–170 aggregate, 47–57
buttons, using, 157, 160 AVERAGE DISTINCT, 50
Clipboard, using, 157 AVERAGE, 50
DDE, using, 158, 162, 162–169 COUNT DISTINCT, 51
mailing files, 169–170 COUNT, 50, 54
queries, 155–156, 169–170 group order, 47–49, 51–52, 57
reports, 170 in variables, 108
results, 67–68, 156–163, 169–170 MAXIMUM, 50
format, 159–161 MINIMUM, 50
to Excel, 162, 163–169 none, 50
expressions. See variables qualifying attributes, 53–54
scalar, 57
SUM DISTINCT, 50
F SUM, 47, 48, 50, 52
fax, Hummingbird, 6, 8, 12
files G
data values
query, 83–86, 90–93, 103 Genio Suite, 8–9
results, 83–90 Group Qualification command, 53
exporting to, 157, 159–161 group qualification, 53–54
mailing, 169–170 grouping
names, 85–86 attributes, 47–49, 51–55, 57
Prompts, 106, 108 prompts, 97, 98–106
prompts, 97
queries, 68, 155–156
reports, 170 H
results, 67–68, 157
finding adminstrator layer, 24 HAVING clause, 53–54
fixed dates, 73–75 help
Format command, 75 obtaining technical support, 5–6
formats online, 5
data, 71–75 Help menu. See specific commands
colors, 78–79 hiding columns in results, 130
default, 71 hierarchical prompts, 97, 98–106
substituting values, 78–79 How to use Help command, 5
dates, 33, 71–72, 77 Hummingbird
numbers, 71–73, 76 BI/Analyze, 11
results, 159, 159–161 BI/Broker, 10
strings, 78–79 BI/Query Admin, 11
four-digit years, converting to, 73–75 BI/Query Reports, 11
functions, 47–55 BI/Query Update, 11
174 Index
BI/Query User, 11 list icon, qualification tree, 33
BI/Query, 10–11 Load Query command, 139, 140
BI/Suite, 9–11 lock icon, 24
BI/Web, 10 logging in to BI/Broker, 21–22
e-mail address, 6, 8, 12
fax, 6, 8, 12
Genio Suite, 8–9 M
product documentation, 4–5
Professional Services, 7–8 mailing files, 169–170
Sales, 12 MAPI, 169–170
Technical Support, 5–6 MAXIMUM function, 50
World Wide Web address, 8, 12 message pane, super query window, 138
MINIMUM function, 50
Modifiers command, 88, 89, 92
I More Windows command, 139
multi-level prompts, 97, 98–106
importing multiple prompts, 97, 98–106
data values, 89
results, 89–90
prompts, 106–107 N
results from another application, 89–90
variables, 116–117 names of
Insert DB Name command, 121 data values files, 85–86
Insert Subquery command, 123 prompts, 97, 99, 100
invalid data entry, 73 natural joins, 133–136
Negate Clause command, 40
negating qualifications, 40
J nested queries, 122–124
New Query command, 144
Join command, 135 none function, 50
join conditions, 143 null values, 46, 51
joining columns of results, 132–136 numbers
entering, 71–73
formats, 71–73, 76
L
leaving prompts empty, 38 O
linking
data objects, 142–144 objects. See data objects, buttons, ornaments, and
data values to relationships
attributes, 85–86 OLAP (Online Analytical Processing), 10, 11
prompts, 85–86, 103
Index 175
online preferences
documents, 4 Allow Dynamic Relationships, 143
Help, 5 Case-sensitive Comparisons, 33
technical support, 6 Show Relationship Names, 16
tool tips, 5 Show Relationships, 16
opening data models, 23 Show SQL String, 125
operations problems, reporting, 6
append, 130–132 procedures, in variables, 108
editing, 139–140 product support, 5–6
join, 132–136 Professional Services, Hummingbird, 7–8
range, 128–129 Prompts command, 97, 100, 106
super query window, using, 137 Prompts file, 108
operator list, 34, 42–64 prompts, 37–38, 96–107
operators, 34, 42–64, 124 conditional, 97, 101–106
comparisons, making, 43–44 creating, 97, 99–100, 102
in variables, 108 data values, using with, 85–86, 103
matching drill-down, 97, 98–106
character strings, 44–45 files, 97
items in list, 45 group, 97, 98–106
null values, 46 hierarchical, 97, 98–106
range of values, 45–46 importing, 106–107
user-defined, 46 leaving empty, 38
options for exporting results, 160 multiple, 97, 98–106
order of names, 97, 99, 100
attributes, 60–63 qualifying
columns in results, 58, 130 actual relationships, 96
prompts, 99 attributes, 54, 96, 136
ordering columns, 58–59 data objects, 96
ornaments, split data models with, 24 single, 97, 97–98
outer joins, 133–136 testing, 100, 104–106
titles, 100
publishing queries. See BI/Broker Publishing and Scheduling
P Guide
176 Index
operator list, 34, 42–64 editing, 125–126
qualification text box, 33 correcting errors, 140–142
qualifying exporting, 155–156, 169–170
actual relationships, 96 files, 68
attributes, 30–47, 53–54 filtering, range, 128–129
ad hoc drill-down mode, 126–128 mailing, 169–170
combining qualifications, 35, 41–42 nested queries, 122–124
comparisons, making, 43–44 ordering columns, 58–59
deleting, 35 prompts. See prompts
editing qualifications, 125–126 publishing. See BI/Broker Publishing and Scheduling
grouping, 47–57 Guide
matching character strings, 44–45 retrieving. See BI/Broker Publishing and Scheduling
matching items in list, 45 Guide
negate clause, 35, 39 saving, 64–66, 155–156
null values, 46 scheduling. See BI/Broker Publishing and Scheduling
operators, 34, 42–64, 124 Guide
qualification tree, 32–35 securing. See BI/Broker Publishing and Scheduling Guide
range of values, 45–46 sort order, 60–63
reversing qualifications, 35, 39 sorting rows, 60–63
separating combined qualifications, 42 SQL. See SQL
with an attribute, 54, 121–122 standard, 133, 155
with data values, 34, 35–36, 83–96 submitting,
with multiple qualifications, 40 to applications, 156–169
with prompts, 37–38, 54, 85–86, 96–106 to files, 68
with subqueries, 122–124 subqueries, 122–124
with values, 33 super, 91
with variables, 38–39, 115 variables. See variables
data objects, 96
results, 126–128
Queries folder, 65, 97 R
queries, 17–18, 29–38
building, 17 Range command, 129
calculations with, 47–57 range, results in, 45–46, 128–129
circular, 144–151 Relationship command, 143
no correlations, 149–151 relationships, 16
with correlations, 145–149 creating, 142–144
combining, 136 dynamic, 142–144
append, 130–132 saving, 143
join, 132–136 reporting problems, 6
complex, 129 reports
creating, 17 creating. See BI/Query Reports Guide 65
combining, 136 exporting, 170
Index 177
reports (continued) running BI/Query, 21
mailing, 169–170
repository, 10
restricting S
queries. See qualifying attributes
results, 144–151 Sales, Hummingbird, 12
results Save Queries permission, 65, 155
columns Save Query command, 65, 92, 123, 139, 141, 155
hiding, 130 Save Results command, 68, 157
joining, 132–136 saving
order, 58, 130 queries, 64–66, 155–156
ordering 58–59 relationships, 143
combining, 136 results, 67–68, 157
data formats, 71–79 SQL string, 155–156
data values. See data values scalar functions, 57
exporting, 67–68, 156–170 Scheduler, 10
files, 67–68 scheduling queries. See BI/Broker Publishing and Scheduling
format, 159 Guide
grouping, 54 Search for Help On command, 5
mailing, 169–170 Send command, 170
qualifying, 126–128 sending
range, specifying, 45–46, 128–129 mail, using, 169–170
restricting, 144–151 queries
restricting. See qualifying to applications, 156–169
retrieving. See queries to files, 68
rows separating
appending, 130–132 columns in reports, 131
sorting, 60–63 qualifications, 42
saving, 67–68, 157 separators, for exporting results, 160
sending Show Query command, 38, 125
to applications, 156–169 Show Super Query command, 128, 139, 140
to files, 68 single prompts, 97, 97–98
sorting 63 sliding dates, 73–75
values, substituting, 78–79 Sort Order command, 63
Results Options command, 90, 160 sorting rows, 60–63
retrieving information from the database. See queries split data models, 23
retrieving queries. See BI/Broker Publishing and Scheduling administrator layer, 24
Guide buttons, 24
reversing qualifications, 35, 39 ornaments, 24
rows reestablishing path between layers, 24
sorting, 60–63 splitter bar, super query window, 137
See also results spreadsheets, data values results files, 89–90
178 Index
SQL tool tips, 5
HAVING clause, 53–54 trace utility, 7
operators. See operators Tracing Enabled command, 7
string tree list, super query window, 137
editing, 125–126 triggers, 78–79
limit, 126 Trim Relationships command, 149
saving, 155–156 troubleshooting problems, 7
WHERE clause, 53 two-digit years, converting, 73–75
standard queries, 155
saving, 64–65
starting BI/Query, 21 U
strings, computed, 78–79
Submit Query — To File command, 68, 157 Uncombine command, 42
Submit Query command, 139, 149, 151 User and Group Manager, 10
submitting queries user-layer files, 23
to applications, 156–169 user-defined
to files, 68 attributes, 55–57
subqueries, 122–124 calculations, 51
in variables, 108 operators, 46
substituting values, 78–79 utilities, trace, 7
SUM DISTINCT function, 50
SUM function, 47, 48, 50, 52
summary information. See aggregate functions V
super queries, 91, 129
See also filtering and combining queries Variables command, 109, 116
super query window, 137–138, 139, 140 variables, 38–39, 107–117
suppressing duplicate information, 50 calculating
dates, 107
time, 107
T containing
attributes, 110–113
tables in database, representing, 15 functions, 113–114
technical support, 5–6 operators, 110–113
contacting, 6 placeholders, 110–113
using the trace utility, 7 prompts, 115
Teradata database, 55 variables, 114–115
testing prompts, 100, 104–106 creating, 108–115
text editor, for data values results files, 89–90 importing, 116–117
time qualifying attributes, 107–115
calculating in variables, 107
including in results, 77
titles in prompts, 100
Index 179
W
WHERE clause, 53
displaying prompt values, 38
in variables, 38–39, 108
WinCLI connections, 55
windows, appearance in this guide, 4
working offline, 21
World Wide Web
Hummingbird address, 8, 12
Y
Year-2000 compliance, 73–75
180 Index