0% found this document useful (0 votes)
26 views

Aaude - Data Warehouse Brioquery 6 Basics Class Manual

Manual Básico de BrioQuery
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Aaude - Data Warehouse Brioquery 6 Basics Class Manual

Manual Básico de BrioQuery
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 63

AAUDE Data Warehouse

BrioQuery 6 Basics
Class Manual

Copyright 2003 Massachusetts Institute of Technology

TABLE OF CONTENTS
TABLEOFCONTENTS....................................................................................I
BRIOQUERYBASICSLEVEL1.....................................................................3
OVERVIEW.........................................................................................................3
USINGONLINEHELP...........................................................................................4
TOUROFTHEDATAWAREHOUSEWEBSITE....................................................4
STARTINGUPBRIOQUERY.................................................................................5
CONNECTINGTOTHEDATABASE.......................................................................5
ATOUROFBRIOQUERY.....................................................................................7
Toolsforbuildingaquery............................................................................8
ToolsfornavigatingaroundaspectsofusingBrioQuery............................9
Toolbarsforperformingtasks....................................................................11
Statusbarforgettinginformationaboutyourqueries...............................11
CREATINGTHEQUERY.....................................................................................12
Choosingthetables....................................................................................12
Gettinginformationontablesandfields....................................................14
Settingupremarks......................................................................................14
SPECIFYINGTHEITEMSOFDATATORETRIEVE................................................15
RearrangingitemsintheRequestLine......................................................15
RemovingitemsfromtheRequestLine....................................................16
CHECKINGTHEQUERYSIZE............................................................................16
LIMITINGQUERYRESULTS..............................................................................17
SPECIFYINGTHELIMITATIONS.........................................................................17
Groupingtheinformation...........................................................................19
Sortingaspartofthequeryvssortingtheresults......................................19
Alookatthecompletedquery...................................................................19
SAVINGTHEQUERY.........................................................................................20
MORETHINGSTOKNOWABOUTLIMITS..........................................................21
PROCESSINGTHEQUERY.............................................................................21
SAVINGTHEQUERYANDRESULTS..................................................................23
WORKINGWITHTHERESULTS..........................................................................23
ResizeColumnWidths...............................................................................23
Wraptextinacolumn................................................................................24
Movecolumns............................................................................................25
Exercise1...................................................................................................26
EXPORTINGDATAINTOOTHERFILEFORMATS.................................................27
THERELATIONSHIPBETWEENTABLES.............................................................28
TurningoffAutoJoins...............................................................................28
DeletinganexistingJoin............................................................................28

BrioQuery Basics Level 1

SettingupSimpleJoins..............................................................................29
STARSCHEMA..................................................................................................30

FactTables.................................................................................................30
DimensionTables......................................................................................30
CreatingtheStar.........................................................................................31
USINGDATAFUNCTIONSONTHEQUERYSCREEN............................................34
CREATINGACOMPUTEDCOLUMN...................................................................35
EXERCISE.........................................................................................................39
PIVOTREPORTS................................................................................................41
CreatingaPivot..........................................................................................41
CreatingcomputeditemsinthePivot........................................................42
Drillingdownintodata..............................................................................43
Addingtotalsandsubtotalstoapivot........................................................44
EXERCISE.........................................................................................................46
EXERCISE.........................................................................................................50
EXERCISE.........................................................................................................51
EXERCISE.........................................................................................................53
EXERCISE.........................................................................................................55
APPENDIXA....................................................................................................57
CREATINGANOPENCATALOGEXTENSION......................................................56

ii

9/3/2015

BRIOQUERY BASICS LEVEL 1


OVERVIEW
This hands-on training session will give you an opportunity to
learn some of the basic features of BrioQuery and how to use
them. One of the goals of this class is to introduce you to how to
construct meaningful queries to retrieve data from the AAUDE
Data Warehouse. Youll also learn some techniques for building
complex queries and working with query results to produce
reports.
During the class, youll

tour and learn about the BrioQuery environment

construct a query

join data from multiple tables

learn about a star schema (including facts & dimensions)

create a star using AAUDE data

create computed columns

aggregate data in different ways

produce pivot reports

Throughout the class, youll be introduced to terms used by


BrioQuery to identify elements of databases and aspects of
retrieving data and working with the results.
BrioQuery has many features too numerous to cover in this
class. We encourage you to take time to explore other BrioQuery
features outside of this class to develop more skill that will help
you in your work.

9/3/2015

Page 3

USING ONLIE HELP


BrioQuery has an extensive online help system that gives
instructions for carrying out BrioQuery procedures. To use
online help,
1. Dooneofthefollowing:

Macintosh:ChooseBrioQueryHelpfromtheApplemenu.

Windows2000andNT:ChooseBrioQueryHelpfromthe
Helpmenu.

2. ClickonHelpTopics.
Result:Adialogboxappearsthatyoucanusetobrowseorsearch
onlinehelp.Threetabsappearonthetop:
Contents:Displaysatableofcontentsofonlinehelp.
Index:Letsyousearchtheonlinehelpindex.
Find:Letsyousearchonlinehelpusingkeywordsorphrases.
3. Clickonthetabforthetypeofsearching/browsingyouwanttouse,
thenfollowtheinstructionsinthedialogbox.

TOUR OF THE DATA WAREHOUSE WEB SITE


The AAUDE Data Warehouse has a Web site with extensive
information about all aspects of the AAUDE Data Warehouse.
Some of the topics covered are:

Learning more about data: The AAUDE Data Warehouse


Explorer at http://mit.edu/warehouse/metadata/aaude/
contains information about the kinds of data available in the
AAUDE Data Warehouse, the sources from which they are
derived, and how they're organized.
You can also learn about how data is grouped into exchange
items by clicking on the Stars or Table Groups or the

9/3/2015

Page 4

AAUDE Data Warehouse

Sample Queries link. On the sample queries page, you can


find links to pre-existing reports available in each exchange
item that may suit your reporting needs and save you the
time of creating them.

STARTING UP BRIOQUERY

Choose one of the following methods for starting up


BrioQuery, according to your platform:

To open BrioQuery on a PowerMac, double-click on the


BrioQuery icon.

To open BrioQuery on a Windows machine, from the


Program menu, choose BrioQuery.

CONNECTING TO THE DATABASE


One way to access data for querying is to connect to a database
thats on the same network to which your computer is connected.
Connecting to a database means that youve provided a
username and password to prove that you have authorized
access and that you can run queries and retrieve data.
Upon startup, BrioQuery will immediately prompt you to
connect to a database via opening an existing file or creating a
new file.
You must follow a procedure to connect to the database and
obtain a list of database items that are available to you. The
following is a description of this process, using BrioQuery
commands and terms:

9/3/2015

Choose an Open Catalog Extension (OCE): An OCE is a file


that stores information about connecting to a specific
database server.

Display a table catalog: A Table Catalog is a list of tables


available in the AAUDE Data Warehouse. Tables are
groupings of data names, sometimes called items in

Page 5

AAUDE Data Warehouse

BrioQuery and in other database program jargon, called


fields. For example, a table could be called phonebook
and contain items such as name, phone number, and
address. After youve connected to a database, you need to
display a Table Catalog so you can use it to create queries.
When connecting to a database youre asked to provide a user
name and password. For this class, we will be using a user name
and password that gives all of us access to the same data thats
used just for training purposes.
When you first open BrioQuery, a dialog box displays with
options to connect, open a file, or open a blank document:

Figure 1: The initial dialog box on BrioQuery startup


Under Recent Database Connection Files, click on Aaudewarehouse.oce, then click on OK.
Result: You are connected to the AAUDE Data Warehouse.
If in the future you wish to access to a database other than the
AAUDE Data Warehouse, youll also need to create an OCE for
it.

Page 6

9/3/2015

AAUDE Data Warehouse

A TOUR OF BRIOQUERY
The BrioQuery workspace provides a number of tools, in the
form of a menu bar, toolbars with buttons, the section pane, and
task lines that let you use BrioQuery commands to create queries
and work with results:

Toolbars
Section Title Bar
Request Line
Section Pane

Catalog Pane

Status Bar

Figure 2: BrioQuery environment on startup


BrioQuery lets you ask questions of the AAUDE Data
Warehouse. To use BrioQuery effectively, you need to form your
business question, then build a query based on it. The AAUDE
Data Warehouse is a read-only database, i.e., you can't break it.
BrioQuery provides a user-friendly interface that builds SQL
code, behind the scenes when you run a query.

9/3/2015

Page 7

AAUDE Data Warehouse

Tools for building a query


To construct a query, you need to specify criteria for the query:

The types of data that you want to retrieve, e.g., Institution


Name, Academic Year, Department Name or Cip Program
Code. BrioQuery refers to these as items. In order to
create a query and produce results, you must specify one or
more items

Criteria on which you want to measure available data for


retrieval. For example, you may want to retrieve data for only
one Academic Year or only for certain Institutions.
BrioQuery refers to these criteria as limits. Limits are
optional when constructing a query.

How to group data. For example, you may want to retrieve


financial data grouped by Institution Name or Department
Name. BrioQuery refers to this as a sort. Sorting Results is
optional when constructing query.

BrioQuery has two methods you can use to specify these criteria.
One way is to choose commands from the Query menu, the other
is to use the Request Line, Limit Line and Sort Line features.
Query menu
command

Line name

Purpose

Add

Request

specify the items you


want to retrieve

Limit

Limit

specify criteria for


retrieving data

Sort

Sort

specify how you want to


group data

Later in the class, youll have a chance to try the command


method and the Line feature for constructing queries.
By default the Request Line is displayed. If you want to use the
Limit Line and Sort Line you may have to turn on their display.
You can turn on the display of the Limit and Sort Lines by

Page 8

9/3/2015

AAUDE Data Warehouse

clicking the Limit and Sort Line links displayed in the Section
Title Bar. If the Section Title Bar is not displayed, you can turn it
on via the Section Title Bar option in the View menu.

Tools for navigating around aspects of using


BrioQuery
There are two tools for navigating, the section pane and the
scrollbar:
Sections
The BrioQuery program is divided into sections which you use
to perform data retrieval and reporting tasks:
Section
Query

Purpose
constructing queries

Results

displaying the results of a query

You can also add Reports, Pivot reports, Charts and the like by
using the New Pivot, New Report and New Chart commands
from the Insert menu.
Section pane
A series of links appear at the left of the screen that you can use
to navigate from one section to another. This area is referred to as
the Section Pane.

Figure 3: The section pane area of the window

9/3/2015

To navigate from one section to another, click on the


appropriate link.

To rename a section tab, right-click on it and select Rename

Page 9

AAUDE Data Warehouse

Section.

To make the display area for the Section Tabs larger, place the
mouse pointer on the Resize bar.

You can create a number of Reports, Pivot Reports and Charts for
one query. Each time you create a new report or chart, a link in
the Section Pane is added.

Page 10

9/3/2015

AAUDE Data Warehouse

The Table Catalog


The Table Catalog appears directly below the Section pane. You
can click the + button to expand Tables and view the tables in
the database.

Figure 4: The AAUDE Data Warehouse Table Catalog


NOTE: When you connect and log into the AAUDE Data Warehouse
with your own Host User and Host Password, only the tables to

9/3/2015

Page 11

AAUDE Data Warehouse

which you have access will be displayed in the Table Catalog.


Scroll bars
The standard window scroll bars are available to move either up
and down or left and right if the workspace does not fit into the
window.

Toolbars for performing tasks


By default a Standard toolbar appears at the top of the
workspace:

Figure 5: The Standard toolbar


You can use these buttons as an alternative to choosing
commands from the menus. Youll learn about using some of
these icons during the course of this class.

Status bar for getting information about your


queries
You can turn on the display of a status bar that provides
information about your connection to the AAUDE Data
Warehouse and queries that you make.

Figure 6: The Status Bar


The icon that looks like a barbell with the X in it, called a
Connection icon, means that you are not connected to a database
such as the AAUDE Data Warehouse. When the barbell has no
X in it, youre connected to a database. To turn on the Status
bar,

Page 12

From the View menu, choose Status bar.

9/3/2015

AAUDE Data Warehouse

CREATING THE QUERY


Before you begin creating a query, go to the Query section by
clicking on the Query link on the left.
To create a query, you need to make some decisions:

What items of data you want to retrieve, e.g., do you want


Institution Name or Program Name?

Do you want to limit the data values that you retrieve and
how, e.g. do you want only a few Institutions?

Do you want to arrange the results according to some criteria,


for example, if you retrieve all Institutions, do you want to
sort them alphabetically by the Institution Name?

Once youve made these decisions, you can start constructing


your query. To do this, you need to open the tables that contain
the types of data you need, indicate what types of data you want
to retrieve using either the Add command, or the Request Line,
then if you want to limit the retrieval and/or group it, use the
Limit and/or Sort commands.

Choosing the tables


The tables (also called Topics) you see in the list are named to
reflect the nature of the data thats associated with them. For
example, Cip_Cross_Faculty_Salary table has cip cross walk data
for faculty salaries for different institutions in different academic
years. As you work with these tables, youll become more
familiar with what groups of data are associated with which
tables.
You can use the data explorer at
http://web.mit.edu/warehouse/metadata/aaude to find out
more about the various tables and what's contained in them.
Since we want to build a report which will display the faculty
salary cross walk data that is available for several Institutions,
well need to use the Cip_Cross_Faculty_Salary table.
9/3/2015

Page 13

AAUDE Data Warehouse

To open a table, either double-click on it or press and drag


the Table name from the Table Catalog to the workspace.
Result: The table appears in the workspace displaying a list
of all of the items (also called field names) contained in it.

Table

Items in the Table

Figure 7: Table opened for constructing a query


In the Status bar, the number of tables you've placed in the work
area is indicated as "x topics" where x is the total number of
tables.
The items in each table make up the structure of the table. You
can also get a sample view of the actual data in a table. To do
this, use the Topic View command under the DataModel menu.
1. Click once in the title of the Employee table to make it active,
then from the DataModel menu, choose Topic View>Detail.
Result: The values for each item in the table are displayed for
the first 10 records:

Page 14

9/3/2015

AAUDE Data Warehouse

Figure 8: Example of Detail view of the Cip_Cross_Faculty_Salary


table.

2. To redisplay the field names instead, from the DataModel


menu, choose Topic View:Structure.

Getting information on tables and fields


If you come across a table or field that you're unfamiliar with,
you can get information about the field by using the Show
Remarks command under the Query menu. Let's try it:
1. Click on the Cip_Cross_Faculty_Salary table to activate it.
2. From the Query menu, choose Show Remarks..., or press
<Ctrl> - I (Windows) or <command> - I (Mac).
Result: The Remarks dialog box appears with a definition of
the field.
3.

Click on OK to close the box and resume your work.

Setting up Remarks
If, when you try to Show remarks you get an error about
remarks not being set up, you will have to set them up manually.
1. Select Connections Manager form the Tools menu.
2. Choose your OCE file from the left-hand side of the
Connections Manager Window and click Modify.
3. Leave On the current connection selected and click Next.
4. Leave Custom selected and click Edit.
5. Choose the Remarks tab.
6. For the Table Remarks radio button, fill in the fields as
follows:

9/3/2015

Page 15

AAUDE Data Warehouse

Tab Name: Table Remarks

Select: description

From: wareuser.tables

Where: upper(table_name)=upper(:TABLE)

7. Once the fields are filled in, click the Add button at lower
right.
8. For the Column Remarks radio button, fill in the fields as
follows:
Tab Name: Column Remarks

Select: definition

From: wareuser.fields UVF, wareuser.tables UVT

Where: upper(UVF.table_name)=upper(:TABLE)
and UVF.table_key = UVT.table_key and
upper(UVF.field_name) = upper(:COLUMN)

9. Once the fields are filled in, click the Add button at lower
right.
10. Click OK, then Finish. Save the OCE when it prompts
you to it is all right to save over the original.

SPECIFYING THE ITEMS OF DATA TO RETRIEVE


A query is built by specifying items of data that you want to
retrieve and putting them in the Request Line. There are three
techniques for specifying the items of data that you want to
retrieve

Select a field name in a table, then choose the Add Request


Item(s) command from the Query menu

Click and drag items from a table to the Request Line.

You can select multiple items using the same technique as in


other programs such as Word:
Page 16

9/3/2015

AAUDE Data Warehouse

To select multiple items that are contiguous, click on the first


item, then <shift>-click on the last item.

To select non-contiguous items, <control>-click (Macintosh)


or <Ctrl>-click (Windows) on each item.

Using any of the techniques described above, place the following


items on the request line:

From the Cip_Cross_Faculty_Salary table, place Academic


Year, Unit Id, Aaude Inst Code, Institution Name, Division
Code and Division Name on the Request Line

Rearranging items in the Request Line


You can also rearrange the order of the items in the Request Line
by clicking and dragging them to the new position. Well move
Division Name so it is to the left of Aaude Inst Code.

In the Request Line, click on Division Name and drag it to


the left of Aaude Inst Code, then release the mouse button.
Result: Aaude Inst Code is now preceded by Division Name.

Removing items from the Request Line


You can remove fields from the Request Line just by dragging
them off. To try this out, well remove Division Name, but well
put it back again because we want it in the report.
1. Press and drag the Division Name item down off of the
Request Line, click once on it and press <Del> Mac or
<Delete> (Windows).
Result: The item no longer appears in the Request Line.
2. From the Cip_Cross_Faculty_Salary table, drag Division
Name back to the Request Line, to the left of Aaude Inst
Code.

9/3/2015

Page 17

AAUDE Data Warehouse

To remove all items from the Request line, click once on the
Request button to select it, then click <Del> Mac or <Delete>
(Windows).

CHECKING THE QUERY SIZE


At any time when youre constructing a query, you can check to
see how many rows would be retrieved if you processed the
query. This is especially useful to avoid processing a query that
will result in long processing time and retrieval of many rows.
To check the query size, use the Estimate Query Size command
under the Query menu:

From the Query menu, choose Estimate Query Size.


Result: A status box appears displaying the number of rows
that would be retrieved if you processed the query. For the
query were working on, it would look like this:

Figure 9: Example of Query Count dialog box.

LIMITING QUERY RESULTS


Sometimes youll be creating a query that will retrieve a large
amount of data, but may want to test if first, getting a smaller
sample of data. You can do this by using the Options command
under the Query menu and either limit the number of rows
retrieved or limit the amount of time for query processing:
1. From the Query menu, choose Query Options.
Result: The Properties dialog box appears:

Page 18

9/3/2015

AAUDE Data Warehouse

Figure 10: The Properties dialog box.


2. Set one or both of the following:

To limit the number of rows, click in the Return First


Rows checkbox, then either select and change 100 to the
desired number or leave it at 100.

To set a limit on the processing time, click in the Time


Limit Minutes checkbox, then either select and change
1.00 to another number, or leave it at 1 minute.

SPECIFYING THE LIMITATIONS


You can specify limits either by choosing the Add Limit(s)
command from the Query menu, by dragging the item by which
you want to limit from the table to the Limit Line or by doubleclicking on the item.
1. From the Cip_Cross_Faculty_Salary Table Catalog, click and
drag the Academic Year item to the Limit Line.
Result: The Limit screen appears:

9/3/2015

Page 19

AAUDE Data Warehouse

Figure 11: The Limit dialog box


In this dialog box, you can specify the value(s) on which you
want to limit as well as logical operators, e.g., equal to or
greater than. The default setting is = equal.
The check mark can be used to enter custom limits after
typing them in the edit field. Use the "X" to remove a custom
limit in the edit field.
2. Click on the down arrow next to = Equal to view the
possibilities. For this example, we will use =Equal.
3. Enter a value by which to measure. You can either type in a
value in the box below where you choose the logical operator,
or choose a value from a list. For this exercise, well choose
from a list. Click on the Show Values button.
Result: All of the values for Academic Year are displayed to
the right of the button.
4. Click on 2000-2001.
5. Click on OK.
Result: The Cip_Cross_Faculty_Salary table has an equal sign
which indicates that the results will be limited to records that
have the value of 2000-2001.

Page 20

9/3/2015

AAUDE Data Warehouse

Grouping the information


In most cases, youll want to group the results of your query in a
meaningful order to make it easier to examine the information.
For example, you may want to list Institution names
alphabetically by name. There are several techniques for
accomplishing this. You can click once on the item on which you
want to sort in the Request Line, then either click one of the Sort
buttons, or choose Ascending or Descending from the Query >
Add Sort(s) menu. Another way to do it is to drag the item on
which you want to sort from the Request Line to the Sort Line.
1. Click once on Institution Name in the Request Line, then
click on the Sort Ascending button.
Result: The Institution Name appears in the Sort Line.
You can also sort on more than one item, for example, you can
sort on Institution Name and Division Name. The sequence of
items from left to right in the Sort Line dictates the sort order,
e.g., if the Sort Line read Institution Name Division Name then
the results would be sorted first by the Institution Name, then by
the Division Name.

Sorting as part of the query vs sorting the


results
Besides setting up sorting criteria when you create the query,
you can also perform sorts after youve processed the query and
youre working in the results section. The difference is that when
you specify sorting criteria as part of the query, the AAUDE Data
Warehouse server performs the sorting. If you sort when
working with the results, the operation is performed with the
data thats been transferred to your computer. In both cases, the
end results should be the same.

A look at the completed query


The screen sample below shows your query with the appropriate
fields in the Request, Limit, and Sort Lines:

9/3/2015

Page 21

AAUDE Data Warehouse

Figure 12: How the completed query looks


At this point, you can still work on your query if you want to
make last-minute changes. If you want to remove items youve
placed on the Request Line, Limit Line, or Sort Line, simply press
and drag the item off the line. You add items in the same way
that we did in the previous exercises.

SAVING THE QUERY


Before processing the query, it is a good idea to save it. This way,
you can rerun the same query by retrieving your saved copy
rather than rebuilding the query from scratch. To save a query,
you use the Save as... command and assign a name:
1. From the File menu, choose Save as... or click on the diskette
icon, in the toolbar.
Result: The Save as dialog box appears:
2. Click on the New Folder button and create a folder called
class files.
3. Name the file Cip Cross Walk Faculty Salary.
4. Make sure the file type is set for compressed. This will make
the file size smaller thus saving disk space.)

Page 22

9/3/2015

AAUDE Data Warehouse

5. Click on Save.
Result: The query is saved in a file called Cip Cross Walk
Faculty Salary in a folder called class files.
When you save a BrioQuery file, the following components
are saved:
The constructed query.
The results, when you specify the results to be saved.
(Well learn this later in the class.)
Data resulting from computed items. (We learn about
computed items later on as well.)
Any reports you construct.

MORE THINGS TO KNOW ABOUT LIMITS


You can create more than one limit for a query just by repeating
the above procedure for each limit. By default, if you have more
than one limit created, the query processes them such that both
limits must be met in order for a record to be retrieved. For
example, if the query were creating had the limit of Institution
Name equaling MIT and Cip Program Title equaling
Engineering Science then only those records are retrieved.
This is confirmed by the and that is displayed between the
items in the Limit Line. If you want to modify the query so that
records have to meet only one of two criteria, double-click on the
and to make it an or.
When specifying limits for items that have text, as opposed to
numbers, you need to make sure that you enter the limit in the
right case; upper-, lower-, or mixed-case. For example, the data
in Cip_Cross_Faculty_Salary is stored in mixed case, so you
would need to specify limits using mixed case.
When specifying more than one value for a limit, use a comma to
separate each value. For example, when limiting on Institution
Name equal to Missouri or Ohio State, enter Missouri, Ohio
State.

PROCESSING THE QUERY

9/3/2015

Page 23

AAUDE Data Warehouse

Now that you have specified all your requirements, you are
ready to process the query and see the results on your screen. To
do this, you can either use the Process Query > Current
command under the Tools menu, or use the Process button on
the Toolbar. (NOTE: BrioQuery 6 lets you create, store and
process multiple queries within one file. During this class, we
will work with just one query per file.)

From the toolbar, click on Process or choose Process Query >


Current from the Tools menu.
Result: The query is sent to the AAUDE Data Warehouse.
BrioQuery automatically changes to the Results section the
Results tab is automatically activated.
The results are sent from the AAUDE Data Warehouse to
your computer and displayed on the screen:

Figure 13: Results of the query


NOTE: If need be, you can cancel a query while its in progress.
To do this:

Macintosh: Press <command> - <period>


Windows: Press <Alt> - <End>

In the status bar, youll see a report of how many rows have been
retrieved. For example in this query, the status bar reports 186
rows of 186 rows have been retrieved. The date and time the
query was processed is also indicated in the status bar. When
you save the query and results (see next section), the number of

Page 24

9/3/2015

AAUDE Data Warehouse

rows retrieved and date processed are also saved with it.
If you process a query and the status bar reports 0 rows
retrieved, this could either mean that you have the query
constructed incorrectly, or you dont have access to the data in
one of the tables youre using.
Remember that you can always return to the Query section and
redo a query if need be. You will also need to process it again to
get the new results.

SAVING THE QUERY AND RESULTS


BrioQuery also gives you the option of saving the results of your
query, along with the query. This way, you can work with the
results at a later time without having to process the query again.
This time, well save both the query and the results:
1. From the File menu, choose Save Options > Save Query
Results with Document. Make sure your query is selected in
the query window and click OK.
2. From the File menu, choose Save or click on the diskette
icon, in the toolbar. Make sure you save it in compress
format; it takes up less disk space.
Result: The file called Cip Cross Walk Faculty Salary now
contains both the query and the results.

WORKING WITH THE RESULTS


Once youve processed your query and the results are displayed,
theres a lot you can do with them:

9/3/2015

Reorganize the data to view it from different perspectives,


e.g., move the columns around, compute them, or group
them.

Page 25

AAUDE Data Warehouse

Format the data to make it easier to read, e.g., change the font
size and type or add row numbers.

Export the data to Excel, as a text file, or as an HTML file to


work with in other programs.

Produce Reports, Pivot reports, and Charts that make use of


more elaborate formatting capabilities for presentations.

If you missed items that should be included in the query, you


can go back and add them, then click on Process and run the
query again.

Resize Column Widths


You may have noticed that all of the columns in your results are
the same width. In fact, the standard width is too narrow to
display the values for Division Name. You can adjust the size of
the columns to make it easier to read rows of records. To do this,
1. Click once on the grey area at the top of the Division Name
column to highlight the entire column.
2. Try these two techniques

Place the mouse pointer on the right column divider (the


cursor becomes) and drag the divider a small amount
to the right.
Result: The Division Name column becomes wider.

Place the mouse pointer on the right column border and


double-click or press <Ctrl> - E (Windows) or
<command> - E (Mac).
Result: The column automatically widens so that all of
the text is displayed on one line:

Page 26

9/3/2015

AAUDE Data Warehouse

Figure 14: Widening the Division Name column

Wrap text in a column


If widening a column makes it harder to view the results, you
can make the text fit into a narrower column. This is called
wrapping text and BrioQuery has a command called Text Wrap
under the Format menu that will carry out this task. Well use
the Text Wrap command with Division Name.
1. Click on the Division Name column and make it smaller by
dragging the right border to the left. Make it to the size
where you can see only Arts & Sci.
2. Highlight the Division Name column and choose Text Wrap
from the Format menu.
Result: The text in each row wraps and the rows deepen to
accommodate the multiple lines of text.

Figure 15: The effect of the Text wrap feature

9/3/2015

Page 27

AAUDE Data Warehouse

Move columns
You can change the order of the columns in your results simply
by clicking and dragging a column to a new location. Well try
this out by moving the Division Name column to the left of the
Unit Id column.
Click on the Division Name column; drag it to the left of the
Unit Id column, then release the mouse button.
Result: The Division Name column is positioned to the left of
the Unit Id column.

Figure 16: The results of moving the Division Name


column

EXERCISE 1
Try creating your own query and processing the results.
FromtheFilemenu,chooseNewtostartanewquery.

Page 28

UsingtheCip_Cross_Faculty_Salary,createthefollowingquery:

Retrieve Academic Year, Unit Id, Aaude Inst Code, Institution


Name, Division Code, Division Name, Department,
Department Name, Input Cip Code, Cip Program Code, Cip
Program Title, Cip Four Digit Code, Cip Four Digit Title, and

9/3/2015

AAUDE Data Warehouse

Cip Category Code..

Set the following limits:


AcademicYearmustbeequalto20002001
InstitutionNamemustequaltoMissouriandOhioState
HINT:Tocreatetwolimits,justcarryouttheprocedurethatyou
learnedforcreatingalimittwice.

Sort by:
Institution Name and Division Name.
HINT:RemembertodragtheitemsfromtheRequestLinetothe
SortLine..

Nowprocessthequery.

4. SavethequerywiththeresultsandnameitExercise1
Well use the results from this query to try out some of the things
you can do with query results. Your results should look
something like this:

Figure17:ResultsofthequeryfromExercise1
The status bar should report the number of rows that have been
retrieved; in this example the number will be approximately 186.

EXPORTING DATA INTO OTHER FILE FORMATS

You can export the results of a query to Lotus, an Excel


spreadsheet, a text file with tab- or comma-delimited records, or
an HTML file. There may be situations where you'll find that
working with the data in another program accomplishes your
needs better than working with it in BrioQuery. For example,
you may need to incorporate data that youve retrieved with

9/3/2015

Page 29

AAUDE Data Warehouse

BrioQuery into an existing Excel spreadsheet to produce some


specific reports.
To export data, you use the Export command under the File
menu and choose the format in which you want to export. To try
this out, well export our data into a text file.
1. If its not already selected, click on the Results in the section
pane.
2. From the File menu, choose Export>Section.
Result: A dialog box appears where you can name the file
and choose the type in which you want to save it.

Figure 18: The Export Section dialog box


3. Click on the dropdown menu at the bottom of the dialog and
choose Text (Tab delimited).
4. Leave the name as is in the Export Section box, and click on
Save.
Result: A text file is stored in the BrioQuery installation
folder on the hard disk. You can open and work with this file
in any program that opens text files.

THE RELATIONSHIP BETWEEN TABLES

If youve looked at other queries youve probably noticed two


lines that have an equal sign in the middle of them and seem to

Page 30

9/3/2015

AAUDE Data Warehouse

be connecting two tables. These lines represent what BrioQuery


refers to as Joins. Joins are a method of establishing
relationships between two or more tables. This lets you retrieve
data from more than one table by creating and processing just
one query. If you try to process a query that involves two or
more tables and you dont have Joins set up, the query wont
work, i.e., youll either get a set of incorrect results, an error
message, or both.
Cip_Cross_Faculty_Salary and Aaude_Faculty_Salary_Detail
have two items in common: Cip Cross Facsal Compare Key and
Warehouse Load Date so Joins are possible between these two
items. These two Joins were automatically made as soon as we
had both tables open because a feature called Auto-Join is
turned on. Auto-Join is turned on by default when you start up
BrioQuery and it automatically joins all items between tables to
be queried that have the same name and data type.
However, for purposes of querying the AAUDE Data Warehouse,
Auto-Join should be turned off and Joins should be done
manually. The reason for turning it off is because some of the
tables in the Data Warehouse have many of the same items. If
you happen to choose two or more tables for querying that
contain many of the same items, the Auto-Join feature will create
Joins for all of them. Having this many Joins may cause
problems when trying to retrieve data and will be very
inefficient.

Turning off Auto-Joins

To turn off Auto-Join, from the DataModel menu, choose


Data Model Options. Select the General tab and deselect
Auto join tables.

Result: The next time you drag tables into the workspace, no
joins will be made. For tables already in the workspace at the
time you turn off Auto-Joins, the Joins will remain in place.

Deleting an existing Join


To remove a Join,
Click once on the Join line, then press <delete> Mac or

9/3/2015

Page 31

AAUDE Data Warehouse

<Backspace> Windows.

Result: The Join line is removed.

Setting up Simple Joins


The procedure to set up Simple Joins between tables is easy,
however determining which items with which to create a Join can
be a little more complicated. (It is possible to set up other kinds
of Joins such as Left and Right Joins, however these techniques
are for the advanced user so we wont cover it in this class.)
The results of a query that involves items from two or more
joined tables is determined by the intersection of items that are
joined. So BrioQuery will look for data thats associated with the
Joined items, in all Joined tables, using the criteria you indicated
in your query. Its best to set up a Join using an item that can be
a unique identifier for the records you want to retrieve.
For example, Cip_Cross_Faculty_Salary and
Aaude_Faculty_Salary_Detail contain detail records about
faculty salaries at a given Institution. Both tables have data in
them that are related to Institutions and faculty salaries at that
Institution, etc. So we can join the two tables on some unique
item related to Institution. Cip Cross Facsal Compare Key would
be the best choice because we know that this item is uniquely
different for each Institution. By making this Join, weve
expanded the number of items of information available for each
Institution from those in one table to those in two.
Field names that have the word key at the end are for the
purpose of joining tables. Do not use key fields in your queries.
Each time you create a query with more than one table, you need
to set up Joins so that each table is linked to another table, like a
line of people holding hands. After processing a query, if you
get no results, or you get an error about joins not being made
properly, go back and make sure youve set up valid joins.
To set up the Join,

Page 32

9/3/2015

AAUDE Data Warehouse

Click on Cip Cross Facsal Compare Key in either the


Cip_Cross_Faculty_Salary or the
Aaude_Faculty_Salary_Detail table and drag it on top of the
same field name in the other table.
Result: A line appears with an equal sign in the middle.

Join

Tables

Figure 19: Example of a simple join

STAR SCHEMA
Fact Tables
The fact tables contain the basic/detail information that you want
to look at, the numbers and dates. These tables can be very large
in the order of millions of rows. The numbers you are going to
sum up (or put in the lower right box in the outliner) are usually
located in the fact tables. Normally you will not put limits
directly on a field in a fact table. Also never do a show values
on a fact table field, because it will take forever. (If you need to
know the possible values use show remarks). The Fact tables
can be identified by their names. Fact tables generally contain
the word Detail, Balance, or History in the title of their
name.
Examples of fact tables Aaude_Faculty_Salary_Detail,
Ipeds_Completion_Detail, Ipeds_Staff_By_Emptype_Detail,
Cupa_Admin_Salary_Detail, and Nsf_Gss_Enrollment_Detail.

9/3/2015

Page 33

AAUDE Data Warehouse

Dimension Tables
The dimension tables are designed especially for selection and
grouping. These tables are much smaller. They contain fields
that can be used to limit your queries or group numbers in your
report.
Examples of dimension tables are Cip,
Cip_Cross_Faculty_Salary, Institution,
Cupa_Hiring_Demographic, Academic_Year, Fiscal_Year,
Nsf_Gss_School, etc.
Most tables have fields created to make joining information easy.
These fields are generally listed at the top of the tables and have
names suffixed with key such as Academic_Year_Key,
Institution_ Key, Nsf_Discipline_Key, etc.
Knowing about the stars, facts and dimensions will help you get
familiar with the data quickly. There are only a few fact tables to
choose from. The dimension tables generally are reused with
different fact tables, so once youre familiar with the CIP or
Cip_Cross_Faculty_Salary tables; for example, you can use it to
create many different stars. Dimension tables are those that do
not contain the word Detail, Balance, or History in their
name.
Now, to put together a typical query you would create a basic
star. First you would begin by deciding which fact table is
needed. (Note, that there are many reports that do not really even
use a star such as a CIP Cross Walk report.) Generally you
should only use one fact table, and you would drag this to the
middle of your query screen. Then youd decide which of the
dimensions to use. You can use any number, but the fewer the
better. You would normally connect each dimension table with
the fact table using the key fields. Each dimension would only
have a single connection to the fact table, and there would be no
connections between dimensions. Every table used must be
connected to something. When you have a properly constructed
star, you should have an efficient way to limit and get the
information you want. You will also reduce the chances of
getting the wrong result. An improperly joined query can

Page 34

9/3/2015

AAUDE Data Warehouse

produce either no results or the wrong ones (typically by


duplicating rows).

Creating the Star


Before you begin building your query you should ask yourself
what question your query will answer. Suppose you want to
create a query to compare AAUDE Faculty salaries by CIP. You
might want to look for certain institutions, faculty ranks,
appointment types, departments, academic years, and CIP
categories.
To create such a query you might think about the fact that you
would use first. In this example we will use the
Aaude_Faculty_Salary_Detail table as the fact. You know that it
is a fact because it contains the word _Detail as part of the title.
Since we want to compare the salaries of AAUDE faculty it is
obvious that we would select the Aaude_Faculty_Salary_Detail
table.
Once you have selected the fact table the dimensions are easy to
identify. Remember that the _key items in the facts are named
for the dimension tables that you can join with. The
Aaude_Faculty_Salary_Detail table contains seven _key items.
They are: Academic Year Key, Institution Key, Aaude Facsal Rank
Key, Cip Key, Secondary Cip Key, Aaude Facsal Department Key,
and Cip Cross Facsal Compare Key.
Since we have said that we want our query to look for certain
institutions, faculty ranks, appointment types, departments,
academic years, and CIP categories then we know that we want
to use the Institution dimension table, the Aaude_Facsal_Rank
dimension table, the Aaude_Facsal_Department dimension table,
the Academic_Year dimension table, and the Cip dimension
table. The Cip table contains both the Cip Key, Secondary Cip
Key items.
Once you have the identified facts and dimensions you can now
create your joins. Remember you will join each dimension to the
fact once and only once.
Your query should look something like this:

9/3/2015

Page 35

AAUDE Data Warehouse

Figure 20: Example of a star schema


Onceyouhavethequeryconstructedproperlyyoucandeterminewhat
dataitemsyoumightwantretrievedinyourreport.Youcanselect
thesefromthetablesanddragthemontotherequestline.
Forthisquerywemightwanttoselectthefollowingdataitems:
Institution

InstName
Aaude_Facsal_Rank

AppointmentType

FacultyRank
Aaude_Facsal_Department

DepartmentAbbreviation
Academic_Year

AcademicYear
Cip
CipCategoryCode
CipCategoryTitle
CipFourDigitCode
CipFourDigitTitle
CipFourProgramCode
CipProgramTitle
Aaude_Faculty_Salary_Detail

Page 36

9/3/2015

AAUDE Data Warehouse

AverageSalary
FacultyFte

Next,decideuponyoursearchcriteria.Rememberwesaidthatwe
wantedtolookforrowsthatbelongedtocertaininstitutionsfora
particularsetoffacultyranks,appointmenttypes,departments,
academicyears,andCIPcategories
Wewilladdthefollowinglimitstoourquerybydoubleclickingonthe
dataiteminthetableorselectingtheitemanddraggingittothelimit
line.
Limitthequerytoreturn:
1. AcademicYearequalto20002001
2. FacultyRankequaltoAssistantProfessor,AssociateProfessor,
Professor
3. InstNamebeginswithCal
4. AppointmentTypeequalto910monthand1112month
5. CipCategoryTitleequaltoanypossiblevalue
Sortby
1.
2.

CipProgramCode
InstName

Yourcompletedqueryshouldlooksomethinglikethis:

Figure 21: Completed Query


Dont forget to save the query. Before you process it you might

9/3/2015

Page 37

AAUDE Data Warehouse

want to verify the number of rows that would be returned. This


query should return approximately 1047 rows of data.

Figure 22: Sample rows from results

USING DATA FUNCTIONS ON THE QUERY SCREEN


If you are creating a query where you are not interested in
individual line items but sum/totals/counts/etc of data you
can use data functions on your query.
1.
2.
3.
4.
5.
6.

From the Query Section Tab delete the Aaude_Facsal_Rank


Table
On the request line highlight the data item Average Salary
From the Query menu, choose Data Functions and then
Average.
On the request line highlight the data item Faculty Fte
From the Query menu, choose Data Functions and then
Sum.
Process and Save your query again

CREATING A COMPUTED COLUMN


Sometimes you may want to add a column that is calculated
from columns in your Query or Results sections. To do this, you
can use the Add Computed Item command under the Results
menu. You can carry out this procedure either when youre
creating the query or when working with the results.
NOTE: A computed column is a scalar function, i.e., for every

Page 38

9/3/2015

AAUDE Data Warehouse

value, you get another value. It is not an aggregating function,


i.e., summarizing.
Inthisexercise,wewillcreateanitemcalled NineMonthSalary.We
willusetheAddComputedItemcommandtocalculate NineMonth
Salary.

From the Results menu, choose Add Computed Item...


Result: The Computed Item dialog box appears:

Figure 23: The Add Computed Item dialog box


This dialog box lets you assign a name to the new column
and create an equation that produces the desired results. It
also provides some tools for creating the equation:

9/3/2015

The Definition area is where you enter the equation. You


can either type in the equation or use the buttons in the
dialog box to build the equation by pointing and clicking.

The two rows of buttons below the Definition list, are


called Hotstamp buttons can be used for entering
mathematical operators. Notice that you can do usual
math functions as well as comparisons, conditional and
mod. You can create very sophisticated computations.

Use the Functions button to go to another dialog box that


lets you choose from a number of pre-made functions
such as date, and math, that you click on to automatically
enter these functions into the Definition area.

Use the Reference button to get a list of the items in your


query and click on the ones you need to have them
automatically entered into the Definition area.

Page 39

AAUDE Data Warehouse

Even though its easy to type an item name, e.g., salary


you shouldnt do this. By clicking on an item, youre
building SQL code. More information is associated with
each item you click on which is necessary for successfully
building SQL code. Typing the item name will omit the
additional information.

1.

Change the Name from Computed to Nine Month


Salary just by typing the new name. (When the dialog
box opens, youre positioned to enter a new name.)

2.

Using the Hotstamps button click on the if button

Result: An if ( ) { } appears in the definition box.

3.

Click in between ( ) in the definition box.

4.

Click on the Reference button.

Result: The Reference dialog box appears:

Figure 24: The Reference dialog box


This dialog box lets you locate, then select items that you
want to use in the equation youre building:
The Topic list lets you choose from the list of items in the
Request Line.

5.

From the Items list, click once on Appointment Type,


then click on OK.

Result: Appointment Type appears in the ( ) within the


definition box.

Page 40

9/3/2015

AAUDE Data Warehouse

6.

Using the Hotstamp button click on the == button

Result: == appears next to (Appointment Type in the


definition box.

7.

Enter"910month".

Result: 910month appears next to (Appointment Type = = in


the definition box.

8.

Clickinsidethe{}.

9.

ClickontheReferencebutton.

Result:TheReferencedialogboxappears.
10.

From the Items list, click once on Average_Salary.

Result:Average_Salaryappearsinsidethe{}inthedefinition
box.
11.

Click on the else hotstamp button.

Result:else{}appearsnextto{Average_Salary}inthe
definitionbox.
12.

Clickinsidethe{}aftertheelse.

13.

ClickontheReferencebutton.

Result:TheReferencedialogboxappears.
14.

FromtheItemslist,clickonceonAverage_Salary.

Result:Average_Salaryappearsinsidethe{}followingelse
inthedefinitionbox.
15.

Type*.8182

Result:*.8182appearsnextto{Average_Salary
16.

9/3/2015

ClickontheOKbutton.

Page 41

AAUDE Data Warehouse

Result:ThecolumnNineMonthSalaryappearsontherequest
lineandintheresultset.

Figure 25: The completed definition for Nine Month Salary.

Figure 26: The results with the new column Nine Month Salary.

EXERCISE
Inthisexerciseyouwillbuildaquerythatcomparesthefacultysalaries
ofvariousinstitutionsagainstyourinstitutionusingyourCIPCross
Page 42

9/3/2015

AAUDE Data Warehouse

Walk.Thesearchcriteriaforthisquerywillinclude:yourinstitution,
thelistofinstitutionstocompareagainst,academicyear,divisionname,
departmentname,andfacultyrankandappointmenttype.

Openanewquery.

Selectthefollowingfactanddimensiontablesfromthetable
catalog
FactTable:
1. Aaude_Faculty_Salary_Detail
DimensionTables:
1. Institution
2. Academic_Year
3. Aaude_Facsal_Rank
4. Cip_Cross_Faculty_Salary

Jointhetablestogether

Hint:Remembertousethe_Keyitems.Jointhe
Cip_Cross_Faculty_Salarytabletothe
Aaude_Faculty_Salary_DetailwiththeCipCrossFacsal
CompareKey.

9/3/2015

Addthefollowingitemstotherequestline
1. InstitutionName
(Note:Thiswouldbethenameof
yourInstitution.)
2. DivisionCode
3. DivisionName
4. Department
5. DepartmentName
6. CipProgramCode
7. AcademicYear
8. InstName
(Note:Thiswouldbethenamesof
theInstitutionsthatyouwishto
comparetoyourownInstitution.)
9. FacultyRank
10. AppointmentType
11. AverageSalary
12. FacultyFte
Createthefollowinglimits:
1. AcademicYearequalto20002001
2. InstitutionNameequaltoTexas
Page 43

AAUDE Data Warehouse

(Note:Thiswouldbethenameof
yourInstitution.)
3. Division Name equal to ARCHITECTURE, BUSINESS
ADMINISTRATION, EDUCATION, and
ENGINEERING

4. DepartmentNamenotequaltoPetroleumEngr
5. InstNameequaltoCalBerkeley,CalLosAngeles,
Michigan,MichiganState,Minnesota,Ohio
State,Texas,andWashington
6. FacultyRanknotequaltoLecturer
7. AppointmentTypeequalto1112monthand910
month

Processthequery
Thisqueryshouldreturnapproximately429rowsofdata

Savethequerywiththeresults.

Figure 27: The results.

Onceyougettheresultstheremightbesomeadditionalitemsthat
youwouldliketocreatebasedondatathatyouretrieved.For
example;computedcolumnsorcolumnsthatwillallowyouto
groupdatatogether.

Createthefollowingcomputedcolumns:
1. NineMonthSalary
Calculation:if(Appointment_Type=="910
month"){Average_Salary}else
{Average_Salary*0.8182}
2. Salary*FTE
Calculation:Nine_Month_Salary*Faculty_Fte

Page 44

9/3/2015

AAUDE Data Warehouse

3. Grouping
Calculation: if (Institution_Name = = Inst_Name)
{Institution_Name} else {"AAU"}

Figure 28: The results with the computed columns.

PIVOT REPORTS
One kind of report that you can produce in BrioQuery is called a
Pivot Report. This report is similar to a spreadsheet. You use
this kind of report when you want to aggregate data and to view
data from different perspectives. For example, if you've created a
query that compares the faculty salaries of various institutions
against your institution by CIP, you can create a Pivot report that
lets you view the totals of these records and group the
Institution and at a higher level by using the GroupingsAAU
and Texas that you just created. In addition, you can examine
the totals Rank Type. These different views of the data are easily
accomplished by using the Pivot report.

Creating a Pivot
Now well create the Pivot:
1. From the Insert menu, choose New Pivot.
Result: The Pivot section is displayed along with the Outliner.

9/3/2015

Page 45

AAUDE Data Warehouse

Figure 29: The Pivot outliner.


The top and side labels are where you place field names from
the Request Line that you want to use to organize the
numerical data that makes up the body of the Pivot.
Numerical items are placed in the Facts area of the outliner.
Numerical items are automatically totaled by the result of the
top and side labels, i.e., you dont see every entry for the field
as you do in the Results section.
2. Set up the Pivot by dragging the following field names from
the Request Line into the Outliner:

Faculty Rank into the top label area


Grouping and Inst Name into the side label area
Faculty Fte and Salary*Fte into the facts area

Result: The Pivot report should look something like this:

Figure 30: Sample of the Pivot.

Creating Computed Items in the Pivot


You can also create computed items right in the pivot. To do this
click anywhere in the body of the Pivot. From the Pivot Menu

Page 46

9/3/2015

AAUDE Data Warehouse

Bar select Add Computed Item. Use the technique that you used
on the results section tab to create a column called Salary.
Salary is calculated by dividing Salary_FTE by Faculty Fte.
You can also hide columns on a Pivot. Click on the Salary*FTE
column in the body of the Pivot. From the Pivot Menu Bar select
Hide Items.

Figure 31: Revised Pivot Report.

Drilling down into data


BrioQuery has another command you can use in a Pivot that lets
you zoom in on data. The command is Drill Anywhere. It
allows you to display more detail about an item by expanding
subcategories.
Drill Anywhere lets you focus on any of the fields you put in the
request line for the query and any computed or grouping
columns you've added in the Results section.
For this exercise, well drill into one of the Institutions.
1. Click once on the Institution Ohio State.
Result:Aborderappearsaroundit.
2. FromthePivotmenu,chooseDrillDownInto>Department
Name.
Result: The Pivot Report re-displays showing just Ohio State

9/3/2015

Page 47

AAUDE Data Warehouse

with Department Name added as a column:

Figure 32: Example of drilling down in a Pivot Report.


4. To return to the previous view, select the date by clicking
once on the tab at the bottom of the Department Name
column, or clicking in the selection area above the name,
then from the Pivot menu, choose DrillUp.
Result: The Pivot Report returns to the previous view.

Adding totals and subtotals to a Pivot


You can add subtotals and totals of data items in your pivot
report. You can also change the data values in your report to
view other data functions such as count, average, etc. By default,
data values are displayed as sums. Once your Pivot is created,
you can easily change the values to count, average, and a number
of other Data Functions.
To add a grand total,
1. Click on the tab of the outer column, in this case, its the
Grouping column.
2. From the Pivot menu, choose Add Totals.
Result: A grand total for the Grouping column appears at the

Page 48

9/3/2015

AAUDE Data Warehouse

bottom of the report. To add subtotals,


1. Click on the tab of the inner column, in this case, its Inst
Name
2. From the Pivot menu, choose Add Totals.
To remove subtotals or totals, click on a subtotal, or the total to
select it, then press Delete.
To change the data values,
1. Select the Actual Amount column.
2. From the Pivot menu, choose Data Function, then choose the
type of function you want to display. For this exercise,
choose Count.
Result: The data values change from sums to counts of
entries.
3. From the Pivot menu, choose Data Function>Sum to return
the display to sums.

9/3/2015

Page 49

AAUDE Data Warehouse

EXERCISE
Inthisexerciseyouwillbuildaquerythatsummarizesthefaculty
outlayandfacultycount(tenuredandnontenured)foreveryAAUP
Institution.Thesearchcriteriaforthisquerywillincludeacademic
year,facultyrank,andcontracttype.

Openanewquery.

Selectthefollowingfactanddimensiontablesfromthetable
catalog
FactTable:
1. Aaup_Faculty_Salary_Detail
DimensionTables:
1. Institution
2. Academic_Year
3. Aaup_Facsal_Rank

Jointhetablestogether

Hint:Remembertousethe_Keyitems.

1.
2.
3.
4.
5.
6.
7.

Page 50

Addthefollowingitemstotherequestline
InstName
AcademicYear
FacultyRank
ContractType
Gender
SalaryOutlay
FacultyCount

9/3/2015

AAUDE Data Warehouse

8. TenuredFacultyCount
9. AcadYearConversionFactor

1.
2.
3.

Createthefollowinglimits:
AcademicYearequalto20002001
ContractTypeequalto1112monthand910month
FacultyRankequaltoAssistantProfessor,Associate
Professor,orProfessor

Processthequery
Thisqueryshouldreturnapproximately600rowsofdata

Createacalculatedcolumn:
AcadYrAdjsalaryoutlay
Thecalculationis:
if(Contract_Type=="1112month")
{Salary_Outlay
*Acad_Year_Conversion_Factor}else
{Salary_Outlay}

Savethequerywiththeresults.

Create3PivotReports:
1. Namethesection:AvgByRank
Theoutlinershouldcontainthefollowingdataitems:

Figure33:ExampleoftheAvgByRankoutliner

CreateacalculatedcolumninthePivot
Name:AdjAcadYrAvergeSalary
Definition: Acad_Yr_Adj_salary_outlay /
Faculty_Count

2. Namethesection:AvgByGender
Theoutlinershouldcontainthefollowingdataitems:

9/3/2015

Page 51

AAUDE Data Warehouse

Figure34:ExampleoftheAvgByGenderoutliner.

CreateacalculatedcolumninthePivot
Name:AdjAcadYrAvergeSalary
Definition: Acad_Yr_Adj_salary_outlay /
Faculty_Count

3. Namethesection:TenureStatus
Theoutlinershouldcontainthefollowingdataitems:

Figure35:ExampleoftheTenureStatusoutliner.

CreateacalculatedcolumninthePivot
Name:PercentTenured
Definition:
Tenured_Faculty_Count/ Faculty_Count

Page 52

9/3/2015

AAUDE Data Warehouse

EXERCISE
InthisexerciseyouwillbuildaRetentionResidentTrackingqueryfor
allCaliforniaInstitutionsforthefalloftheacademicyear2000.Select
allinstateandoutofstateresidentsthatenteredin1993.

Openanewquery.

Selectthefactanddimensiontablesfromthetablecatalog

Jointhetablestogether

Additemstotherequestline

Selectyoursearchcriteria(limits):

Processthequery
This query should return approximately 108 rows of data

Buildapivotreport.
SectionNameSummary
The top labels should be Beginning Of Year and Retention
Type.

ThesidelabelsshouldbeInstitutionName,EnteringYear,
Resident,FirstTimeFreshmen,SatVerbalMeanScore,and
SatMathMeanScore.
The values should be Student Percentage. (Display the
percentage as a number with 2 decimal places and the % sign
0.00%)
Turn corner labels on for both the top and side

9/3/2015

Page 53

AAUDE Data Warehouse

EXERCISE

Figure 36: Example of the Summary Pivot Report.

InthisexerciseyouwillbuildaIPEDSCompletionsSummaryquery.
ThisquerywillshowMITssummaryofBachelorDegrees,Doctors
Degrees,andMastersDegreesforacademicyear19992000.This
informationwillbepresentedbyaward(degree)levelconferred,by
gender,andethnicitywithinaprogram(CIP).

Openanewquery.

Selectthefactanddimensiontablesfromthetablecatalog

Jointhetablestogether

Additemstotherequestline

Selectyoursearchcriteria(limits):

Processthequery
This query should return approximately 1134 rows of data

Buildapivotreport.
SectionNameTotalbyEthnicity&Gender
The top labels should be Ethnicity and Gender.

ThesidelabelshouldbeInstName.
The values should be Number of Completions.

Page 54

9/3/2015

AAUDE Data Warehouse

Figure 37: Example of the Total by Ethnicity & Gender Pivot Report.

EXERCISE
InthisexerciseyouwillbuildaquerytolookattheIPEDSFallStaff
Surveydataforacademicyear20012002.Thisquerywillshowa
summaryofalloftheCaliforniaInstitutionsstaffbytype,gender,and
employeestatus(fulltime/parttime).

Openanewquery.

Selectthefactanddimensiontablesfromthetablecatalog

Jointhetablestogether

Additemstotherequestline

Selectyoursearchcriteria(limits):

Processthequery
This query should return approximately 266 rows of data

Build2pivotreports.
1.
Pivot1:
SectionNameSummarybyGender.
Top Labels - Employee Status.
Side Labels - Inst Name and Gender.
Values - Number of Employees and Percentage of Employees.
Add a total for each Institution.

9/3/2015

Page 55

AAUDE Data Warehouse

Figure 38: Example of SummarybyGender Pivot Report.

2.

Pivot2:
SectionNameSummary by Employee Type.
Top Labels - Employee Status.
Side Labels - Inst Name and Employee Type.
Values - Number of Employees and Percentage of
Employees.
Add Total for each Institution.

Figure 39: Example of SummarybyEmployeeType Pivot Report.

Page 56

9/3/2015

AAUDE Data Warehouse

EXERCISE
InthisexerciseyouwillbuildaNSFGraduateStudentSupport
Enrollmentqueryforfiscalyear2000.Thisquerywillincludefulltime
andparttimeenrollmentsforallCaliforniaInstitutionsandtheir
respectiveschoolsbyGenderandEthnicity.

Openanewquery.

Selectthefactanddimensiontablesfromthetablecatalog

Jointhetablestogether

Additemstotherequestline

Selectyoursearchcriteria(limits):

Processthequery
This query should return approximately 288 rows of data

9/3/2015

Build2pivotreports.

Page 57

AAUDE Data Warehouse

1.

Pivot1:
SectionNamebyInstitution.
Top Labels - Fiscal Year and Gender.
Side Labels - Inst Name, School Name, and Ethnicity.
Values - Student Count.
Add Total for each Institution.

Figure 40: Example of the Institution Pivot Report.

2.

Pivot2:
SectionNamebyEthnicity.
Top Labels - Fiscal Year and Gender.
Side Labels - Ethnicity and Inst Name.
Values - Student Count.
Add Total for each Institution.

Page 58

9/3/2015

AAUDE Data Warehouse

Figure 41: Example of byEthnicityPivot Report.

EXERCISE
InthisexerciseyouwillbuildaNSFR&DExpendituresbySourceof
FundsqueryforallCaliforniaInstitutionsforfiscalyears1999and
2000.BuildapivotreportthatshowstheInstitutionsexpendituresby
fiscalyear,fundtype,fundsource

9/3/2015

Openanewquery.

Selectthefactanddimensiontablesfromthetablecatalog

Jointhetablestogether

Additemstotherequestline

Selectyoursearchcriteria(limits):

Page 59

AAUDE Data Warehouse

Processthequery
This query should return approximately 69 rows of data

BuildapivotreportnamedbyInstitutionthatshowsthe
Institutionsexpendituresbyfiscalyear,fundtype,andfund
source.
Add Totals for each fundtypeandfundsource.

Figure 42: Example of the by Institution Pivot Report.

APPENDIX A
CREATING AN OPEN CATALOG EXTENSION

Page 60

9/3/2015

AAUDE Data Warehouse

1. From the File menu, choose New, click on A New Database


Connection File, then click on OK.
Result: The Database Connection Wizard dialog box appears.

Figure 1: The first dialog box for creating an OCE


2. From the Connection Software popup list, choose one of the
following:

PowerMac: choose SQL*Net 2.1 for PowerMac

Windows: choose SQL*Net for Windows NT

3. From the Database Software popup list, choose either Oracle


7.0/7.1 (Mac) or Oracle 7.2/7.3 (Windows).
4. Click Next.
Result: The Data Source Connection Logon box appears.

9/3/2015

Page 61

AAUDE Data Warehouse

Figure 3: The second dialog box for creating an OCE


5. Enter your Username and Password.
6. For Host, enter the name of the machine where the database
resides. (The Data Warehouse host name is aaude.)
7. Click Next.
8. Click Finish. Save the file when prompted to do so..
Result: You are connected to the database.
At any time while youre working with BrioQuery, if you position
the mouse pointer on the Connection icon at lower right, the
status line will display the name of the database to which youre
connected.

Page 62

9/3/2015

You might also like