Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
IBM, the IBM logo, and Cognos are trademarks or registered trademarks of
International Business Machines Corp., registered in many jurisdictions worldwide.
Other product and service names might be trademarks of IBM or other companies. A
current list of IBM trademarks is available on the Web at
http://www.ibm.com/legal/copytrade.shtml
While every attempt has been made to ensure that the information in this document
is accurate and complete, some typographical errors or technical inaccuracies may
exist. IBM does not accept responsibility for any kind of loss resulting from the use of
information contained in this document. The information contained in this document
is subject to change without notice.
This document is maintained by the Best Practices, Product and Technology team.
You can send comments, suggestions, and additions to cscogpp@ca.ibm.com.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 3
Contents
1 INTRODUCTION ............................................................................................ 5
1.1 PURPOSE ..............................................................................................................5
1.2 APPLICABILITY .......................................................................................................5
1.3 EXCLUSIONS AND EXCEPTIONS ....................................................................................5
2 INTRODUCTION TO THE IBM COGNOS 10 DYNAMIC QUERY MODE ............ 5
2.1 QUERY OPTIMIZATION..............................................................................................5
2.2 PERFORMANCE IMPROVEMENT THROUGH BALANCED LOCAL PROCESSING FACILITIES .................. 6
2.3 SECURITY-AWARE CACHING .......................................................................................6
2.4 NEW DATA INTERFACES LEVERAGING 64 BIT PROCESSING .................................................. 6
2.5 EASE OF MAINTENANCE WITH QUERY VISUALIZATION........................................................ 6
3 THE IBM COGNOS 10 ARCHITECTURE .......................................................... 7
3.1 ARCHITECTURAL DIAGRAM OF COMPATIBLE QUERY MODE .................................................. 7
3.1.1 Basic Request Flow of a Compatible Query ............................................................8
3.2 ARCHITECTURAL DIAGRAM OF DYNAMIC QUERY MODE .................................................... 11
3.2.1 Basic Request Flow of a Dynamic Query .............................................................. 12
4 CONFIGURING IBM COGNOS 10 DYNAMIC QUERY MODE DATA SOURCE
CONNECTIVITY....................................................................................................... 15
4.1 UNDERSTANDING HOW IBM COGNOS 10 CONNECTS TO ORACLE ESSBASE ............................ 15
4.2 STEP BY STEP EXAMPLE OF CONFIGURING THE ORACLE ESSBASE CONNECTIVITY FOR USE WITHIN
IBM COGNOS 10.............................................................................................................. 16
4.3 ORACLE ESSBASE DATA SOURCE SPECIFIC IBM COGNOS 10 CONFIGURATION SETTINGS........... 17
4.3.1 Treat Nulls as Zeros within Calculations............................................................... 17
4.4 UNDERSTANDING HOW IBM COGNOS 10 CONNECTS TO SAP BW ...................................... 18
4.5 STEP BY STEP EXAMPLE OF CONFIGURING THE SAP BW CONNECTIVITY FOR USE WITHIN IBM
COGNOS 10 (64 BIT ONLY) ................................................................................................. 18
4.6 SAP BW DATA SOURCE SPECIFIC IBM COGNOS 10 CONFIGURATION SETTINGS ..................... 18
4.6.1 Treat Nulls as Zeros within Calculations............................................................... 19
4.7 UNDERSTANDING HOW IBM COGNOS 10 CONNECTS TO IBM COGNOS TM1 ......................... 19
4.8 STEP BY STEP EXAMPLE OF CONFIGURING THE IBM COGNOS TM1 CONNECTIVITY FOR A WINDOWS
INSTALL OF IBM COGNOS 10............................................................................................... 20
4.9 IBM COGNOS TM1 DATA SOURCE SPECIFIC IBM COGNOS 10 CONFIGURATION SETTINGS ........ 22
4.9.1 UseNonEmptyOnDataQueryThreshold ................................................................. 22
4.9.2 UseProviderCrossJoinThreshold .......................................................................... 23
5 IBM COGNOS 10 FRAMEWORK MANAGER AND DYNAMIC QUERY MODE
DATA SOURCES....................................................................................................... 24
5.1 CREATE A PROJECT, DATA SOURCE CONNECTION, AND PACKAGE FOR ORACLE ESSBASE ............ 24
5.2 CREATE A PROJECT, DATA SOURCE CONNECTION, AND PACKAGE FOR SAP BW ...................... 28
5.3 CREATE A PROJECT, DATA SOURCE CONNECTION, AND PACKAGE FOR IBM COGNOS TM1 ......... 32
6 IBM COGNOS 10 ADMINISTRATION........................................................... 36
6.1 ADMINISTRATION FEATURES SPECIFIC TO DYNAMIC QUERY MODE ...................................... 36
6.1.1 Status Tab ........................................................................................................ 36
6.1.2 Configuration Tab.............................................................................................. 36
7 IBM COGNOS 10 CACHING ......................................................................... 45
7.1 ONLINE ANALYTICAL PROCESSING (OLAP) CACHE ......................................................... 45
7.1.1 A Practical OLAP Cache Example......................................................................... 47
7.2 CONTEXT DEPENDENCY........................................................................................... 50
7.3 TO CACHE OR NOT TO CACHE .................................................................................. 51
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 4
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 5
1 Introduction
1.1 Purpose
This document is intended to provide a single point of reference for
techniques and product behaviours when dealing with the Dynamic Query
Mode delivered with IBM Cognos 10.
1.2 Applicability
The techniques and product behaviours outlined in this document apply to:
• IBM Cognos Business Intelligence 10.1 build 4707.541
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 6
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 7
As seen in the picture above, the query mode architecture consists of several
layers. When a report request is received from one of the authoring studios,
the report viewer, or from any other source like the IBM Cognos Software
Development Kit (SDK), it will first be processed by the Query Planning layer.
The upper part of the Query Planning layer is the Query Framework (QFW).
QFW will inspect the report request and determine if it contains one or more
queries, and where the queries should be processed. OLAP style queries, like
those against SAP BW, Oracle Essbase and IBM Cubing Services type data
sources, will go to the OLAP query planner. Relational style queries against IBM
DB2, Oracle, Teradata type data sources will go to the relational query planner.
Dimensionally Modeled Relational (DMR) style queries go to the DMR query
planner.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 8
Each query planner will generate the appropriate query language and send the
request on to their respective query execution layer. For OLAP, the query
planner generates an MDX (Multidimensional Expressions) query and sends it
to the multidimensional data service (MDDS), for relational; it generates SQL
and sends it to the universal data access (UDA) module. For DMR, first a cube
build request is processed which will create and load a temporary cube, then a
new OLAP style query is generated and sent to be processed against that
temporary cube. The lowest layer of the architecture represents the individual
data source types and data sources that IBM Cognos BI supports. Queries
processed through MDDS or UDA will be converted to a query language dialect
that the data source understands and then sent to the data source using either
a direct proprietary interface, or through generic interfaces like ODBC or XMLA.
3.1.1 Basic Request Flow of a Compatible Query
Below is a list of acronyms and their meaning as used when describing the request
flows for various scenarios.
• MQP (Metadata Query Planner) - internal component that prepares
and executes metadata queries
• RQP (Relational Query Planner) - internal component that prepares
and executes relational queries (SQL) against databases
• OQP (OLAP Query Planner) - an internal component that prepares and
executes OLAP queries (MDX) against OLAP data sources
• PCODP (PowerCube/PC OLAP Data Provider) - internal component
that processes MDX and metadata queries against PowerCubes
• PPDS PCA (PowerPlay Data Service / PowerCube Adapter) - internal
libraries for PowerCube data access
• QF (Query Framework) - internal libraries for infrastructure and
integration of metadata queries, data queries, local data processing,
and result sets
• QFS (Query Framework Service) - internal API provided by QF
• QF Planner - converts from V5 Query to SQL or MDX using model
information
• QF Provider - executes and retrieves results corresponding to a query
(V5, SQL, MDX, or metadata)
• RSVP (Report Server) - BIBus service that calls QFS to execute
queries, plans layout and renders reports
• QS - Query Studio
• V5 Query - QF query consisting of data items and result (structure)
definitions
• V5 RS - QF query result set
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 9
The following example outlines the request flow for populating the left had
metadata tree when first opening IBM Cognos 8 Query Studio.
• RSVP opens a session with QFS and sends a metadata request (2)
see qfs_commands.log:
<qs:command><connection><QFProviderType
value="MQProvider"/>...
• QFS hands the request to MQP according to the provider API (3)
see MQProvider_commands.log
• MQP open a session with QF and sends it requests directed at
PowerCubeODP provider (4,5)
see QFS_Commands.log:
<command><connection><dataSourceType
value="PowerCubeODP"/>...
• MQP Prepares metadata response based on PCODP responses (a,b)
and returns it to QFS (c)
• QFS hands the response back to RSVP (d)
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 10
The following example outlines the request flow for retrieving data when a
column is dragged from the left hand metadata tree into the list.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 11
The architecture for the Dynamic Query Mode, although allowing for a very
similar flow of requests, is significantly different from the Compatible Query
Mode. The client layer at the top shows a systems management client which
interacts with the query mode to show metrics and statistics, and also to
change configuration settings such as logging for a running query.
The planning layers have been consolidated into a single one, called the
Transformation Layer. The transformation layer itself does not implement
any query planning logic, it merely provides an execution environment for
query transformations, which are kept in separate libraries called
transformation libraries. This provides for keeping the planning logic separate
from the planning layer. The transformation libraries provide query planning
logic for all supported OLAP queries and also support all functionality that the
query framework provides in the Compatible Query Mode.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 12
The data source adapter layer is very similar to that of the Compatible Query
Mode with the exception of interfaces used.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 13
With the tree in place, the planning process can begin. The transformation
layer will apply an inference process (similar to forward-chaining) and check
for each node in the plan tree to see which query transformations apply to
that node. The query transformations implement the logic that can transform
an IBM Cognos query spec into a MDX query that a target data source can
understand.
This is done in several passes and potentially several iterations per pass until
all possible transformations have been applied.
During this process the transformation layer connects to the IBM Cognos 10
Content Manager through the metadata framework to look up model
information that applies to the query being processed.
When all transformations have been applied, the plan tree has morphed into
a run tree, and is now ready for execution.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 14
The run tree is at the heart of query execution and can consist of many
different types of run tree nodes. Nodes can be SQL execution nodes, MDX
execution nodes, local processing nodes, decoration nodes, and many more.
Results flow from the bottom of the run tree (leaf nodes) to the top (XTree
node) where the result is represented in RSAPI (Resultset API) format and
can be sent to the report service for rendering.
In the example above an MDX query (green nodes) is sent to an MDX data
source for execution. The results returned will go through some decoration
nodes (decoration is an internal process that allows the mode to distinguish
between different parts of a query result), then a node that will flatten the
result (MDX results are multidimensional by nature) and finally a sort node
which will process the flattened result and sort it. This is the simplest form of
an OLAP style query.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 15
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 16
1. From the Start\Run menu type in cmd and hit the enter key. This will
bring up a command prompt window.
2. Within the command prompt window, type in Esscmd and press the enter
key. If the Oracle Essbase client was installed successfully, the Oracle
Essbase command prompt should launch and display the version.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 17
10. The changes to this file will be picked up once a Stop and Start is done on
the IBM Cognos 10 service.
To enable this feature, change the null values to zero. A completed entry
would represent the following.
null.plus.operator=zero
null.minus.operator=zero
null.multiply.operator=zero
null.divide.numerator=zero
null.divide.denominator=zero
null.modulo.dividend=zero
null.modulo.divisor=zero
These changes will be picked up once the IBM Cognos 10 service is restarted.
After the restart, this change will affect all queries against any Essbase data
source through IBM Cognos 10. In a distributed environment, this change
will need to be made on all IBM Cognos 10 servers performing data access.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 18
4.5 Step by Step Example of Configuring the SAP BW Connectivity for use
within IBM Cognos 10 (64 bit only)
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 19
To enable this feature, change the null values to zero. A completed entry
would represent the following.
null.plus.operator=zero
null.minus.operator=zero
null.multiply.operator=zero
null.divide.numerator=zero
null.divide.denominator=zero
null.modulo.dividend=zero
null.modulo.divisor=zero
These changes will be picked up once the IBM Cognos 10 service is restarted.
After the restart, this change will affect all queries against any SAP BW data
source through IBM Cognos 10. In a distributed environment, this change
will need to be made on all IBM Cognos 10 servers performing data access.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 20
The following section provides the steps required to enable IBM Cognos TM1
connectivity for both Compatible Query Mode and Dynamic Query Mode
queries when IBM Cognos 10 is installed on a Windows operating system.
1. After downloading the IBM Cognos TM1 9.5.1 Server install package,
extract the contents of the archive to a directory.
2. Within the directory created in the previous step, double click on the
setup.exe to initiate the installation procedure.
3. Once the upgrade warning message has been thoroughly read, press the OK
button to continue.
4. Click Next.
5. If the license agreement is acceptable, select the I accept… radio button and
then click the Next button to continue with the install.
6. From the available product selection, ensure the TM1 product is selected
before clicking the Next button.
7. Thoroughly read the .Net Framework warning button before clicking the OK
button.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 21
Figure 11 IBM Cognos TM1 Install Screen Displaying the Install Path
and the Custom Install Selection
8. Choose an install path outside of the IBM Cognos 10 directory structure. For
this example the Install to directory will be C:\Program Files\Cognos\TM1.
9. From the available menu option, select the Custom Installation type and click
the Next button to proceed.
Figure 12 IBM Cognos TM1 Install Screen Displaying the TM1 OLEDB
Provider Selected for Install
10. From the available install components, ensure that all the components except
the TM1 OLEDB Provider are omitted from the install.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 22
Figure 13 IBM Cognos TM1 Install Screen Displaying that no Items are
Required for TM1 Client Configuration
11. Clear all the settings and click the Next button.
12. Click the Install button to finish the install.
13. This client library will be picked up once the IBM Cognos 10 service is stopped
and started.
4.9 IBM Cognos TM1 Data Source Specific IBM Cognos 10 Configuration
Settings
The following section discusses any IBM Cognos 10 configuration settings
within the qfs_config.xml file which are available when using IBM Cognos
TM1 as a data source.
4.9.1 UseNonEmptyOnDataQueryThreshold
Impacts: Member fetches for IBM Cognos 10 reports using the Dynamic
Query Mode.
Usage: This parameter controls the decision on whether or not to apply a
NON EMPTY clause on member requests when the number of tuples exceeds
the set threshold. Applying the NON EMPTY clause allows the MDX to only
return members that have measure data. If no measure is projected in the
MDX, the default measure is assumed.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 23
Changes to this file are picked up once IBM Cognos 10 is restarted and are
applied globally on per IBM Cognos 10 install basis.
4.9.2 UseProviderCrossJoinThreshold
Impacts: Member fetches for IBM Cognos 10 reports using the Dynamic
Query Mode.
Usage: This parameter controls the decision on when the NON EMPTY clause
is applied to the query MDX. If the number of tuples, calculated by using the
Cartesian product, exceeds the set threshold; the NON EMPTY clause is
applied to the query. The application of the NON EMPTY clause, alters the
query from returning all members, to just returning those that have measure
values.
By default, this parameter is set to 0 which disables this feature. A value of
greater than one is used to enable this feature. The ideal value for this
setting will vary on a per environment basis, however a good starting point
would be 10000 tuples.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 24
5.1 Create a Project, Data Source Connection, and Package for Oracle
Essbase
Ensure the Oracle Essbase client is installed and configured on the IBM Cognos
10 Framework Manager machine and any IBM Cognos BI servers for
connectivity to Oracle Essbase.
Oracle Essbase data sources must be published to IBM Cognos 10 through
Framework Manager.
1. Open IBM Cognos 10 Framework Manager, and then click Create a new
project.
2. In the Project name box, type the desired name, in this case Oracle
Essbase - GO Sales will be used, and then click OK.
The Select Languages dialog box appears.
3. Select the desired design language, in this case English will be selected, and
then click OK.
The Metadata Wizard appears.
4. Ensure Data Sources is selected, and then click Next.
5. Click the New button to create a new data source connection.
6. In the New Data Source wizard, click Next, in the Name box, type Oracle
Essbase, and then click Next.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 25
8. Click Next.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 26
The next step will be to import a cube and publish it to IBM Cognos 10.
13. Ensure the Oracle Essbase data source that was created is selected, click
Next, and then locate and select the desired cube.
14. Click Next, and then select the desired language for the cube and how
attribute dimensions should be presented.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 27
15. Click Next, leave the Create a default package option selected, and then
click Finish.
16. In the Name box, type an appropriate name for the package, in this case
Oracle Essbase - GO Sales will be used, click Finish, and then click Yes to
open the Publish Package wizard.
17. Follow the wizard instructions making the appropriate configurations required
and click Next until the Options screen is reached.
Notice the Use Dynamic Query Mode option.
18. Select the Use Dynamic Query Mode option, click Publish, and then click
Finish.
The package is now available in IBM Cognos 10 and will use the Dynamic
Query Mode for reports. In IBM Cognos Connection, the type of query mode
used by the package can be verified in the package properties.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 28
5.2 Create a Project, Data Source Connection, and Package for SAP BW
Ensure the SAP GUI is installed and configured on the IBM Cognos Framework
Manager machine and any IBM Cognos BI servers for connectivity to SAP BW.
See section 4.4 for more details.
An SAP BW package can be published directly from IBM Cognos Connection or
through Framework Manager. However, importing SAP BW metadata into
Framework Manager allows for additional modelling and testing before the
package is published. In this example, Framework Manager will be used. For
information on publishing SAP BW packages directly in IBM Cognos
Connection, please see the IBM Cognos 10 Administration and Security Guide.
1. Open IBM Cognos 10 Framework Manager, and then click Create a new
project.
2. In the Project name box, type the desired name, in this case SAP BW - GO
Sales will be used, and then click OK.
The Select Languages dialog box appears.
3. Select the desired design language, in this case English will be selected, and
then click OK.
The Metadata Wizard appears.
4. Ensure Data Sources is selected, and then click Next.
5. Click the New button to create a new data source connection.
6. In the New Data Source wizard, click Next, in the Name box, type SAP
BW, and then click Next.
7. Under Type, select SAP BW.
8. Click Next.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 29
Compatible is the Compatible Query Mode and Dynamic is the new Dynamic
Query Mode.
11. Click Close, click Close again, and then click Finish.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 30
15. On the Generate Dimensions screen, select how you want to display object
names and organize the dimensions.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 31
16. Click Next to import the metadata, and then click Finish.
17. In the Project Viewer, expand the new namespace created for the SAP BW
metadata and notice all the dimensions and key figures have been imported.
For more information about working with SAP BW metadata, please refer to
the IBM Cognos 10 Framework Manager User Guide.
In the next steps, a package will be created and published.
18. In the Project Viewer, right-click Packages, point to Create, and then
click Package.
19. In the Name box, type an appropriate name for the package, in this case
SAP BW - GO Sales will be used, click Next, and then select the objects to
include in the package.
20. Click Next, click Finish, and then click Yes to open the Publish Package
wizard.
21. Follow the wizard instructions making the appropriate configurations required
and click Next until the Options screen is reached.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 32
5.3 Create a Project, Data Source Connection, and Package for IBM
Cognos TM1
Ensure the IBM Cognos TM1 client is installed and configured on the IBM
Cognos Framework Manager machine and any IBM Cognos BI servers for
connectivity to TM1. See section 4.7 for more details.
IBM Cognos TM1 packages must be published through IBM Cognos 10
Framework Manager.
1. Open IBM Cognos 10 Framework Manager, and then click Create a new
project.
2. In the Project name box, type the desired name, in this case IBM Cognos
TM1 - GO Sales will be used, and then click OK.
The Select Languages dialog box appears.
3. Select the desired design language, in this case English will be selected, and
then click OK.
The Metadata Wizard appears.
4. Ensure Data Sources is selected, and then click Next.
5. Click the New button to create a new data source connection.
6. In the New Data Source wizard, click Next, in the Name box, type IBM
Cognos TM1, and then click Next.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 33
8. Click Next.
9. Based on the information provided by the IBM Cognos TM1 administrator,
type in the Administration Host, Server Name, and Signon credentials.
The Administration Host is the name of the physical machine hosting the IBM
Cognos TM1 server(s). The Server Name refers to the name of the cube
being served by an IBM Cognos TM1 server on the administration host
machine.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 34
Compatible is the Compatible Query Mode and Dynamic is the new Dynamic
Query Mode.
10. Click Test the connection, and then click Test.
The results appear as shown below.
11. Click Close, click Close again, and then click Finish.
12. Click Close.
The new data source appears in the list.
The next step will be to import the cube and publish it to IBM Cognos 10.
13. Ensure the IBM Cognos TM1 data source that was created is selected, click
Next, and then select the cube for import.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 35
14. Click Next, and if required, select each dimension and the Alias tables
language you wish to import.
15. Click Next, leave the Create a default package option selected, and then
click Finish.
16. In the Name box, type an appropriate name for the package, in this case
IBM Cognos TM1 - GO Sales will be used, click Finish, and then click Yes
to open the Publish Package wizard.
17. Follow the wizard instructions making the appropriate configurations required
and click Next until the Options screen is reached.
18. Select Use Dynamic Query Mode.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 36
The Scorecard pane indicates which servers, dispatchers, and services are
available and allows for administrative tasks such as starting and stopping the
service or setting properties.
The Metrics pane displays statistics and just as with other services, certain
metrics have configurable thresholds. They are edited by clicking the Edit icon
(pencil) to the right of each metric.
The Settings pane indicates how the selected item in the Scorecard pane is
configured. The Logging and Tuning settings can be edited in this section as
well by clicking on the Set properties icon in the top right corner of the
Settings pane. They can also be edited in the Dispatchers and Services
section under the Configuration tab, which is discussed in the next section.
6.1.2 Configuration Tab
On the Configuration tab, there are four locations pertaining to the Dynamic
Query Service.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 37
Supported data sources for Dynamic Query Mode will indicate a successful
connection through the Dynamic Query service when testing the connection.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 38
Content Administration
Content Administration under the Configuration tab now has a New Query
service administration task icon as shown below.
The tasks available for this new feature are the ability to clear the Dynamic
Query cache (to avoid using outdated data) or to write the cache state (for
cache use analysis) to a file on the IBM Cognos 10 server(s).
For IBM Cognos TM1, there is no caching on the IBM Cognos 10 side;
therefore these tasks do not apply to that data source.
Here you can specify a specific data source, catalog and cube name, or use
the * character to clear all items for any of the entries above.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 39
For example, to write the cache state file for an Oracle Essbase cube, the
settings would be similar to what is shown below.
Note: To find the correct syntax to enter for these tasks, once you have run
a report against the data source in question, you can use the Write cache
state feature (discussed in the Query Service Caching section to follow) to
write the cache state file for all caches. In that file you can see the
appropriate syntax for Data source, Catalog, and Cube for the data source
you are concerned with and enter it in the task wizard.
The Write the cache state setting will write a time-stamped XML file showing
the state of specified caches, which can be helpful to verify caches are being
cleared and for troubleshooting purposes under the guidance of IBM Cognos
development.
The XML file is written to the <C10 Install Location>/logs/XQE directory. The
filename has the following format:
Example:
SALDump_Essbase_GODB_GODB_1281624776529.xml
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 40
When these administration tasks are run, all server groups are affected. In
other words, depending on the task run, each IBM Cognos 10 report server
will either have its cache cleared for the specified data source, or have the
cache state file written to its local logs/XQE directory.
Again, in a practical application, the cache state file can be used to validate
cache clearing as shown below.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 41
The Advanced settings and Audit logging level are standard settings for all
services. Advanced settings allow for additional service settings provided by
IBM for specific and typically less common scenarios.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 42
These files can be analyzed with the Dynamic Query Analyzer which is
covered in Section 9.4 of this book.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 43
The Query Service Caching section under the Configuration tab allows for
manual Dynamic Query cache clearing and writing the cache state to file for
one or more server groups.
For more information on server groups, please see the IBM Cognos 10
Administration and Security Guide.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 44
Again, the Write cache state feature will write a time-stamped XML file to the
<C10 Install Location>/logs/XQE directory showing the state of all caches.
The filename in this instance has the following format:
SALDump_all_all_all_timestamp.xml
In a distributed installation, each report server that has a cache will write the
cache state file to its local logs directory.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 45
The main purpose of the cache is to leverage previously executed results for
reuse and whenever possible, avoid roundtrips to the database. The
performance benefits of the cache will be noticeable when:
• reports are re-executed with small modifications
• analysis is performed within the same cube
• repetitive master detail requests are performed for large reports
The cache loading mechanism is performed as requests are received and
executed.
The basic principle behind the local processing approach, which is the default
DQM behaviour for Oracle Essbase and SAP BW, is to retrieve the basic raw
data from the underlying data source and process everything else locally.
While generalized here since some level of aggregation, filtering, and other
simple functions may still be sent to the data source, the local approach
ensures we avoid pitfalls occasionally incurred when trying to push complex
native SQL/MDX to the querying data source resulting in poor performance.
At this time, only the local processing approach leverages the secured cache.
The local approach to OLAP reporting is broken down into two simple steps:
metadata and data fetch. When a report is executed, we initially retrieve all
members requested (metadata), either by level and/or unique member
inclusion, and then utilize the retrieved members in order to construct the
MDX used for data retrieval (facts). As these calls are performed, for both
metadata and data requests, each result returned is cached and can
potentially be reutilized when further requests are made within the same
context.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 46
SAP BW data sources can still leverage remote processing. This method relies
on the underlying data source to process the entire MDX requests (minus
some exceptions). This capability can be leveraged by changing the query
processing to “Database Only” as explained in the next paragraph. Some
reports lend themselves very well to this type of processing – for example
simple grouped list reports such as target reports for drill-through. In these
scenarios, since the report complexity is greatly reduced, the entire request
will benefit from avoiding the metadata fetch portion and simply retrieve the
data and present it to the user. However, this result will not leverage the
cache and cannot be reused.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 47
The reporting mode will fetch sequentially all members for sales regions,
customers, and products and store the results in the cache.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 48
Figure 48 IBM Cognos Report Studio Report Displaying how the Column
Map to the Metadata Cache
Figure 49 Image Showing the MDX Required for the Data Request
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 49
The simplified constructed MDX will then be sent to the data source to
retrieve the fact data. The result set will initially be stored in the cache to
subsequently produce the desired output.
Figure 50 Image Showing the MDX Required for the Data Request and how
it Links Back to the IBM Cognos Report Studio Report
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 50
Two phases took place here, the metadata phase to extract all requested
members, and a second phase fetching those members with fact data.
At this time, if the report author adds a calculation (i.e. Quantity x Unit Price),
given the calculation involves the same members and the same measures,
the reporting mode can reuse the metadata and data from the previous
request therefore bypassing the data source in order to produce the desired
output. This is possible given what is requested from the database does not
change since calculations are processed locally.
Figure 51 Image displaying the Request Flow using the Cache for a
Calculation
Alternatively, if the user then decides to add another measure from the data
source, we will be able to reuse the metadata (first phase) but will need to
re-execute the data fetch (second phase) given a new measure has been
added.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 51
Another important context is the user. Each data source may/can have the
possibility of securing their data based on proprietary authorization rules and
techniques. Therefore, user X may be entitled to view all data while user Y
may be limited to view a limited portion of the data. As a result, each user id
becomes a context of there own and metadata/data cannot be shared
amongst them.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 52
XQE-PLN-0212 The report nests more than one level from the same
hierarchy but they are not adjacent to each other. Please make levels
from the same hierarchy adjacent.
The following case study will step a user through the transition of a report in
which the Report Author utilizes levels from the same hierarchy in a
nonadjacent format. A crosstab projects the Sales region, Product line, and
the Country respectively on the rows of the crosstab. The Years are projected
on the column. The Quantity is the measure of the crosstab. The report
layout is depicted below:
Figure 52 A Crosstab Projects the Sales region, Product line, and the
Country respectively on the rows of the crosstab. The Years are projected
on the column.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 53
The Sales region and Country are levels from the same hierarchy, where the
Sales region is a higher level than the Country:
When executed in Compatible Query Mode, the report will display the
following output:
If the package of the report above is republished with the Dynamic Query
Mode enabled and the report is re-executed, the user will be presented with
the following error message:
XQE-PLN-0212 The report nests more than one level from the same
hierarchy but they are not adjacent to each other. Please make levels
from the same hierarchy adjacent.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 54
In order to execute this report with no error, the Dynamic Query Mode
requires levels from the same hierarchy be adjacent in the same hierarchical
order. The example report above can be rearranged to run with the Dynamic
Query Mode by nesting the Country immediately next to the Sales region
(Sales region and Country are not split by the Product line):
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 55
XQE-PLN-0213 The report nests levels from a hierarchy which breaks the
hierarchy level order. Please nest levels according to hierarchy level
order.
The following case study will step a user through the transition of a report in
which the Report Author utilizes levels from the same hierarchy in a different
order than defined by the hierarchal structure. A crosstab projects Country
and Sales region respectively on the rows. The Years are projected on the
column, and Quantity is the measure. The report layout is depicted below:
As can be seen above, the Sales region is nested under the Country. This
order of nesting doesn’t agree with the order defined by the Sales regions
hierarchy as shown below:
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 56
When executed in Compatible Query Mode, the report will display the
following output:
If the package of the report above is republished with the Dynamic Query
Mode enabled and the report is re-executed, the user will be presented with
the following error message:
XQE-PLN-0213 The report nests levels from a hierarchy which breaks the
hierarchy level order. Please nest levels according to hierarchy level
order
In order to execute this report with no error, the Dynamic Query Mode
requires levels nested in the same order as specified by the hierarchy. The
example report above can be rearranged to run with Dynamic Query by
nesting the Country under the Sales region:
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 57
XQE-PLN-0215 The report has levels from the same hierarchy on multiple
edges. Please place levels from a single hierarchy on only one edge
The following case study will step a user through the transition of a report in
which the Report Author utilizes levels from the same hierarchy on multiple
edges. Consider the following crosstab:
Figure 62 Crosstab with Sales region is projected on the row edge and
Country is projected on the column edge.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 58
Sales region is projected on the row edge and Country is projected on the
column edge. When executed in Compatible Query Mode, the report will
display the following output:
If the package of the report above is republished with the Dynamic Query
Mode enabled and the report is re-executed, the user will be presented with
the following error message:
XQE-PLN-0215 The report has levels from the same hierarchy on multiple
edges. Please place levels from a single hierarchy on only one edge.
In order to execute this report with no error, the Dynamic Query Mode
requires levels nested in the same order as specified by the hierarchy on a
single edge. The example report above can be rearranged to run with
Dynamic Query Mode by nesting the Country under the Sales region on the
rows:
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 59
8.1.4 Using % of Each Column Total within IBM Cognos Analysis Studio
When using an OLAP based package to create an Analysis Studio report
where two levels of the same hierarchy are on the same edge and the option
to show values as '% of Each Column Total' has been selected, the outputs
for each mode will appear differently.
The scenario below illustrates the difference in outputs of running the same
report in both query modes.
When executed in Compatible Query Mode, the report displays the following
output.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 60
If the package of this report is republished with the Dynamic Query Mode
enabled and the report is re-executed:
In Dynamic Query Mode this will return the percentage of each value versus
in Compatible Query Mode returns the total for the children of the default
member (typically root member).
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 61
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 62
7. Within the Tuning category, locate the Enable query execution trace?
8. To enable the trace, check the checkbox on the right hand side and click the
OK button. The trace configuration change will be picked up automatically
within 15 seconds.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 63
7. Within the Tuning category, locate the Enable query planning trace?
8. To enable the trace, check the checkbox on the right hand side and click the
OK button. The trace configuration change will be picked up automatically
within 15 seconds.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 64
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 65
4. Within the right hand Server section provide the host and the port of the
IBM Cognos server which contains the reports to be analyzed.
5. If the IBM Cognos 10 application has security applied, select a Namespace
from the drop down list, and supply a valid user id (Name) and password.
6. Once completed, click the Apply button to apply the configuration.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 66
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 67
The IBM Cognos Dynamic Query Analyzer has the ability to both, read logs
from a physical drive location, and to read remote logs through an http
connection. The following section will step a user through the setup required
to access the logs through an http connection from a single server IBM
Cognos 10 windows install.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 68
10. Ensure that the Read and Browse permission are set, and then click the
Next button.
11. Click the Next button, then Finish to complete the virtual directory creation.
12. Launch DQA by selecting Start\All Programs\IBM Cognos 10\IBM
Cognos Dynamic Query Analyzer.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 69
15. Within the Remote Log Access section, provide the Logs directory URL
to the previously created virtual directory.
If the previously created virtual directory was secured by the IIS
Administrator, provide a valid Name(UID) and Password. Typically, these
credentials are actual server credentials which may be different from the IBM
Cognos 10 Namespace credentials.
16. Click the Apply button to confirm the changes, before clicking OK.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 70
9.4.3 Running a Report and Viewing the Remote Logs using the IBM
Cognos Dynamic Query Analyzer
With the configuration of the IBM Cognos Dynamic Query Analyzer complete,
the following section will provide the steps required to:
• Enable the Query Execution Trace on the IBM Cognos 10 system.
• Run a report from within IBM Cognos Query Analyzer.
• View the remote logs produced by the report Run.
9.4.3.1 Enabling the Query Execution Trace
The following section outlines how to enable the Query Plan Trace.
1. Within a browser, go to the IBM Cognos Administration portal.
2. Click on the Configuration tab.
3. Select the Dispatchers and Services link.
4. Select the dispatcher link.
5. Within the list if available services, locate the QueryService and click
Properties.
6. Click on the Settings tab to display the categories illustrated below.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 71
7. Within the Tuning category, locate the Enable query execution trace?
8. To enable the trace, check the checkbox on the right hand side and click the
OK button. The trace configuration change will be picked up automatically
within 15 seconds.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 72
3. Within the show view dialog box, select Navigation\Content Store and
click OK. The bottom Content Store pane should now display the IBM
Cognos 10 Public Folder contents as illustrated below.
4. Within the Content Store pane, locate a report and double click on it. For this
example, the report was called R1 located under the package named Basic.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 73
5. Once the report finishes executing, the results will be displayed within DQA as
illustrated below.
9.4.3.3 Viewing the Execution Plan (Runtree) Log within IBM Cognos
Dynamic Query Analysis
1. Within the bottom Content Store pane, traverse the IBM Cognos 10
structure to the report executed in the previous section. For this example the
report will be located under the Basic package as report R1.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 74
2. Under the R1 report, a folder with a date should now be visible, expand this
folder to display the Profile 0 object.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 75
3. Double-click on the Profile 0 object. When the screen finishes loading, the
runtree log will be display in a graphical view.
In this case study a user has created a crosstab report against the Great
Outdoors sample cube provided for Oracle Essbase. The crosstab report
consists of Quantity as the Measure, Product as the row edge and Order
Method nested under Retailer on the column edge. When creating the
report, the user also selected suppression for the rows and columns from the
available toolbar items. For the purpose of this case study the report was
saved as EssbaseVisualNullSupp under the GODB Essbase package.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 76
When this report’s runtree object (profile 0) is viewed within the Dynamic
Query Analyzer, it will display as per the following screen capture.
Within the Graph view for this particular scenario, two items stick out. The
first item is the XV5Suppress node located at the top of the screen and the
MDX timing nodes located at the bottom of the screen. These nodes are
outlined on the screen capture below.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 77
Figure 88 IBM Cognos Dynamic Query Analyzer showing the Timing on the
MDX nodes
The XMDXSelect node is the node which will display the pieces of the actual
MDX query used to satisfy the report request. The scale icon beside node is
used as a visual representation of the performance of the node. The actual
properties of the node are displayed by clicking on the node itself in the
graph view.
<XMdxSelect id = "349" totalElapsedTime = "13623889552" ownElapsedTime
= "11372194645" totalCPUTime = "6093750000" ownCPUTime = "4984375000"
cellProperties = "null" cubeName = "GODB.GODB">
</XMdxSelect>
The properties pane of this node reveals the time spent in the actual node
and the total elapsed time. In this particular case, the time spent in the node
itself was 11372 ms and the cumulative time for the node and its children
was 13623 ms.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 78
</SuppressSpec>
<SuppressSpec EdgeNum = "0" nulls = "true" divByZero = "true" zero =
"true" overflow = "true">
</SuppressSpec>
</XV5Suppress>
Based on the fact that there are two EdgeNum entries and nulls, divByZero
and overflow are all set to true, the properties confirm that a user applied
zero, divide by zero, overflow and null suppression on both the rows and
columns.
At this point, it would be time to ask the report author whether or not they
actually need the divByZero, zero and overflow suppression, or whether or
not they just wanted to suppress nulls. Another good question to ask would
be whether suppression was actually needed on both the rows and columns.
The report author replies back with the statement that only null suppression
is required on both columns and rows. The report author made the change
to the report and saved it as EssbaseVisualJustNullSupp on the same
package. When the runtree plan (Profile 0) for this report is viewed in the
Dynamic Query Analyzer, it should represent the following screen capture.
Figure 89 IBM Cognos Dynamic Query Analyzer showing the Timing on the
MDX nodes
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 79
In this particular run, the time spent in the node itself was 9753 ms and the
cumulative time for the node and its children was 8441 ms.
<XV5Suppress id = "417">
<SuppressSpec EdgeNum = "1" nulls = "true" divByZero = "false" zero
= "false" overflow = "false">
</SuppressSpec>
<SuppressSpec EdgeNum = "0" nulls = "true" divByZero = "false" zero
= "false" overflow = "false">
</SuppressSpec>
</XV5Suppress>
For this report run only nulls are being suppressed on both the row and
column edge of the crosstab. Since the requirement is to only suppress nulls,
the visual null suppression can be replaced by the Null suppression on the
actual query. The report author receives this request and makes the desired
change. The report is saved out as EssbaseQueryNullSupp under the same
package. When the runtree plan (Profile 0) for this report is viewed in the
Dynamic Query Analyzer. The graph should represent the following screen
capture.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 80
Figure 90 IBM Cognos Dynamic Query Analyzer showing the Timing on the
MDX nodes after the change
In this particular run, the time spent in the node itself was 9639 ms and the
cumulative time for the node and its children was 8358 ms.
Notice that since visual suppression has been removed from the report, the
V5Suppress node is no longer present in the graph view.
Business Analytics
The IBM Cognos 10 Dynamic Query Cookbook 81
9.5 Submitting a Dynamic Query Mode Test Case to IBM Cognos Support
In addition to what IBM Cognos support requests for query related support
incidents, the following items should be submitted for a Dynamic Query Mode
query diagnosis:
1. A detailed description of the query problem, along with the desired
query output or expected query behaviour.
2. Data source information such as:
• Data Source Type (Oracle Essbase, SAP BW, TM1)
• Data Source Version
• Connection Sting
• Connectivity Client Version
3. Package deployment and report specifications
4. Configuration/XQE properties file for the specific data source type.
5. Configuration/qfs_config.xml file.
6. IBM Cognos 10 Framework Manager model
7. Query Execution Trace
8. Query Planning Trace
Business Analytics