db2 web query ez-install: building your first report! · db2 web query ez-install: building your...
Post on 30-Jun-2019
231 Views
Preview:
TRANSCRIPT
_____________________________________________________________________________
Page 1 © 2017 IBM Corporation
DB2 Web Query EZ-Install: Building your first report!
Brought to you by the DB2 for i Lab Services Team at QU2@us.ibm.com
_____________________________________________________________________________
Page 2 © 2017 IBM Corporation
Table of Contents
InfoAssist Tutorials ........................................................................................................................... 3
1 Creating Your First Report ........................................................................................................... 3
1.1 Creating a Sub-Folder and Authorizing Users ..................................................................................... 3 1.1.1 Connect to DB2 Web Query ................................................................................................................................. 3 1.1.2 Add Additional Users to DB2 Web Query ............................................................................................................. 4 1.1.3 How to Start InfoAssist ......................................................................................................................................... 6
1.2 Creating a Summary Report (IA1_Revenue) ..................................................................................... 13 1.2.1 How to Create an Initial Report .......................................................................................................................... 13 1.2.2 How to Format a Column ................................................................................................................................... 15 1.2.3 How to Use Aggregation Functions .................................................................................................................... 17 1.2.4 How to Use Auto Drill & Analysis ....................................................................................................................... 19
_____________________________________________________________________________
Page 3 © 2017 IBM Corporation
InfoAssist Tutorials With InfoAssist, you can quickly and easily:
Generate Business Intelligence reports, charts, and documents from any enterprise information source without IT interaction.
Complete tasks, such as building a report, with minimal clicks.
Convert reports to charts, or charts to reports, in a single click.
Output report data in a variety of formats, including HTML, Active Reports, active Flash, PDF, active PDF, Excel, and PowerPoint.
1 Creating Your First Report
1.1 Creating a Sub-Folder and Authorizing Users
1.1.1 Connect to DB2 Web Query
The following screens and instructions depict starting from a browser window.
Bring up Internet Explorer or some other browser of choice.
Go to http://your.system.name:12331/webquery
Sign on as your user id you used when you installed the EZ-Package
The IBM i user profile you entered during the EZ-Install process should be already known to DB2
Web Query as an Administrator.
You’ll be using the Century_Electronics top level folder. Century Electronics is the fictional name of
the company used in the Sample Database (schema QWQCENT) installed as part of the EZ-Install
process. The sample database includes 2 years of data. Those dates could change over time as we
ship new versions of the sample database.
_____________________________________________________________________________
Page 4 © 2017 IBM Corporation
1.1.2 Add Additional Users to DB2 Web Query
You may want to add additional users at this point so they could write their first report and
pursue the self-guided tutorials as well.
In the upper right corner of the BI Portal, select Administration -> Security Center
Bring any existing IBM i User Profiles into DB2 Web Query (during the trial period, you can
add as many users as you like) by clicking on the NEW USER icon in the upper left:
This will give you a list of all the IBM i users on your system. You may want to maximize the security center screen to see a fuller view.
Note in the right hand upper panel that there are six groups for each folder, including
Century_Electronics. Each of these groups can contain multiple users, and defines what operations they can do within that folder.
_____________________________________________________________________________
Page 5 © 2017 IBM Corporation
_____________________________________________________________________________
Page 6 © 2017 IBM Corporation
For now, select the DB2 Web Query Training -> Developer folder. The “Developer” role is
one that allows a user to create and edit reports within that folder, and then publish those
reports so others with access to that folder can operate on it (depending on their authorities
– for instance, someone in the RUN group can only run a published report.
Drop and drag any users you want to set up as report authors under the “developer” role from the left hand panel to the lower hand panel.
When complete, hit the close button.
1.1.3 How to Start InfoAssist
You may want to now create a subfolder just for you if you’re going to have others building
reports in this same Top Level Folder. Note that authorizations are at the Top Level Folder
and permeate down to the subfolders.
Right-click the CENTURY_ELECTRONICS folder you created in the previous step and select
NewFolder.
_____________________________________________________________________________
Page 7 © 2017 IBM Corporation
Give the folder a name that you can refer to that identifies is as yours.
Click OK, and now right click on your new sub folder and select NEW -> Report.
_____________________________________________________________________________
Page 8 © 2017 IBM Corporation
Note that there a lot of options when you did the right click. The number of options you
have on this pop up menu will depend on your folder authorizations set up in security
center. For instance, if you’re not in the “DBA” group within folder “DB2 Web Query
Training” you would not see that Metadata option near the bottom.
In the next window, you will see a list of synonyms that you will build your report over.
Synonyms are a meta data representation of your underlying files/tables (note that they
could also be meta data representations of data returned from an SQL View, a User Defined
Function, an SQL Alias, a Stored Procedure *and* could represent files/tables that reside in
remote databases such as another DB2 for i database, or even a MySQL or SQLServer
database).
Select the CEN_ORDERS synonym. In this case, this synonym actually represents a cluster
of tables JOINED together into a single synonym. This makes it very easy for end users to
not have to worry about the need to, or how to join files/tables together in each and every
report.
_____________________________________________________________________________
Page 9 © 2017 IBM Corporation
Click OK.
After InfoAssist opens up, click on the MAIN MENU button and select OPTIONS
On the Data Panel option, if not already selected, choose “LOGICAL” view and click on OK
_____________________________________________________________________________
Page 10 © 2017 IBM Corporation
This lets you set DEFAULTS for your InfoAssist environment. You can always change these
settings within your InfoAssist sessions, but then the scope is just for that particular
InfoAssist session. Now that you have set it here, you may also need to set it within
InfoAssist (or end InfoAssist and start it again). For now, let’s just make sure it is set in
your InfoAssist session.
Click on the VIEW tab within InfoAssist. Make sure the LOGICAL toolbar is selected:
_____________________________________________________________________________
Page 11 © 2017 IBM Corporation
Note that the Logical button should now be highlighted in a darker blue color which indicates
it is the current selection.
Now if you look at the data panel on the left hand side, you’ll see the columns/fields
available to you for your report.
Note that you can expand selections with the + sign, and collapse with the – sign. You can
also scroll up and down through the data panel.
If you click on the collapse button next to Measures, you should then see a set of
“dimensions.” Fields in the InfoAssist logical view are placed as either Measures (usually
numeric fields) and dimensions (often things that you use as sort fields, like YEAR, or
PRODUCT_TYPE).
_____________________________________________________________________________
Page 12 © 2017 IBM Corporation
Keep this in mind as you work your way through additional tutorials. You may encounter
instructions that ask you to select a column/field but you can’t find it in the data panel. So
be sure to use the expand buttons and/or scroll capabilities within the data panel to look for
it!
_____________________________________________________________________________
Page 13 © 2017 IBM Corporation
1.2 Creating a Summary Report (IA1_Revenue)
The InfoAssist user interface is very similar to the Office 2007 interface. The tab-based ribbon style toolbar logically groups all functions and makes it easy to find the options you need. InfoAssist has built-in intelligence throughout its interface. Toolbars collapse and expand to fit the screen. The ribbon updates as you click in different areas of a report. Data fields are logically categorized as dimensions and measures. You will see much of this throughout the tutorials.
1.2.1 How to Create an Initial Report
Double-click the Product Type field (HINT: You may need to expand the Product Info
sections to see the fields in that dimension).
Note that you can double click the field, drag and drop it on to your Interactive Design View
panel, or drag and drop it on to the Query panel below. All three methods will place Product
Type as the primary By field in a new report.
_____________________________________________________________________________
Page 14 © 2017 IBM Corporation
Compress Dimensions or scroll up in the Data panel on the left until you see the
Measures/Properties heading at the top of the list. Again, you may need to expand the
Measure folder to see all the fields within that.
In the default view, all numeric fields are grouped together under Measures for simplicity.
Double-click Revenue.
Next, we want to add grand totals to our report.
Select the Home ribbon.
If the Report group is not already expanded, click the Report icon on the ribbon to open it.
This is an example where the toolbar will collapse or expand based on the width of the
screen. After you have opened some of the tabs, such as Report, if you then narrow the
width of your screen the system will automatically shrink some of the tabs on the ribbon to
fit.
Click Column Totals in the expanded Report ribbon.
Selecting Column Totals adds a grand total row to the bottom of the report to sum the
numeric data in each column.
_____________________________________________________________________________
Page 15 © 2017 IBM Corporation
Selecting Row Totals would add a grand total column to the right side of the report to sum
the numeric data in each row.
Save your report. Click the Save button at the top of the window, and call the report
IA1_Revenue.
Click the Run button.
Notice the new tab at the bottom of your screen labeled IA1_Revenue(0). This tab displays
your report output results. Your output report looks the same as your Interactive Design
View except that the numbers are larger. You are now processing your full table instead of
only reading the first 500 records.
You can switch between the Design View and the Results View by selecting the appropriate
tab. Instead of having two tabs open close the results panel. This will leave only the
Interactive Design View open.
Click the Close button on IA1_Revenue(0) in the upper right hand corner of the results
view.
1.2.2 How to Format a Column
Back on the Interactive Design View panel, click the Revenue field.
You are going to format this field with commas and dollar signs.
_____________________________________________________________________________
Page 16 © 2017 IBM Corporation
When you select the Revenue field, the ribbon becomes field-specific. Some of the groupings
may already be expanded depending on the width of your screen (in this screen shot it is
already expanded but it may not be in yours, based on the resolution of your screen).
Select the comma .
Select the currency symbol down arrow and then choose Floating currency.
There are many ways to do the same thing in InfoAssist. This means that wherever you are,
you are likely to have quick access to the functionality you need.
Right-click the Revenue field (either on the Interactive Design View as shown in the
following image or in the Query panel) and a submenu displays.
Notice that there is an Edit Format option.
_____________________________________________________________________________
Page 17 © 2017 IBM Corporation
We won’t do anything here – it was just to show you a different technique for getting to the
edit format capabilities. Click the whitespace outside the report to exit this submenu without
executing any instructions.
1.2.3 How to Use Aggregation Functions
You are going to add a count of the number of orders for each product type to the report.
If compressed, expand Dimensions in the Data panel.
Drag Order Number down to Sum - just below Revenue on the Query panel.
Remember that you can also drag it directly onto the report or double-click it to insert it on
the report.
Right-click Order Number, in the Query panel, to open the field-specific submenu.
Select More, then Aggregation Functions and then select Count.
Note: Make sure that
Order Number is
specified as Sum
column and NOT a By
column!
_____________________________________________________________________________
Page 18 © 2017 IBM Corporation
You want to move the Order Number field before the Revenue field. This example will show
you how to reorder your fields if they aren't in the sequence you want.
Select the Order Number field in the Interactive Design View panel.
Notice that an outline is drawn around the field and its values.
Drag the field to the left of the Revenue column.
You will see a red bar indicating where the field will be positioned when you release the
mouse button.
_____________________________________________________________________________
Page 19 © 2017 IBM Corporation
Because you positioned the Order Number column beside the sort field (Product Type), an
additional menu appears. The options are Drop as Sort and Drop as Sum. Drop as Sort
makes the selected field a sort field. For this tutorial, select Drop as Sum.
You can also move the Order Number column by dragging Order Number above Revenue in
the Query panel.
To create a new heading in the Query panel right-click Cnt.OrderNumber to see the field
specific submenu.
Select Change Title and type the new title Order Count.
Click Save.
Run the report.
You have completed your initial summary report. You will return to this report later.
Close the report IA1_Revenue(0) to return to the Interactive Design View.
Save your report.
We will continue to use this report as the basis for our next report.
1.2.4 How to Use Auto Drill & Analysis
Online analytical processing (OLAP) is best known as the technology that allows a user to slice and
dice data or drill down into data. DB2 Web Query makes it easy to provide users with a
sophisticated drill-down, slice and dice interface. All report developers must do to enable this
feature is turn it on in the InfoAssist tool. There is much more to OLAP than is discussed here.
Please see the DB2 Web Query Redbook for a complete OLAP tutorial.
Select the Format ribbon and expand the Navigation group if it is compressed.
_____________________________________________________________________________
Page 20 © 2017 IBM Corporation
Click the little sliver with the down arrow in the Auto Drill & Analysis tool. Once the arrow
is selected, choose Olap Options and then “More options” in the pop up menu.
Select the two options highlighted below. You are providing the end user with some
capabilities to manipulate the data they view in the report. The “Dimensions grouped in
tabs” provides a tabular interface at the top of the report to add additional columns
(interactively) to the report, or filter on various elements of the report. It also lets you set
selection criteria on the fly (“where country does NOT = ‘United States’).
The allow drill down on “Dimensions” enables the non-numeric (typically) fields to allow for
a drill down when clicked on.
Run your report.
_____________________________________________________________________________
Page 21 © 2017 IBM Corporation
The Product Type is automatically highlighted and underlined; this indicates that you can
drill down on this column.
Click Audio.
You just drilled down to Product Category based on “Audio” Product types within a single
report.
_____________________________________________________________________________
Page 22 © 2017 IBM Corporation
Take a look at the tabular interface at the top of the report:
This is where you have a lot of different options in determining what data you want to look
at – ALL WITHIN A SINGLE REPORT.
You can filter the data, for example, choose a specific year by clicking on the down arrow for
a selection of YEAR values in your data. You can even set selection criteria like “where YEAR
does NOT equal yyyy” by clicking on the “=” button and toggling through different
expressions available to you.
So while this report is called “auto drill down” it is really a drill anywhere report. From here
you could save it into Excel, or as an active report, or even as a report that you can come
back to the next day after having iterated through the data to this point.
Very powerful stuff !
Close the results display.
SAVE the report as IA_Revenue_Drill_Down and ….
CONGRATULATIONS – you just created your first auto-drill down report in DB2 Web Query!
Auto Drill & Analysis has much more power than the simple example you just executed. As
mentioned previously, a much more detailed OLAP tutorial is available in the DB2 Web
Query for i Redbook Tutorials, that you can obtain at ibm.biz/db2wqezinstall.
top related