Cognos 10 Framework Manager
Cognos 10 Framework Manager
Cognos 10 Framework Manager
Version 10.1.0
User Guide
Product Information
This document applies to IBM Cognos Version 10.1.0 and may also apply to subsequent releases. To check for newer versions of this document,
visit the IBM Cognos Information Centers (http://publib.boulder.ibm.com/infocenter/cogic/v1r0m0/index.jsp).
Copyright
Licensed Materials - Property of IBM
Copyright IBM Corp. 2005, 2010.
US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
IBM, the IBM logo, ibm.com, Impromptu, ReportNet, TM1, and Cognos are trademarks or registered trademarks of International Business
Machines Corp., 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 www.ibm.com/legal/copytrade.shtml.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Table of Contents
Introduction
11
13
21
43
Explorer Tree 43
Explorer Diagram 44
Model Accelerator Workspace 45
Query Subject Diagram 45
Relationship Editing Mode 45
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
Table of Contents
Model Warning View 46
Change the Settings for Diagrams 47
Create a Project 47
Create a Star Schema 48
Managing Your Star Schema 50
Chapter 4: Importing Metadata from Data Sources
51
Data Sources 51
Data Source Security 51
Types of Data Source Connections 52
Native Metadata 52
Working With Data Source Connections 53
Create a Data Source Connection 56
Importing Metadata 58
Import Metadata from a Relational Database 59
Import Metadata from an IBM Cognos Model 61
Import Metadata from an Architect Model or an Impromptu Catalog 61
Import Metadata from IBM Cognos DecisionStream or IBM Cognos Data Manager 62
Import from IBM Metadata Sources 66
Import Metadata From Third Party Metadata Sources 69
Troubleshooting Metadata from Other Sources 74
Import Metadata Using XML as a Data Source 75
Import Objects with the Same Name 76
Chapter 5: Modeling Relational Metadata
77
Relationships 78
Cardinality 78
Modify a Relationship 82
Create a Complex Expression for a Relationship 82
Create a Relationship 83
Create a Relationship Shortcut 83
Detect and Generate Relationships 84
Query Subjects 85
Data Source Query Subjects 85
Model Query Subjects 87
Stored Procedure Query Subjects 88
Determinants 92
Create a Model Query Subject Based on Existing Objects 96
View Related Objects 97
Create a Query Set 97
Test a Query Subject or Query Set 101
Validate a Query Subject 104
Update Query Subjects 104
Convert a Query Subject into a Dimension 105
Convert a Model Query Subject into a Data Source Query Subject 106
Edit the SQL 106
Change the Type of SQL 107
Change How the SQL Is Generated 112
Dimensions 114
Normalized Data Sources 114
4 IBM Cognos Framework Manager
Table of Contents
Create a Regular Dimension 115
Sort Members of a Level 121
Roles 122
Create a Measure Dimension 124
Convert a Measure into a Query Item 125
Scope Relationships 126
Create a Regular Dimension Based on Existing Objects 127
View Related Objects 127
Test a Dimension 128
Convert a Regular Dimension into a Query Subject 130
Multilingual Metadata 131
Setting Up a Multilingual Reporting Environment 131
Using a Macro to Model Multilingual Data 134
Add a Language to a Project 134
Export a Translation Table 135
Import a Translation Table 136
Example - Create a Multilingual Project for Relational Metadata 136
Query Items 138
Modifying How Query Items Are Aggregated 141
Format Query Items 148
Define a Prompt Control 149
Convert a Query Item into a Measure 154
Adding Business Rules 155
Create a Calculation 155
Create a Filter 158
Apply a Filter 160
Example - Show the Currency Name for Each Country 162
Create a Parameter Map 163
Example - Specifying a Language Value for Relational Metadata 165
Create a Session Parameter 165
Using Parameters with Relational Data Source Query Subjects 167
Creating Prompts with Query Macros 168
Organizing the Model 179
Create a Star Schema Group 180
Use Shortcuts 184
Create a Folder or Namespace 187
Create a Query Item Folder 188
Create a Measure Folder 188
Create a Durable Model 189
Analyze a Model 191
Chapter 6: Working with SAP BW Metadata
197
User Guide 5
Table of Contents
Test a Dimension or Other Object 213
Working with Model Query Subjects 216
Query Items 219
Modifying How Query Items Are Aggregated 222
Format Query Items 225
Define a Prompt Control 226
SAP BW Variables 230
Numeric Variable Property Values 234
Characteristic Variable Property Values 235
Picklist Prompts 237
Adding Business Rules 237
Create a Calculation 237
Create a Filter 239
Apply a Filter 242
Create a Parameter Map 243
Create a Session Parameter 245
Organizing the Model 246
Use Shortcuts 247
Create a Folder or Namespace 248
Chapter 7: Publishing Packages
251
271
Table of Contents
Project Reuse 292
Model Portability 294
Synchronize Projects 301
Query Behavior 304
Set Governors 304
Specify Where Aggregate Rollups are Processed 311
Improve Performance by Setting Query Processing Type 312
Improving Performance by Reusing Cached Data When Running a Report 313
Select Function Sets 314
Quality of Service 315
Control and Optimize How Queries Are Run 317
Chapter 9: Guidelines for Modeling Metadata
319
351
365
375
User Guide 7
Table of Contents
Error for Type-In SQL Query Subject 377
QE-DEF-0259 Error 377
Externalized Key Figures Dimension Retains Old Prompt Value 378
Older Models Display Level Object Security 378
Exporting a Framework Manager Model to a CWM File Fails With Error MILOG.TXT was
not found 378
Difference in SQL for Inner Joins After Upgrading to IBM Cognos BI, Version 8.3 and Later 378
Full Outer Joins Not Sent to Oracle 9i and 10GR1 379
Unexplained Discrepancies in Number Calculations 379
381
571
575
Table of Contents
Calendar Type 575
Clock 575
Currency 575
Currency Display 576
Currency Symbol 576
Currency Symbol Position 576
Date Ordering 576
Date Separator 576
Date Style 576
Decimal Separator 576
Display AM / PM Symbols 576
Display As Exponent 576
Display Days 577
Display Eras 577
Display Hours 577
Display Milliseconds 577
Display Minutes 577
Display Months 577
Display Months 577
Display Seconds 577
Display Time Zone 577
Display Weekdays 577
Display Years 578
Display Years 578
Divide By Zero Characters 578
Exponent Symbol 578
Group Size (digits) 578
International Currency Symbol 578
Mantissa (digits) 578
Maximum No. of Digits 578
Minimum No. of Digits 579
Missing Value Characters 579
Negative Pattern 579
Negative Sign Position 579
Negative Sign Symbol 579
No. of Decimal Places 579
Numeric Overflow Characters 579
Padding Character 579
Pattern 579
Percentage Symbol 580
Percent Scale (integer) 580
Scale 580
Secondary Group Size (digits) 580
Security Error Characters 580
Thousands Separator 580
Time Separator 580
Time Style 580
Time Unit 581
Use Thousands Separator 581
User Guide 9
Table of Contents
Zero Value Characters 581
Appendix E: Using Patterns to Format Data
583
593
609
611
Glossary
Index
613
617
Introduction
IBM Cognos Framework Manager is a metadata modeling tool. A model is a business presentation
of the information in one or more data sources. When you add security and multilingual capabilities
to this business presentation, one model can serve the needs of many groups of users around the
globe.
This document includes the procedures, examples, notes, tips, and other background information
to help you prepare a model for reporting and deploying a package.
Note: For information about modeling for use with Dynamic Query Mode, see the Dynamic Query
Guide.
Audience
This document is intended to help data modelers use Framework Manager. Before using Framework
Manager, you should understand data modeling and how to write queries.
Finding information
To find IBM Cognos product documentation on the web, including all translated documentation,
access one of the IBM Cognos Information Centers at http://publib.boulder.ibm.com/infocenter/
cogic/v1r0m0/index.jsp. Updates to Release Notes are published directly to Information Centers.
You can also read PDF versions of the product release notes and installation guides directly from
IBM Cognos product disks.
Forward-looking statements
This documentation describes the current functionality of the product. References to items that are
not currently available may be included. No implication of any future availability should be inferred.
Any such references are not a commitment, promise, or legal obligation to deliver any material,
code, or functionality. The development, release, and timing of features or functionality remain at
the sole discretion of IBM.
Samples disclaimer
The Great Outdoors Company, GO Sales, any variation of the Great Outdoors name, and Planning
Sample depict fictitious business operations with sample data used to develop sample applications
for IBM and IBM customers. These fictitious records include sample data for sales transactions,
product distribution, finance, and human resources. Any resemblance to actual names, addresses,
contact numbers, or transaction values is coincidental. Other sample files may contain fictional
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
11
Introduction
data manually or machine generated, factual data compiled from academic or public sources, or
data used with permission of the copyright holder, for use as sample data to develop sample applications. Product names referenced may be the trademarks of their respective owners. Unauthorized
duplication is prohibited.
Accessibility features
Accessibility features help users who have a physical disability, such as restricted mobility or limited
vision, to use information technology products. This product has accessibility features. For information on these features, see the accessibility section in this document.
Durable Models
When you create an IBM Cognos Framework Manager model using the durable model capability,
you can rename the query items in your model without breaking references to the changed names
in existing reports. For more information, see "Create a Durable Model" (p. 189).
13
Information about using the IBM Cognos Soft- IBM Cognos Software Development Kit Develware Development Kit to administer query ser- oper Guide
vice properties and develop client applications
to use dynamic query mode.
Repository Control
Native support for CVS and Microsoft Visual SourceSafe repositories was removed from this
release. If you use this feature, and still require project versioning functionality, we recommend
that you read the section "Using External Repository Control" (p. 284). This section explains how
to maintain project versioning outside the modeling application, and is applicable for use with all
version control systems.
Options for configuring global test options are now available (p. 30).
You can configure IBM Cognos Framework Manager to automatically save projects at defined
time intervals (p. 30).
You can reorder root namespace objects listed in the Project Viewer. Objects can be reordered
in ascending or descending order, based on their names (p. 31). You can choose to include
children or all descendants when reordering objects.
User Guide 15
The project folder includes new files (p. 23). These files include archive-log.xml, customdata.xml,
session-log.xml, and session-log-backup.xml. The project folder no longer includes the persistence.txt file.
You can do screen captures in the content explorer as well as in the Diagram.
Over time, log files for a project can become large. For improved performance, you can now
archive entries in log files (p. 301).
You can print diagrams in the Context Explorer, preview before printing, and change page
layout options using Page Setup.
You can set suppression options for published packages "Set Suppression Options" (p. 263).
For dimensionally modeled relational metadata, you can specify sort characteristics on a
dimension. You can now also specify sorting on individual levels within the dimension (p. 121).
New governors have been added to allow further control of system resources and performance
(p. 304).
A new property, Allocation Rule, allows you specify the type of allocation defined for the
measure "Query Items" (p. 138).
You can upgrade segmented projects via the main project. The child segments are automatically
upgraded.
Query reuse is the default setting in IBM Cognos Framework Manager models and IBM
Cognos Report Studio reports. To disable query reuse, change the Allow Usage of Local Cache
governor.
You can use Visual Source Safe 2005 as a repository to manage your projects in Framework
Manager.
Prompt types set on attributes are now processed. The report user will see the prompt that
matches the prompt type on the attribute. Because prompt types on attributes were not processed
in the previous release, some differences may occur.
Many commands are available from shortcut menus. For example, to quickly rename a project,
right-click the project name in the Project Viewer and click Rename. Many commands on
shortcut menus have been reorganized to make them easier to find and use. Some examples
include:
In the Diagram tab of the Project Viewer, you can cut, copy, paste, and delete a selected
model object. In the previous release, the commands for these actions were listed on the
first level of the right-click menu. In this release, these commands are grouped using an
Edit command. For example, to copy a model object, right-click the object and click Edit,
Copy.
In the Explorer tab of the Project Viewer, you can view details about a selected object. In
the previous release, the Diagram Settings command was listed on the first level of the
right-click menu. In this release, this command appears under a Navigate Diagram command,
along with related commands for working with diagrams.
You can analyze the metadata in a model by using the Model Advisor, an automated tool that
applies current modeling guidelines and identifies inconsistencies and areas in your model that
you need to examine. For more information, see "Analyze a Model" (p. 191).
You can specify the behavior of shortcuts by using the Shortcut Processing governor and the
Treat As property. For more information, see "Set Governors" (p. 304) and "Use Shortcuts" (p. 184).
You can minimize the effect of model changes and data source changes by using the Remap
To New Source command. This command remaps higher-level model objects so that they
continue to run and return correct data. You can remap query items, measures, calculations,
and filters. You can remap individual objects manually or you can remap multiple objects at
the same time. For more information, see "Remap an Object to a New Source" (p. 290).
User Guide 17
You can understand the full impact of potential changes in the model by using the Show Object
Dependencies command to find the objects that depend on an object. For more information,
see "Show Object Dependencies" (p. 289).
You can branch and distribute a model for development and later collect and merge the changes
made by multiple modelers by using the Branch to and Merge from commands. For more
information, see "Branching and Merging Projects" (p. 273).
You can import SAP BW queries that contain dual structures and use the structures in IBM
Cognos 8 queries to control the amount and order of information that your users see by using
the SAP BW Dual Structures Support check box. For more information, see "SAP BW Structures" (p. 201).
You can now publish packages from IBM Cognos Framework Manager into any folder in
IBM Cognos Connection.
With the appropriate capabilities and permissions, your users can now add PowerCubes directly
from IBM Cognos Connection without having to access Framework Manager.
Before publishing a package and running reports, you can now see more information about
how the changes you make to a model will affect the package and the reports that use it by
using the Analyze Publish Impact command. For more information, see "Analyze the Impact
of Changes to a Package" (p. 287).
The Verify Model dialog box is improved. You can now select the level of verification that you
want to perform. You can sort and group the reported items by type and by severity of the
message. For more information, see "Verify a Model or Package" (p. 251).
Diagrams in the Diagram tab are improved for performance, stability, and usability. You can
now control the settings for diagrams and the Context Explorer. For more information, see
"The Diagram Tab" (p. 32) and "Change the Settings for Diagrams" (p. 33).
Search and replace is improved so that you can do bulk searching and replacing. Use the Search
tab to quickly find objects by applying different search criteria, such as the location, class,
condition, or property. Text properties such as Name, Description, and Screen Tip, are writable
so you can easily replace multiple values. For more information, see "The Search Tab" (p. 36)
and "Replacing Multiple Property Values" (p. 34).
Framework Manager Security Filters for SAP BW: Notice of Intent to Change
the Default Setting
In all shipped versions of IBM Cognos ReportNet and IBM Cognos 8 including IBM Cognos 8.2,
the following behavior has been enabled by default.
Multiple security filters defined within IBM Cognos Framework Manager on metadata imported
from SAP BW sources are combined using 'AND' logic, effectively an intersection of a particular
user's permissions. This behavior is contradictory to corresponding behavior on relational data
sources where similar filters are combined using 'IN' and 'OR' (union) logic to facilitate cases where
users belong to one or more group and require a union of their permissions. The current default
behavior for SAP BW datasources has been determined to be a product defect and will be changed
in the IBM Cognos 8.3 release to align with the behavior of relational data sources. In the IBM
Cognos 8.1 Mr2 and IBM Cognos 8.2 releases, it will be possible to get the union of filters behavior
by modifying the following switches in the qfs_config.xml configuration file. Under <provider
name="OlapQueryProvider" libraryName="oqp">, add the following new <parameter> element:
<parameter name="ORingSecurityFiltersWhenUserBelongsToMultipleGroups"
value="true"/>
Effect
When multiple security filters are defined in the Data Security setting in Framework Manager for
a query subject, if a user belongs to more than one user group associated with these filters, the effect
of this switch is to perform a union of these filters instead of an intersection. For example, if a user
Joe belongs to a corporate group allowing him to see data for Asia, Europe, and America, and also
belongs to a regional group allowing him only to see data for Europe, the effect of the switch will
be to let Joe see data for Asia, Europe, and America (as compared to just Europe) when logging on
to IBM Cognos 8 and authoring or running a report. Note that security filters that are based on
other security filters in the Data Security settings for a query subject continue to be intersected, just
as before, independent of whether or not the new switch is activated.
As of IBM Cognos 8.3, this behavior will become the new default for SAP BW metadata in
Framework Manager. There will be no change to the behavior of security filters applied on relational
sources. The switch will continue to be available and can be set to false by your administrator if
required to maintain existing application behavior.
User Guide 19
The Embedded externalize method has been removed from the current release. There is no
impact on product functionality.
Explore the sample models included with Framework Manager (p. 39).
Does the data source contain the data and metadata that you need?
Without metadata such as primary keys, indexes, and foreign keys, your reports may take too
long to run, or may produce incorrect results. If the data source does not contain the data and
metadata that you need, will it be changed, or will you work around it?
Which data source tables are the fact tables, which are the dimensions, and which are both fact
table and dimension?
21
Then you should review the names of data sources, tables, and columns in your data source to
ensure that you are not using names reserved by IBM Cognos. If you must use a reserved word,
enclose the word in quotes in the SQL specification. For example, select Orderdate, "Timezone".
For more information, see "Reserved Words" (p. 609).
Projects
A project contains a model, namespaces, packages, data sources, and related information for
maintaining and sharing model information. A single project can span many data sources or tables.
An IBM Cognos Framework Manager project appears as a folder that contains a project file (.cpf)
and the specific .xml files that define the project. The files in a project folder are unique to each
project. The project and its associated files are contained in a project folder.
We do not recommend adding secondary files to the project folder because they may be affected
by actions such as move, rename, and delete commands on the Manage Projects menu. If you decide
to add secondary files to the project folders, the files are added with absolute paths. If they are
moved from the original location, they must be retargeted.
These are the contents of a project folder.
File name
Description
<project name>.cpf
archive-log.xml
This file contains the portion of the main log file that was archived.
customdata.xml
User Guide 23
File name
Description
IDLog.xml
This file tracks objects for models that use branching and merging.
log.xml
mda_metadata.xml
mda_engine_project.xml
model.xml
preferences.xml
session-log.xml
session-log-backup.xml
repository.xml
The logged version history for each project or segment that was
added to a repository; this file exists only if you added projects to
a repository.
upgradeReport.htm
Models
A model is the set of related dimensions, query subjects, and other objects required for one or more
related reporting applications.
The Framework Manager model is a metadata layer that adds value to a data source in several
ways. Most importantly, it provides a business view of the information in the source data to simplify
building reports, analyses, and queries. The business view can
format items using numeric, currency, date, time, and other formats
present multilingual folder and item names, descriptions, tips, and data so that users can
operate in their language of choice
automate the generation of SQL queries sent to the relational data source
In particular, you can modify the Framework Manager model to ensure that queries sent to the
data source are efficient, well formed, and secure. You can specify the rules governing query generation, restrict user access to specific rows or columns of data, and model data relationships to hide
the complexity of data from your users.
Namespaces
A namespace uniquely identifies query items, dimensions, query subjects, and other objects. You
import different databases into separate namespaces to avoid duplicate names.
Packages
A package is a subset of the dimensions, query subjects, and other objects defined in the project. A
package is what is actually published to the IBM Cognos BI server, and it is used to create reports,
analyses, and ad hoc queries.
Dimensions
A dimension is a broad grouping of data about a major aspect of a business, such as products,
dates, or markets.
The types of dimensions that you can work with in IBM Cognos Framework Manager are regular
dimensions and measure dimensions. In SAP BW, measure dimensions are called key figures.
Query Subjects
A query subject is a set of query items that have an inherent relationship.
In most cases, query subjects behave like tables. Query subjects produce the same set of rows
regardless of which columns were queried.
There are different types of query subjects:
data source
Data source query subjects directly reference data in a single data source. IBM Cognos Framework Manager automatically creates a relational data source query subject for each table and
view that you import into your model.
model
Model query subjects are not generated directly from a data source but are based on query
items in other query subjects or dimensions, including other model query subjects. By using
model query subjects, you can create a more abstract, business-oriented view of a data source.
User Guide 25
stored procedure
Stored procedure query subjects are generated when you import a procedure from a relational
data source. IBM Cognos Framework Manager supports only user-defined stored procedures.
System stored procedures are not supported.
Query Items
A query item is the smallest piece of the model that can be placed in a report. It represents a single
characteristic of something, such as the date that a product was introduced.
Query items are contained in query subjects or dimensions. For example, a query subject that references an entire table contains query items that represent each column in the table.
For your users, query items are the most important objects for creating reports. They use query
item properties of query items to build their reports.
Create a Project
In IBM Cognos Framework Manager, you work in the context of a project. The project contains
objects that you organize for your users according to the business model and business rules of your
organization. You view these objects in the project page (p. 28).
Before you can import metadata, you must create a project.
For information about creating a project segment, see "Create a Segment" (p. 282).
For information about creating a project using the Model Design Accelerator, see "Create a Project
" (p. 47).
Steps
1. From the Welcome page, click Create a new project.
Tip: If you are in Framework Manager, click New from the File menu.
2. In the New Project page, specify a name and location for the project, and click OK.
3. In the Select Language page, click the design language for the project.
You cannot change the language you select after you click OK, but you can add other project
languages. For more information, see "Add a Language to a Project" (p. 134).
For more information about choosing the proper design language for durable models, see
"Create a Durable Model" (p. 189).
Note: If an SAP BW server does not support the selected language, it uses the content locale
mapping in IBM Cognos Configuration. If a mapping is not defined, Framework Manager uses
the default language of the SAP BW server.
4. Click OK to select the design language.
The Metadata Wizard appears.
5. Choose whether to import your metadata now or later:
6. If you chose to import the metadata now, follow the instructions in the Metadata Wizard:
Select the check boxes for the objects you want to import.
Specify how the import should handle duplicate object names. Choose whether to import
and create a unique name. If you choose to create a unique name, the imported object
appears with a number. For example, you see QuerySubject and QuerySubject1 in your
project.
If you want to import system objects, select the Show System Objects check box, and then
select the system objects that you want to import.
You see a list of objects that could not be imported and a count of objects that were imported.
7. Click Finish.
Save the project file (.cpf) and all related files in one folder. When you save a project with a
different name or format, ensure that you save the project in a separate folder.
Open a Project
You must open a project before you can import metadata or make changes to existing metadata.
If the project was created using a model schema that is older than the currently supported version,
you are prompted to upgrade the model.
If your model is checked into a repository, you cannot upgrade it. Manually check the model out
of the source control system and then open it in the new version of IBM Cognos Framework
Manager.
If you upgrade a segmented model, you must open and upgrade each segment individually. After
upgrading each segment, you can then upgrade the top level, or master, project.
Steps
1. From the Welcome page, click Open a project.
Tip: If you are in Framework Manager, click Open from the File menu.
2. Browse to locate the project folder and click the .cpf file.
3. Click OK.
User Guide 27
Icon
Object
Project
Data source
Parameter map
Package
Packages folder
Published package
Calculation
Icon
Object
Calculation whose Usage property is set to Identifier
Embedded calculation
Dimension that is not valid. This dimension is imported from a data source.
Filter
Hierarchy
Level in a hierarchy
Measure
Semi-additive measure
Query item
User Guide 29
Icon
Object
Query item that is located under a shortcut query subject
Invalid query subject. This query subject is imported from a data source.
Query subject that contains query items whose Usage property is set to Fact.
This query subject is based on existing model objects.
Query subject that contains query items whose Usage property is set to Fact.
This query subject is imported from a data source.
Query subject that contains query items whose Usage property is set to Fact.
This query subject is imported from a data source and is not valid.
Relationship
Linked segment or project that was updated. This icon appears over other
icons.
Linked object. This icon appears over other icons.
Steps
1. From the Project menu, click Options.
2. On the Test Options tab, choose the options that you want.
Goal
Action
Persistence
This setting applies to all
dimensions, query subjects, and
query sets in the model.
3. If you want projects saved automatically, on the Auto Save tab, select On and type the number
that represents the frequency, in minutes, that you want projects saved automatically.
4. Click OK.
Reorder Objects
By default, root namespace objects listed in the Project Viewer appear in the order they were added.
You can change the order of objects based on their names. Objects may be reordered in ascending
or descending order.
User Guide 31
Steps
1. In the Project Viewer, select the root namespace objects you want to reorder.
Ensure that selected objects are at the same level.
You can also select objects in the Explorer tab or Diagram tab.
2. From the Tools menu, click Reorder.
3. Click whether to reorder objects by name in ascending order or descending order.
4. Select whether to reorder the selected objects only, or to reorder the selected objects and their
children.
If you choose to reorder children of selected objects, you can also include all descendants of
the child objects.
5. Click OK.
Change the layout of objects to either star layout or standard layout by clicking Auto Layout
from the Diagram menu.
Focus on an object by clicking Set Focal Point from the Diagram menu.
Find an object by right-clicking the object in the Project Viewer and clicking Locate in Diagram.
Save the diagram for printing by clicking Screen capture from the Diagram menu and specifying
the name of the picture.
Launch the Context Explorer by right-clicking an object in the Diagram tab and clicking Launch
Context Explorer.
Print the diagram in the Context Explorer by right-clicking the Context Explorer background
and click Print. A Print button is also available from the Context Explorer toolbar. This rightclick menu also includes commands for previewing the diagram using Print Preview and
changing page layout options using Page Setup.
User Guide 33
filter property values by clicking the arrow to the right of the property heading
You can either click a value, or click Custom to define the criteria for the rows that you want
to view.
apply a property value to multiple objects by clicking the arrow next to the property and
dragging the highlighted area over the properties to which you want to apply that value
resize the width of the rows and columns by right-clicking the object name in the property pane
If you need more room, you can resize the Properties pane or move it so that it floats in the window.
For example, if you have more than one monitor, you can then move the Properties pane to another
monitor.
Steps
1. In the Project Viewer window, select multiple objects.
Tip: To reduce the set of properties to search for before performing the replace, filter the
properties first. On the Properties tab, right-click the column heading you want to filter on and
click Set Autofilter.
2. Choose one of the following:
If your model contains only one language, click the Properties tab.
3. Right-click the column heading for the property whose values you want to replace, and click
Bulk Replace.
4. In the Search for and Replace with boxes, type the search and replace text strings.
Tip: To replace empty properties, leave the Search for box blank.
5. To perform a case-sensitive search, select the Match case check box.
6. To search for the complete property text, select the Match entire cell contents check box.
Tip: To replace all property fields, regardless of the text they contain, type one asterisk in the
Search for box and select the Match entire cell contents check box.
7. Do one or more of the following:
Click Replace to replace the currently selected object and find the next match.
Click Replace All to replace all matching properties, starting from the first matching
property in the list.
As the changes to a property are made, the results appear on the tab.
When the bulk replace reaches the last object in the list, a message appears showing the number
of replacements.
User Guide 35
Steps
1. In the Tools pane, click the Search tab.
Tips:
If the Tools pane is not visible, from the View menu, click Tools. You can drag the Tools
pane to the bottom of the Framework Manager window and resize it to have a better view
of the search results.
To reduce the set of search properties, filter the properties first. On the Properties tab,
right-click the column header you want to filter on, and click Set Autofilter.
2. In the Search String box, type the text that you want to find.
You can use uppercase, lowercase, or mixed case strings. The search is not case sensitive. Valid
wildcard characters are "*" and "?".
an object name
a location in the project hierarchy, as expressed in the default language of the project.
Note: If you want two dimensions or query subjects to have the same name in a project, they must
be in different namespaces.
One-part Identifiers
Some objects in a project have a one-part identifier. The one-part identifier must be unique across
the entire project, even if the namespace contains other namespaces. These objects have a one-part
identifier:
namespaces
functions
shortcuts to namespaces
shortcuts to folders
Two-part Identifiers
Some objects in a project have a two-part identifier consisting of the name of the containing
namespace and the name of the object. The object name must be unique in the containing namespace
(p. 25). These objects have a two-part identifier:
regular dimensions
measure dimensions
query subjects
For example, a go_sales namespace contains a query subject named Product. The Product query
subject has the following name, where the square brackets and periods are the syntax that Framework
Manager uses for object identifiers:
[go_sales].[Product]
Three-part Identifiers
Some objects in a project have a three-part identifier based on the identifier of the containing query
subject. Each name must be unique in the containing query subject. These objects have a three-part
identifier:
hierarchies
measures
query items
Four-part Identifiers
Levels in a project have a four-part identifier consisting of the namespace name, the dimension
name, the hierarchy name, and the level name.
For example, a go_data_warehouse namespace contains a dimension named Account. A hierarchy
in Account is Balance sheet, which contains a level named Account. The Account level has the following name, where the square brackets and periods are the syntax Framework Manager uses for
object identifiers:
[go_data_warehouse].[Account dimension].[Balance sheet].[Account]
Five-part Identifiers
Some objects in a project have a five-part identifier consisting of the namespace name, the dimension
name, the hierarchy name, the level name, and the query item name. Five-part identifiers are also
used for captions and business keys in member unique names (p. 120).
For example, a go_data_warehouse namespace contains a dimension named Account. A hierarchy
in Account is Balance sheet, which contains a level named Account. The Account level contains a
query item named Account name. The Account name query item has the following name, where
the square brackets and periods are the syntax Framework Manager uses for object identifiers:
[go_data_warehouse].[Account dimension].[Balance sheet].[Account].[Account
name]
Sample Models
Several sample models are included with IBM Cognos Framework Manager for you to explore.
The sample models have been created using the guidelines for modeling metadata (p. 319).
In each sample model, the query items have default formatting defined. Names and descriptions
were translated into many different languages. By using the Language_lookup parameter map, each
user automatically sees folder and item names and descriptions in their preferred language.
For more information about sample reports and packages, see the Report Studio User Guide.
Database view
User Guide 39
Business view
Contains model query subjects that represent data in terms of business or application needs.
Calculations, including ones for language, are defined in this view.
This view improves model portability and prevents the metadata queries that occur when calculations are made directly into the data source query subjects.
Dimensional view
Contains regular dimensions, measure dimensions, and scope relationships that were created
in Framework Manager.
Analysis view
Contains the part of the model that is visible in the studios for the analysis (dimensional)
package.
Shortcuts to the regular and measure dimensions in the Dimensional view are grouped in star
schemas and placed in the root of the model in folders, one for each business area. They are
clearly marked with "(analysis)" at the end of the name. They are not in a separate namespace
because that would add another level in the metadata tree in the studios.
Query view
Contains the part of the model that is visible in the studios for the query and reporting package.
Shortcuts to the model query subjects in the Dimensional view are grouped in star schemas and
are placed in folders, one for each business area. They are clearly marked with "(query)" at
the end of the name in the root of the model.
In addition, there are packages in the sample model: one for analysis and one for query and
reporting. You cannot use the query and reporting package in IBM Cognos Analysis Studio.
Database view
Business view
Contains model query subjects and reference shortcuts that represent the data in terms of
business or application needs. Calculations, including ones for language, are defined in this
view.
Dimensional view
Contains regular dimensions, measure dimensions, and scope relationships. The dimensions
are based on the model query subjects in the Business view.
This is also where the query subjects are renamed, if needed.
Analysis view
Contains the part of the model that is visible in the studios for the analysis (dimensional)
package.
Shortcuts to the regular and measure dimensions in the Dimensional view are grouped in star
schemas and placed in the root of the model in folders, one for each business area. They are
clearly marked with "(analysis)" at the end of the name. They are not in a separate namespace
because that would add another level in the metadata tree in the studios.
Query view
Contains the part of the model that is visible in the studios for the query and reporting package.
Shortcuts to the model query subjects in the Dimensional view are grouped in star schemas and
are placed in folders, one for each business area. They are clearly marked with "(query)" at
the end of the name in the root of the model.
In addition, there are packages in the sample model: one for analysis and one for query and
reporting. You cannot use the query and reporting package in IBM Cognos Analysis Studio.
User Guide 41
To access pop-up menus in each view, right-click in the view. The Options dialog box is available
from all pop-up menus.
Explorer Tree
Use the Explorer Tree to view objects that you selected using the Metadata Wizard. The data source
objects are shown in a hierarchical view, similar to other file systems.
To see a graphical view of your data source, use the Explorer Diagram(p. 44). If the data source
contains a large number of objects, it may be easier to locate an object using the Explorer Tree.
The Explorer Tree uses the following icons to represent objects.
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
43
Icon
Object
Project
Table in the data source
Column in the data source
The data type property of the column identifies it as a measure.
Column in the data source
The properties of the column identify it as a key.
Column in the data source
The properties of the column do not identify it as either a measure or a key.
Data source
Explorer Diagram
The Explorer Diagram shows a graphical view of your data source metadata. Use the Explorer
Diagram to explore your metadata and view the relationships between objects.
To access the Explorer Diagram, select one or more objects in the Explorer Tree. Then, click the
Explorer Diagram icon
Change the layout of objects to either star layout or standard tree layout.
Zoom in or out
There are two ways of using the Explorer Diagram. From the Explorer Tree, you can select a subset
of objects that you are interested in and add them to the Explorer Diagram. From the Explorer
Tree, you can also add all the objects to the Explorer Diagram. You can then keep the objects you
are interested in and remove the rest. Use the Show Related Tables and Remove Tables menu items
to create a view of just the objects you want to explore. The diagram is a read-only view of your
data source metadata. When you add or remove tables, you are only modifying the diagram. You
are not making changes to the data source.
Use the diagram menu options to explore relationships to other objects. To access diagram menu
options, select an object in the Explorer Diagram and right-click or use the toolbar. Right-click a
table to select the option to view the diagram as a star or tree layout around that table. You can
also access some of the diagram menu options using the icons.
44 IBM Cognos Framework Manager
View the data source tables that were used to create the selected query subject.
Create, modify, delete or override relationships using the Relationship Editing Mode.
Change the settings for the diagrams using the Options Dialog.
Use the Options dialog box to customize the default diagram settings. For example, if your tables
contain numerous columns or use long names, the data in the diagrams may not be fully displayed.
Adjust the maximum table size options in the Options dialog box to ensure all your data is displayed.
Another option controls the default colors that are used to identify diagram characteristics.
User Guide 45
If Model Design Accelerator detects a potential issue, the Model Warning window appears.
The option Manually re-draw the joins between tables activates the functionality of Relationship
Editing Mode from the Model Warning view. For more information about the Model Warning
view, see "Model Warning View" (p. 46).
You can double-click a query subject in the Model Accelerator workspace to access the Query
Subject Diagram. From there, click Enter Relationship Creation Mode.
Use Relationship Editing Mode to create, modify, delete, or override model joins.
Steps
1. Select two tables that you want to join.
If you cannot create a direct join between two tables, use intermediate tables. To add intermediate tables, drag the tables from the Explorer Tree onto the Query Subject Diagram. Then,
create the required joins by linking the tables through the intermediate tables.
Tip: An intermediate table has a dashed outline.
2. Click the Create a Model Relationship icon
The Modify the Relationship dialog box is displayed. A new join line is displayed.
3. Select a column from each table to create the new relationship.
4. Select the appropriate relationship cardinality.
5. Click OK twice to return to the Model Accelerator workspace.
If your action results in an invalid model, the Model Warning view appears.
Alternatively, from Relationship Editing Mode, you can select the columns you wish to join and
then click the Create a Model Relationship icon . The Modify the Relationship dialog box appears
with the join displayed between the selected columns.
Steps
1. From any of the diagram views, right-click to access the pop-up menu. Select Options and click
the General tab.
2. Select the type of notation to represent relationships.
You can use Simplified Crowsfeet, Standard Crowsfeet, or Numeric Cardinality notation. By
default, Model Design Accelerator uses Simplified Crowsfeet notation which provides a pictorial
representation of the relationship.
3. Set a maximum table size for the Explorer and Query Subject diagrams.
4. Set a maximum table size for the Model Accelerator workspace.
5. Select whether you want a text description displayed beside each tool icon.
6. Select whether you want the introductory screen displayed every time you start Model Design
Accelerator.
7. Click the Colors tab to change the colors of diagram objects.
Default colors are assigned to the different characteristics of diagram objects. Change the colors
to customize your display.
The View Background Color indicates that changes made in the active window will result in
changes to the star schema design. This allows you to easily identify windows used for editing
and windows used only for viewing.
8. Click OK.
Create a Project
In Model Design Accelerator, you work in the context of a project.
Steps
1. From the Welcome page of IBM Cognos Framework Manager, click Create a new project
using Model Design Accelerator.
User Guide 47
Select the check boxes for the objects you want to use.
You can select as many or as few objects as you wish. All selected metadata is available
for you to work with in your star schema design. Only the objects required for the model
will be imported into Framework Manager when you generate the model.
6. Create your star schema model using the objects you selected from the data source.(p. 48)
7. Do one of the following:
Click Save to save the contents of the session and continue working.
Click Close to save the contents of the session and enter Framework Manager.
Click Generate Model to generate a model based on your star schema design and enter
Framework Manager.
You can save and close your design as often as you wish without generating a model. For more
information, see "Create a Star Schema" (p. 48)
User Guide 49
create a new star schema using the same imported data source metadata
The Model Design Accelerator metadata is saved in the mda_metadata.xml file in the project folder.
You can move the star schema to another project by copying the mda_metadata.xml file into a
different project folder.
Each time you generate a model, namespaces are created in the open Framework Manager project.
The Physical View contains only the tables that were needed to support the star schema model.The
Business View contains model query subjects with only the columns you selected when building
the query subjects. These are the objects you built in Model Design Accelerator. The Presentation
View contains a series of shortcuts to the model query subjects you created in the Business View.
For each subsequent model generated, a new set of namespaces is created in the Framework Manager
project. A number is appended to each namespace name to distinguish it from the previous version.
For example, the first model contains a namespace entitled Physical View. The second model will
contain Physical View1.
When your star schema design is complete, you can enhance the resulting model in Framework
Manager by adding calculations, filters, additional languages, and dimensional structures. If you
change the star schema and regenerate a model, your original design and any enhancements are not
overwritten.
Data Sources
Before you can create models and import metadata, you must define data sources. A data source
connection supplies the information that IBM Cognos BI needs to connect to a database.
Each data source can contain one or more physical connections to databases. The data source
connection specifies the parameters needed to connect to the database, such as the location of the
database and the timeout duration. A connection can include credential information and signons.
You can secure data sources using IBM Cognos authentication. IBM Cognos authentication respects
any security that is also defined within the data source. You can create data source signons to isolate
the database logon process from the end users. The signon stores the user ID and password required
to access the database. You can also deploy data sources.
For more information about data source connections, see the IBM Cognos Administration and
Security Guide.
no authentication
IBM Cognos BI logs on to the data source without providing any signon credentials.
51
external namespace
IBM Cognos BI logs on to the data source with the same credentials used to authenticate to
the specified external authentication namespace. The namespace specified must be active, users
must be logged on to it prior to accessing the data source, and the credentials used for the
namespace authentication must be relevant for the data source authentication.
All data sources also support data source signons defined for the Everyone group or for individual
users, groups, or roles. If the data source requires a data source signon, but you dont have access
to a signon for this data source, you will be prompted to log on each time you access the data
source.
IBM Cognos BI also respects any security defined for the data source. For example, for IBM Cognos
cubes, the security may be set at the cube level. For Microsoft Analysis Services data sources, the
security may be set using cube roles.
Native Metadata
IBM Cognos supports OLAP data sources as well as relational data sources. The term native
metadata refers to objects such as models, packages, and queries that are based on an OLAP data
source. A namespace that contains native metadata uses this icon to indicate that it is different
from namespaces containing other types of metadata.
User Guide 53
Isolation Levels
The isolation level specifies how transactions that modify the database are handled. By default, the
default object gateway is used. Not all types of databases support each isolation level. Some database
vendors use different names for the isolation levels.
Queries that are executed by reports and analysis are intended to be read-only operations. The
queries execute with a unit of work at the data source known as a transaction with either a default
or administrator-defined isolation level. Report authors should not assume that queries that execute
stored procedures commit any data written by the procedure. In some environments, changes made
by a procedure may be committed due to features of the database. A stored procedure that is marked
for-write in Framework Manager commits changes but can only be used by Event Studio.
If you need specific queries to run with different isolation levels, you must define different database
connections.
For OLAP data sources, including SAP BW, the transaction unit of work is read-only.
The following isolation levels are in increasing order of isolation:
Read Uncommitted
Changes made by other transactions are immediately available to a transaction.
Database type
Oracle
Not applicable
DB2
Uncommitted read
Read uncommitted
Read uncommitted
Informix
Dirty read
Read Committed
A transaction can access only rows committed by other transactions.
Database type
Oracle
Read committed
DB2
Cursor stability
Read committed
Read committed
Informix
Committed read
Cursor Stability
Other transactions cannot update the row in which a transaction is positioned.
Database type
Oracle
Not applicable
DB2
Not applicable
Not applicable
Not applicable
Informix
Cursor stability
Reproducible Read
Rows selected or updated by a transaction cannot be changed by another transaction until the
transaction is complete.
Database type
Oracle
Not applicable
DB2
Read stability
Repeatable read
Repeatable read
Informix
Repeatable read
Phantom Protection
A transaction cannot access rows inserted or deleted since the start of the transaction.
Database type
Oracle
Not applicable
DB2
Not applicable
Not applicable
Not applicable
User Guide 55
Database type
Informix
Not applicable
Serializable
A set of transactions executed concurrently produces the same result as if they were performed
sequentially.
Database Type
Oracle
Serializable
DB2
Repeated read
Serializable
Serializable
Informix
Not applicable
IBM DB2
Oracle Essbase
IBM Informix
ODBC Connections
Oracle
SAP BW
XML
Depending on the type of database you are connecting to, you may also need to review information
about isolation levels (p. 54).
Steps
1. Click the namespace, folder, or segment you want to import into, and from the Actions menu,
click Run Metadata Wizard.
2. In the Select Metadata Source window, click Data Sources and then select Next.
3. In the Select Data Source window, click New. This runs the New Data Source Wizard that is
also available from Cognos Connection.
From the New Data Source Wizard, you can access the IBM Cognos Administration and
Security Guide from the online help system.
4. In the name and description page, type a unique name for the connection and, optionally, a
description and screen tip, and then select Next.
5. In the connection page, from the Type drop-down list, select the type of data source you want
to create.
If your data source is not listed, select Other type.
6. If necessary, specify an isolation level for your data source. (p. 54)
7. Enter any parameters that make up the connection string, and specify any other settings, such
as a signon or a timeout.
In the IBM Cognos Administration and Security Guide, you will find detailed information
about the required connection parameters and authentication.
8. Select Test the connection and then Test to test whether parameters are correct.
If prompted, type a user ID and password or select a signon, and then click OK. If you are
testing an ODBC connection to a User DSN, you must be logged on as the creator of the DSN
for the test to succeed.
In the Status column, you can see if the connection was successful. If it was unsuccessful, select
Close, return to the previous steps and verify your connection parameters.
Tip: You can also test the data source connection from the Data Sources folder in the Project Viewer.
Right-click the data source and click Test.
Importing Metadata
You can import metadata into a new project or an existing project. Importing metadata is an
operation that can be performed many times to extend the project. You can also export your model
to a Common Warehouse Metamodel (CWM) "Export Metadata" (p. 291).
IBM Cognos Framework Manager can use the metadata and data from external data sources to
build a project.
relational databases, such as Oracle, IBM DB2, and Microsoft SQL Server
For information about the supported data source types, access one of the IBM Cognos Information
Centers at http://publib.boulder.ibm.com/infocenter/cogic/v1r0m0/index.jsp.
For information about working with data source connections, see (p. 53).
User Guide 59
Database object
table
query subject
column
query item
view
query subject
synonym
query subject
procedure
query subject
function
project function
Named sets imported from Microsoft SQL Server and Microsoft Analysis Server stored as readonly calculations in the Framework Manager model. The calculation has a flag that identifies it as
a named set, and a property that contains the dimension name.
Steps
1. Click the namespace, folder, or segment that you want to import into and, from the Actions
menu, click Run Metadata Wizard.
2. From the Select Metadata Source dialog, you can choose the type of metadata you wish to
import.
The Data Sources option provides a list of data sources defined in the IBM Cognos software.
Select the check boxes for the objects you want to import.
Specify how the import should handle duplicate object names. Choose either to import and
create a unique name, or not to import. If you choose to create a unique name, the imported
object appears with a number. For example, you see QuerySubject and QuerySubject1 in
your project.
If you want to import system objects, select the Show System Objects check box, and then
select the system objects that you want to import.
If you want to convert all cardinalities to 1, clear the Fact detection enabled check box.
Removing n cardinalities disables fact detection and the ability to automatically prevent
double-counting. For more information, see "Modeling 1-n Relationships as 1-1 Relationships" (p. 355).
3. Click Import.
60 IBM Cognos Framework Manager
For more information about checking the metadata, see "Verifying Imported Metadata" (p. 339).
Steps
1. Click the namespace, folder, or segment you want to import into and, from the Actions menu,
click Run Metadata Wizard.
2. Click IBM Cognos Model and click Next.
3. Locate the model (.cpf file) that you want, click Open, and click Next.
4. Follow the instructions in the Import wizard:
Select the check boxes for the objects that you want to import.
User Guide 61
Steps
1. Ensure that you exported the Architect model or Impromptu catalog.
2. Click the namespace, folder, or segment you want to import into and, from the Actions menu,
click Run Metadata Wizard.
3. Click either IBM Cognos Architect (.xml) or IBM Cognos Impromptu (.xml) and click Next.
4. Locate the Architect or Impromptu XML file that contains the metadata to import.
A message in the XML Preview window confirms that you chose a valid XML file.
5. Click Open.
6. Select the namespace containing your Series 7 security information.
7. Click Import.
A list of created objects appears.
8. If you want to verify the imported metadata, click the Verify after import check box.
9. Click Finish.
Import Metadata from IBM Cognos DecisionStream or IBM Cognos Data Manager
You can use IBM Cognos Framework Manager to import metadata from an XML file created
by IBM Cognos DecisionStream or IBM Cognos Data Manager. You can import
Dimension
Query subject
Relationship
Physical metadata
namespace
Star (Fact)
Regular dimension
Relationship
Measure dimension
Dimensions
namespace
Scope relationship
Star Schema
Groupings
Star namespace:
shortcut to regular
dimension
Star namespace:
shortcut to measure
dimension
Business view
namespace
Facts
A star maps to a Framework Manager query subject in the Physical Metadata namespace or as a
measure dimension in the Dimensions namespace. The following fact attributes are included in the
model.
Attribute name
Table name
Short name
Business name
Custom property
Description
Column name
User Guide 63
Attribute name
Column type
Column length
Custom property
Custom property
Column description
Column type
Table keys
Connections
A connection maps to a Framework Manager data source.
Note: A data source connection is not automatically created in IBM Cognos Connection. You
must manually create the connection in IBM Cognos Connection as explained in the import procedure
steps (p. 62).
The following data source attributes are included in the model.
Attribute name
Custom property
Connection description
Connectivity
type.interface property
Connection string
Custom property
Dimension Builds
A dimension build maps to Framework Manager as a top-level namespace.
Hierarchies
A dimension containing hierarchies, levels, and columns maps to a Framework Manager regular
dimension containing hierarchies, levels, and query items.
Conformed Stars
Conformed stars map to a Framework Manager namespace that resides in the Business View
namespace. It contains shortcuts referencing the dimensions.
The following conformed star attributes are included in the model.
Attribute name
Star description
Facts
Dimensions
Hierarchies
Model Properties
The export file contains the following model properties.
Attribute name
Schema version
Not mapped
Catalog version
Custom property
Custom property
Model description
Steps
1. Click the namespace, folder, or segment that you want to import into and, from the Actions
menu, click Run Metadata Wizard.
2. Click IBM Cognos DecisionStream (.xml) or IBM Cognos Data Manager (.xml) and click Next.
User Guide 65
Description
Logical/Physical representation
Dimensional/Logical representation Integrated represents the dimensional object as one integrated object. This is the default.
Separated represents the dimensional object as one
dimensional and one logical object.
Description
Diagram representation
Namespace hierarchy
User Guide 67
Description
Specifies how unreferenced dimension attributes are represented in the project. An unreferenced dimension attribute
is one that does not participate in a level and is not referenced by any other dimension attribute.
Ignore All indicates that all unreferenced dimension
attributes are ignored.
Ignore Join indicates that only unreferenced dimension
attributes participating in a join are ignored.
Show All indicates that all unreferenced dimension
attributes are shown. This is the default.
Show Join indicates that only unreferenced dimension
attributes participating in a join are shown
Create cubes
Populate screentip
Name of the namespace containing Specifies the namespace that contains the dimensional
the dimensional information
information. The default is "Dimensional Model".
Name of the namespace containing Specifies the namespace that contains the logical informathe logical information
tion. The default is "Logical Model".
Name of the namespace containing Specifies the namespace that contains the physical informathe physical information
tion. The default is "Physical Model".
Name of the namespace containing Specifies the namespace that contains the subject areas.
the subject areas
The default is "Subject Area".
Description
Consistency Check
Multiple Databases
Other metadata sources can be based on multiple databases. The best way to import these multiple
data sources into Framework Manager is to perform multiple imports. For each import, you select
the items that correspond to that specific data source.
For example, the first time that you import from another metadata source, you select datasource1
and all the items that correspond to that data source. The next time, you select datasource2 and
the items that correspond to that data source. You continue to import until you have imported all
the data sources and their corresponding items.
User Guide 69
Description
Logical/Physical representation
Dimensional/Logical representation Integrated represents the dimensional object as one integrated object. This is the default.
Separated represents the dimensional object as one
dimensional and one logical object.
Diagram representation
Description
Namespace hierarchy
Specifies how unreferenced dimension attributes are represented in the project. An unreferenced dimension attribute
is one that does not participate in a level and is not referenced by any other dimension attribute.
Ignore All indicates that all unreferenced dimension
attributes are ignored.
Ignore Join indicates that only unreferenced dimension
attributes participating in a join are ignored.
Show All indicates that all unreferenced dimension
attributes are shown. This is the default.
Show Join indicates that only unreferenced dimension
attributes participating in a join are shown
User Guide 71
Description
Create cubes
Populate screentip
Name of the namespace containing Specifies the namespace that contains the dimensional
the dimensional information
information. The default is "Dimensional Model".
Name of the namespace containing Specifies the namespace that contains the logical informathe logical information
tion. The default is "Logical Model".
Name of the namespace containing Specifies the namespace that contains the physical informathe physical information
tion. The default is "Physical Model".
Name of the namespace containing Specifies the namespace that contains the subject areas.
the subject areas
The default is "Subject Area".
Consistency Check
Before you can import metadata, there must be a connection to the data source (p. 56).
Select the check boxes for the objects you want to import.
Specify how the import should handle duplicate object names. Choose either to import and
create a unique name, or not to import. If you choose to create a unique name, the imported
object appears with a number. For example, you see QuerySubject and QuerySubject1 in
your project.
Import statistics including a list of objects that could not be imported and a count of objects
that were imported are shown.
8. Click Finish.
analyze and review the model, see "Analyze a Model" (p. 191)
The Framework Manager data source object created by the import, and referenced by the query
subject, has an identically named corresponding data source in the IBM Cognos Business
Intelligence content store.
The corresponding content store data source is valid and the connection information is correct.
The optional schema or catalog properties of the data source object that the import created
and the query subject references are correct. For the databases accepting case-sensitive identifiers,
ensure that the case is also correct.
The database object (table or view) represented by the query subject exists in the database with
the identical name, and is accessible within the current connection.
The Query Type is valid. An invalid Query Type can exist if you import a query subject from
SAP BW and change the value of the Query Type property for the data source. By default the
value of Query Type is multidimensional. Do not change it.
Relationships Involving Table Views Are Not Imported from an Oracle Designer File
Primary key and foreign key relationships involving at least one table view are not imported from
an Oracle Designer file into Framework Manager.
Create the primary key and foreign key relationships manually.
Some Expressions Imported from Other Metadata Sources Are Not Valid
Support for expression parsing was improved in the MIMB in IBM Cognos BI. Functions that
are equivalent between other metadata sources and IBM Cognos BI are parsed. Exceptions to this
include
functions with no mapping between IBM Cognos BI and the other metadata source
Solution
If you have functions with no mapping between IBM Cognos BI and the other metadata source,
after importing expressions from other metadata sources, edit these expressions manually in
Framework Manager to conform to the equivalent Framework Manager syntax.
If you have expressions that use a specialized syntax, do the following:
1. In Framework Manager, identify all imported query items that represent embedded calculations
using references such as $$1, $$2, and so on.
2. In the Properties pane, find the information provided in the patternMapping property for each
query item.
The patternMapping property indicates the mapping between the parameters in the imported
calculation and the actual object references in the original model.
3. Double-click a broken query subject.
4. Double-click the embedded calculation corresponding to the query item identified in step 1.
5. If the calculation was assigned a default name ("Calculation..."), replace it with the actual
query item name.
6. Replace the imported parameters with the actual Framework Manager object references that
these parameters represent.
7. Repeat these steps for each broken query subject.
User Guide 75
Steps
1. Click the namespace, folder, or segment that you want to import into, and from the Actions
menu, click Run Metadata Wizard.
2. Click the XML data source that you want to import, and click Next.
Steps
1. Click the model or root namespace and from the Actions menu and click Create, Namespace.
2. Right-click the namespace, click Rename, and type a descriptive name.
Ensure that the relationships reflect the reporting requirements (p. 78).
Optimize and customize the data retrieved by query subjects (p. 85).
Optimize and customize the data retrieved by dimensions (p. 114). You may want to store
dimensions in a separate dimensional view.
Control how data is used and formatted by checking query item properties (p. 138).
The business view provides a layer to the information in the source data so that it is easier for your
users to build reports. To enhance the metadata in the business view, do the following:
Add business rules, such as calculations and filters, that define the information users can retrieve
(p. 155).
Organize the model by creating separate views for each user group that reflect the business
concepts familiar to your users (p. 179).
Create a durable model that can withstand later changes to query item names with no impact
on existing reports, and report authors (p. 189).
You can analyze the metadata to ensure that the model is following current modeling guidelines
by using the Model Advisor (p. 191).
77
Relationships
A relationship describes how to create a relational query for multiple objects in the model. Without
relationships, these objects are isolated sets of data.
Relationships work in both directions. You often must examine both directions to fully understand
the relationship.
The different types of relationships are
one-to-one
One-to-one relationships occur when one instance of data in a query subject relates to exactly
one instance of another. For example, each student has one student number.
one-to-many or zero-to-many
One-to-many or zero-to-many relationships occur when one instance of data in a query subject
relates to many instances of another. For example, each teacher has many students.
many-to-many
Many-to-many relationships occur when many instances of data in a query subject relate to
many instances of another. For example, many students have many teachers.
When importing metadata, IBM Cognos Framework Manager can create relationships between
objects in the model based on the primary and foreign keys in the data source. You can create or
remove relationships in the model so that the model better represents the logical structure of your
business.
After you import metadata, verify that the relationships you require exist in the project and that
the cardinality is set correctly. The data source may have been designed without using referential
integrity. Often, many primary and unique key constraints are not specified. Without these constraints, Framework Manager cannot generate the necessary relationships between fact tables and
dimension tables.
Framework Manager stores relationships in the nearest common parent of the objects that participate
in the relationship. The parent can be either a folder or a namespace. If you move one of the participating objects outside the common parent, the relationship moves to the next namespace that is
common to both ends of the relationship. If you move a relationship to a different folder or
namespace, the participating objects also move to the same folder or namespace.
Tip: Use the Search tab (Tools pane) to find an object of class Relationship whose name matches
a specified pattern. For example, if you search for a relationship whose name contains Order Header,
Framework Manager finds all relationships that have Order Header as one end. If you renamed a
relationship, a search of this type may not find it.
Cardinality
Relationships exist between two query subjects. The cardinality of a relationship is the number of
related rows for each of the two query subjects. The rows are related by the expression of the relationship; this expression usually refers to the primary and foreign keys of the underlying tables.
IBM Cognos software uses the cardinality of a relationship in the following ways:
A query that uses multiple facts from different underlying tables is split into separate queries for
each underlying fact table. Each single fact query refers to its respective fact table as well as to the
dimensional tables related to that fact table. Another query is used to merge these individual queries
into one result set. This latter operation is generally referred to as a stitched query. You know that
you have a stitched query when you see coalesce and a full outer join.
A stitched query also allows IBM Cognos software to properly relate data at different levels of
granularity (p. 326).
You must ensure that all relationships and cardinality correctly reflect your users reporting
requirements.
For more information, see "Cardinality in Generated Queries " (p. 320) and "Cardinality in the
Context of a Query" (p. 321).
use matching query item names that represent uniquely indexed columns
The most common situation is to use primary and foreign keys as well as matching query items
that represent uniquely indexed columns. The information is used to set some properties of query
items as well as to generate relationships.
To view the index and key information that was imported, right-click a query subject and click Edit
Definition. For a query subject, you can change the information in the Determinants tab.
Optional relationships, full outer joins, and many-to-many relationships can be imported from your
data source. IBM Cognos Framework Manager will run them as queries.
Note: All regular dimensions begin as query subjects. If you converted a query subject to a regular
dimension, note that determinant information for the query subject is leveraged as a starting point
to define the levels of a single hierarchy. We recommend that you review the levels and keys created
in the hierarchy of the dimension.
Notation
By default, Framework Manager uses Merise notation. Merise notation marks each end of the
relationship with the minimum and maximum cardinality of that end. You can also use Crowsfeet
notation, which provides a pictorial representation of the relationship. For information about how
to change the notation, see "Change the Settings for Diagrams" (p. 33).
User Guide 79
The first part of the notation specifies the type of join for this relationship:
Your users see a different report depending on whether you use an inner or outer join. For example,
your users want a report that lists salespeople and orders. If you use an outer join to connect
salespeople and orders, the report shows all salespeople, regardless of whether they have any orders.
If you use an inner join, the report shows only the salespeople who have placed orders.
Data in one object might have no match in the other object. However, if the relationship has a
minimum cardinality of 1, an inner join is always used and these records are ignored. Conversely,
if all the items match but the relationship in the model has a minimum cardinality of 0, an outer
join is always used, although the results are the same with an inner join. For example, the underlying
table for one object contains a mandatory (non-NULLable) foreign key for the other. Ensure that
the data and cardinalities match.
The second part of the notation defines the relationship of query items between the objects.
0:1 to 0:n
0:1 to 1:n
1:1 to 0:n
1:1 to 1:n
Use the Relationship impact statement in the Relationship Definition dialog box to help you
understand cardinality. For example, Sales Staff (1:1) is joined to Orders (0:n).
It is important to ensure that the cardinality is correctly captured in the model because it determines
the detection of fact query subjects and it is used to avoid double-counting factual data.
When generating queries, IBM Cognos software follows these basic rules to apply cardinality:
1 to n cardinality implies fact data on the n side and implies dimension data on the 1 side.
A query subject may behave as a fact query subject or as a dimensional query subject, depending
on the relationships that are required to answer a particular query.
Sparse Data
When modeling for analysis or reporting, it is important to consider the nature of the business
questions versus the nature of the data source.
A common scenario is that a relationship between a dimension and a fact table in a star schema is
optional. This means that not every dimensional member is mandatory in the fact table. OLAP
engines compensate for this by inserting an appropriate value when creating the OLAP structure
for any dimensional intersection points that do not have data.
For example, an Analysis Studio user wants to create this report:
Country
2005
Canada
2006
1,000,000
Mexico
500,000
750,000
United States
1,000,000
1,250,000
When modeling, it is common to override optional relationships between dimensions and facts for
improved performance. However, when performing analysis or reporting on sparse data where you
require information about dimensional members that have no facts, outer joins must be enabled to
ensure that data is returned for valid dimensional intersection points.
To enable outer joins, we recommend that you do the following:
User Guide 81
Check with your database administrator to ensure that the data source can support full outer
joins.
Modify a Relationship
After you import data (p. 51) or create a relationship (p. 115) in IBM Cognos Framework Manager,
you can rename the relationship and redefine cardinality.
You can create custom relationship expressions by selecting an operator from the list or by manually
changing the expression in the expression editor.
You can also create a complex expression for the relationship (p. 82).
You can view the relationships that already exist for an object by selecting the object and clicking
Launch Context Explorer from the Tools menu.
Steps
1. Click a relationship and, from the Actions menu, click Edit Definition.
2. To modify existing elements, on the Relationship Expression tab, select the query items, cardinalities, and operator you want.
The query items must have the same data type.
3. To create an additional join, on the Relationship Expression tab, click New Link, and define
the new relationship.
4. To test the relationship, on the Relationship SQL tab, identify the number of rows you want
returned and click Test.
5. Click OK.
If your metadata is from an OLAP data source, click Close.
Steps
1. Click a relationship and, from the Actions menu, click Edit Definition.
2. On the Relationship Expression tab, click the ellipses (...) button next to the Expression box.
3. Define the expression.
If you insert session parameters (p. 165) or prompts (p. 149) and you want to specify the values
that they represent when you test the expression, click the options button
4. Click OK.
Create a Relationship
You create a relationship to join logically related objects that your users want to combine in a single
report. This is useful for relationships between objects that were not selected during metadata
import, were not joined in the data source, or are from multiple sources.
You can directly create a relationship between the query items.
You can also create a complex expression for the relationship (p. 82).
You can also use IBM Cognos Framework Manager to automatically generate relationships
(p. 84) between objects based on selected criteria.
You can view the relationships that already exist for an object by selecting the object and clicking
Launch Context Explorer from the Tools menu.
Steps
1. Ctrl+click one or two dimensions, query subjects, or query items.
2. From the Actions menu, click Create, Relationship.
If this relationship is a valid target for a relationship shortcut, Framework Manager asks if you
want to create a shortcut to that relationship. For more information, see "Create a Relationship
Shortcut " (p. 83).
3. Click OK.
The Relationship Definition dialog box appears. You can use this dialog box to modify the
relationship (p. 82).
Steps
1. Ctrl+click the objects that you want to participate in the relationship shortcut.
2. From the Actions menu, click Create, Relationship.
Framework Manager asks if you want to create a shortcut to that relationship.
3. Click Yes.
A list appears of all relationships in which one end is a model object and the other end is either
another model object or a shortcut to another model object.
User Guide 83
Steps
1. Ctrl+click two or more objects.
2. From the Tools menu, click Detect Relationships.
3. Select the rules you want to apply to each pair of tables.
Rule
Result
4. Indicate whether you want Framework Manager to detect and generate relationships between
each selected object and every object in the project that is not selected
Query Subjects
Information about query subjects for SAP BW metadata appears in a different topic (p. 216).
A query subject is a set of query items that have an inherent relationship.
You use IBM Cognos Framework Manager to modify query subjects to optimize and customize
the data that they retrieve. For example, you can add filters or calculations. When you change the
definition of a query subject, Framework Manager regenerates the associated query items, ensuring
that any changes to query subject properties are reflected in all query items for that query subject.
There are different types of query subjects in Framework Manager:
You may also be interested in this topic, "Query Subjects vs. Dimensions" (p. 332).
Framework Manager generates query subjects that represent tabular data from the data source.
For example, a query subject that references an entire table contains query items that represent each
column in the table. If the SQL selects only specific columns, only those columns are represented
as query items.
Each data source query subject can reference data from only one data source at a time. However,
the advantage of data source query subjects is that you can directly edit the SQL that defines the
data to be retrieved. This means that you can insert parameters that control the data that the query
retrieves and create query subjects based on arbitrary SQL.
User Guide 85
Steps
1. Select the namespace folder and, from the Actions menu, click Create, Query Subject.
2. In the Name box, type a name for the new query subject.
3. Click Data Source, and click OK.
4. Complete all the steps in the New Query Subject wizard.
To ensure that the data source is uniquely identified for a data source query subject, do not
exit the wizard before the Finish button appears.
5. Click Finish.
6. Right-click the query subject you created and click Edit Definition.
7. Click the SQL tab, and from the Available database objects box, drag objects to the SQL box.
If your project contains multiple data sources and you want to add objects from different data
sources to the query subject, click Insert Data Source, select the required data source, and click
OK.
You can also insert a macro, embed a calculation (p. 155), and embed a filter (p. 158).
8. Choose the action you want:
Goal
Action
9. Click OK.
A warning appears if any modifications invalidated relationships, other query subjects, calculations, or filters.
10. Ensure that the Usage and Regular Aggregate properties are set correctly (p. 141).
reference objects from different data sources in the same query subject
If you import a model query subject from another model, the model query subject will not work
unless you also import the data source query subjects that the model query subject references.
If you want to edit the SQL, you must convert the model query subject into a data source query
subject (p. 106).
User Guide 87
Steps
1. Select the namespace folder and, from the Actions menu, click Create, Query Subject.
2. In the Name box, type a name for the new query subject.
3. Click Model, and click OK.
4. Click the Query Subject Definition tab.
5. To add items to the model query subject, drag items from the Available Model Objects box to
the Query Items and Calculations box.
You can change the order of items and calculations. However, if the query subject contains a
query item folder, you can change the order only in the Project Viewer.
6. You can also embed a filter.
If you add calculations (p. 155) or filters (p. 158) to a model query subject, Framework Manager
must go to the data source instead of simply accessing the model.
7. If you want to test the query subject, click the Test tab (p. 101).
8. Click OK.
A warning appears if any modifications invalidated relationships, other query subjects, calculations, or filters.
9. Ensure that the Usage and Regular Aggregate properties are set correctly (p. 141).
You may be interested in the following related topics:
modifying the properties for multiple query subjects at the same time (p. 34)
User Guide 89
Description
Data Query
Data Modification
Writes a record to the data source. Use this type when you
want to use the stored procedure in Event Studio.
If you want Event Studio users to be able to select a parameter
in a task, you must put quotation marks around the parameter.
Warning: Testing a data modification stored procedure in the
Edit Definition dialog box results in data being written to the
data source. You cannot roll back transactions to the data
source in Framework Manager. If undesired data is written to
the data source as a result of testing the stored procedure, a
rollback can be done by the database administrator if the data
source is configured to support it. To test the stored procedure
without data being written to the data source, click Test from
the Tools menu.
You can also create data source query subjects, which directly reference data in a single data source
(p. 85), and model query subjects, which are based on metadata that exists in your model (p. 87).
Steps
1. Do the following:
Goal
Action
2. Click the Definition tab and choose the action that you want.
Goal
Action
Change the type of the stored From the Type box, select Data Query or Data Modifiprocedure
cation.
Change which data source the Click the ellipsis (...) button next to the Data Source
stored procedure is in
box.
When you import a stored procedure, a new data source
is created. You can point to the original data source and
delete the new one.
Edit an argument
3. Click OK.
Framework Manager runs the stored procedure and, if the query subject returns a result set,
validates the query subject.
User Guide 91
Steps
1. Create a stored procedure query subject that uses the sp_FIND_ORDER_DATE stored procedure.
The Query Subject Definition dialog box appears.
2. On the Definition tab, select the @order_number argument, and click the ellipsis (...) button.
3. In the Value box, type the following macro syntax and then click OK:
#prompt('Order Number','integer')#
Note: Framework Manager removes anything that is outside the number signs when running
the macro.
4. If you want to test the prompt for the variable, do the following:
5. Click OK.
Determinants
Determinants reflect granularity by representing subsets or groups of data in a query subject and
are used to ensure correct aggregation of this repeated data. Determinants are most closely related
to the concept of keys and indexes in the data source and are imported based on unique key and
index information in the data source. We recommend that you always review the determinants that
are imported and, if necessary, modify them or create additional ones. By modifying determinants,
you can override the index and key information in your data source, replacing it with information
Year Key
Month Key
Day Name
2006
200601
January 06
20060101
2006
200601
January 06
20060102
You can define three determinants for this data set as follows -- two Group By determinants (Year
and Month) and one unique determinant (Day). The concept is similar but not identical to the
concept of levels and hierarchies.
Name of the
Determinant
Key
Attributes
Uniquely Identified
Group By
Year
Year Key
None
No
Yes
Month
Month Key
Month Name
No
Yes
Day
Day Key
Day Name
Yes
No
Month Key
Month Name
Year Key
In this case, we use only one key for each determinant because each key contains enough information
to identify a group within the data. Often Month is a challenge if the key does not contain enough
information to clarify which year the month belongs to. In this case, however, the Month key
includes the Year key and so, by itself, is enough to identify months as a sub-grouping of years.
Note: While you can create a determinant that groups months without the context of years, this is
a less common choice for reporting because all data for February of all years would be grouped
together instead of all data for February 2006 being grouped together.
User Guide 93
A query subject that behaves as a dimension has multiple levels of granularity and will be joined
on different sets of keys to fact data.
For example, Time has multiple levels, and it is joined to Inventory on the Month Key and to
Sales on the Day Key. For more information, see "Multiple-fact, Multiple-grain Queries" (p. 326).
There is a need to count or perform other aggregate functions on a key or attribute that is
repeated.
For example, Time has a Month Key and an attribute, Days in the month, that is repeated for
each day. If you want to use Days in the month in a report, you do not want the sum of Days
in the month for each day in the month. Instead, you want the unique value of Days in the
month for the chosen Month Key. In SQL, that is XMIN(Days in the month for Month_Key).
There is also a Group by clause in the Cognos SQL.
There are less common cases when you need to use determinants:
You want to uniquely identify the row of data when retrieving text BLOB data from the data
source.
Querying blobs requires additional key or index type information. If this information is not
present in the data source, you can add it using determinants. Override the determinants
imported from the data source that conflict with relationships created for reporting.
You cannot use multiple-segment keys when the query subject accesses blob data. With summary
queries, blob data must be retrieved separately from the summary portion of the query. To do
this, you need a key that uniquely identifies the row and the key must not have multiple segments.
A join is specified that uses fewer keys than a unique determinant that is specified for a query
subject.
If your join is built on a subset of the columns that are referenced by the keys of a unique
determinant on the 0..1 or 1..1 side of the relationships, there will be a conflict. Resolve this
conflict by modifying the relationship to fully agree with the determinant or by modifying the
determinant to support the relationship.
You want to override the determinants imported from the data source that conflict with relationships created for reporting.
For example, there are determinants on two query subjects for multiple columns but the relationship between the query subjects uses only a subset of these columns. Modify the determinant
information of the query subject if it is not appropriate to use the additional columns in the
relationship.
Specify a Determinant
Determinants provide control over granularity for query subjects.
If a query subject has determinants, each query item of the query subject must be included in one
of the determinants.
Determinants are processed in the order in which they are specified in the model. You can change
the order of the determinants. If a query subject has more than one determinant, the first one that
Constraints
Model query subjects do not have determinants defined for them automatically. If determinants
are needed, you must define them manually.
Stored procedure query subjects do not have determinants.
You cannot use determinants with user-entered SQL that was specified in a query defined in Report
Studio.
Steps
1. Click the query subject you want and, from the Actions menu, click Edit Definition.
2. Click the Determinants tab.
3. Click Add under the Determinants box.
The entry New Determinant appears in the box. To give this entry a meaningful name, rightclick it, and click Rename.
4. To define a key, right-click a query item in the Available items box and click Add as Key.
Tip: You can also drag query items to the Key box.
5. To identify which query items should be associated with this determinant, right-click query
items in the Available items box and click Add as Attributes.
Tip: You can also drag query items to the Attributes box.
You can have a determinant with no attributes defined for it. Framework Manager uses this
type of determinant to indicate which query items are indexed.
6. To specify that the selected determinant should be used as the unique identifier, select the
Uniquely Identified check box.
Do this only if the data in this item is unique for every row in the underlying data source.
You can specify more than one unique determinant if they are truly unique. At query time, the
relationship being used will determine which unique determinant to use.
7. Select the Group By check box to indicate that when keys or attributes associated with that
determinant are repeated in the data, IBM Cognos BI should apply aggregate functions and
grouping to avoid double-counting.
8. If you want to change the order of the determinants, use the arrow buttons.
Determinants are processed in the order in which they are specified in the model.
9. Click OK.
User Guide 95
Determinant
Key
Group By
Product line
Product line
Product type
Product type
code
Product type
Product
Product key
Yes
Yes
Cost
Margin
Product name
Product number
query items, filters, and calculations in model and data source query subjects
relationships and relationship shortcuts between model and data source query subjects
You can merge any number of the same type of objects into a new query in a single operation. The
merge always creates a new model query subject.
Steps
1. Ctrl+click the objects that you want to merge into a single query subject.
2. From the Actions menu, click Merge in New Query Subject.
Steps
1. Select one or more objects that you want to explore.
2. From the Tools menu, click Launch Context Explorer.
3. To see the connected objects, click one or more objects and click the appropriate button.
Goal
Button
4. If you want to see details about an object, such as its relationships and query items, right-click
the object, click Navigate Diagram, Diagram Settings, and then select the details you want.
only the rows that are shared between the query subjects (intersect operation)
For example, you want to find out which staff members are also managers.
only the rows that exist in the first query subject and not in the second query subject in the
query set (except operation)
For example, you want to highlight the differences between where your products were sold this
year and ten years ago.
The names of the items in the projection list default to the items assigned to the first query subject
in the set operation.
Relationships between the two query subjects in the query set and other query subjects are not
included in the query set.
Reports show different results depending on which operator is used. For example, you have two
query subjects with the names of various employees.
The first query subject contains these rows:
Row
Value
Jane
John
John
Michael
Michael
Row
Value
Jane
John
John
Patrick
Operator
Result
Notes
Union
Intersect
Jane, John
Except
Michael
Union All
Jane, Jane, John, John, John, All items are shown. Values are dupliJohn, Michael, Michael, Patrick cated.
Intersect All
Except All
Michael, Michael
Constraint
Not all data types are supported. Generally, sets are not permitted on BFILE, BLOB, CLOB, LONG,
and VARRAY data types, or on nested table columns.
Steps
1. Select two query subjects that meet these requirements:
User Guide 99
Option
Description
Union
Intersect
Except
Retrieves rows that exist in the first query subject and not in
the second query subject.
7. To create a Union All, Intersect All, or Except All operation, clear the Remove Duplicate Row
check box.
8. Choose the action that you want.
Goal
Action
Work with the filters that are embed- Click the Filters tab.
ded in the query subjects
You can add or edit the filters, change the order
of the filters, and change the usage of filters.
Test the query set
testing the query set or changing the test settings (p. 101)
Steps
1. Select the object that you want.
2. From the Actions menu, click Edit Definition and then click the Test tab or the Query Information tab.
3. Click Options and then click the Test Settings tab.
4. Choose the options that you want.
Goal
Action
Persistence
This setting applies to all
dimensions, query subjects, and
query sets in the model.
Goal
Action
Persistence
Temporarily override In the Session Parameters box, The override values are not
session parameters
saved with the model. This setclick Set.
ting is for your current session
The Session Parameters dialog
only.
box appears.
Apply relevant design Select the Apply all relevant
This setting is saved and used in
mode filters
design mode filters when testing your next session with any
model.
check box.
This applies all relevant filters
whose usage is set to design
mode in another dimension,
query subject, or query set.
Apply a security filter In the Security Filters box, click This setting is saved and used in
your next session with this
Edit.
model.
Change the prompt
values
In The Current Prompt Values The prompt values are not saved
with the model.
box, click Prompts.
The Model Prompts Manager
dialog box appears, which
shows all prompts, and their
values, that are in the model.
The Evaluate Object command completes an exhaustive check of all query subjects and ensures
that they can run.
What happens in the evaluation process depends on the type of query subject selected.
Evaluation process
Relational data source query A request based on the derived items is sent to the relational data
subject
source.
The list of data source references is updated.
The physical attributes, such as data type, are updated as needed.
Model query subject based
on relational metadata
Stored procedure query sub- A request based on the latest parameters of the stored procedure
ject
is sent to the data source.
The list of derived query items is updated.
You can also update the query subject (p. 104) if it is from a relational data source, or synchronize
the entire project (p. 301).
Steps
1. Select the query subject that you want to evaluate.
2. From the Tools menu, click Evaluate Object.
If you changed the Regular Aggregate property to unsupported, the property is reset when you
evaluate the query subject. If the property is set to any other value, the property is not changed.
Constraint
You cannot use the Update Object command for model query subjects.
Steps
1. Select one or more query subjects.
2. From the Tools menu, click Update Object.
Tip: You can instead open the Query Subject Definition dialog box and click OK.
Constraints
You cannot use determinants to create separate hierarchies for the dimension. You must create the
separate hierarchies for the dimension after converting the query subject.
You cannot convert the following to dimensions:
query sets
Steps
1. Select the query subjects that you want to convert.
2. From the Actions menu, click Convert to Regular Dimension or Convert to Measure Dimension.
Constraint
Do not convert the model query subject if you want it to reference multiple data sources.
Steps
1. Select the model query subject that you want to convert.
2. From the Actions menu, click Convert to Data Source Query Subject.
This command is available only if you have run the query and the Query Information tab in
the Edit Definition dialog box contains SQL.
If you want to edit the SQL of a model query subject, you must copy the SQL for the model query
subject from the Query Information tab and paste it into a new data source query subject. You can
also convert the model query subject into a data source query subject (p. 106). Do not edit the SQL
if you want the model query subject to reference multiple data sources.
Changing the alias of a column regenerates the query item that represents that column. Any modifications that you made to the query item are not retained because IBM Cognos Framework
Manager considers it a new query item.
You can add comments to the SQL by using /* before the comment and */ at the end.
Here is an example:
select country /* this is a multiline
comment
another line
another line
Steps
1. Click the data source query subject that you want to change.
2. From the Actions menu, click Edit Definition.
3. Click the SQL tab, and drag objects into the SQL box or type in the SQL you want.
4. Click OK.
Type
Advantage
Disadvantage
Cognos SQL
Cognos SQL improves query sub- You cannot enter non-standard SQL.
ject performance; for example, by
removing unused elements at query
time.
SQL works on any supported
database.
Native SQL
Performance is optimized across all You cannot use SQL that the data
related query subjects.
source does not support for subYou can use SQL that is specific to queries.
your database.
Pass- Through
SQL
You can enter any SQL supported There is no opportunity for Frameby the database.
work Manager to automatically optimize performance.
The SQL may not work on a different
data source.
If you change it to native SQL, Framework Manager generates the following statement:
Select
oracle_plain.ProductName as Productname,
oracle_plain.Margin as Margin
From
(GOSALES1_OR_92_WE...SELECT
P.PRODUCTNAME, P.MARGIN
FROM
PRODUCT P}
)oracle_plain
Therefore, you must ensure that the query subject adheres to additional database restrictions
that are imposed on subqueries, such as not using the With clause. Pass-through SQL does not
have the same restrictions. However, the fact that native SQL is processed as part of a larger
query improves its performance.
To test native SQL using a query tool, such as Oracle's SQL*Plus, you must place the SQL in
the From clause of a Select statement. For example, you can use the following syntax in a
query tool:
Select * from (<Native SQL>) T1
If a data source query subject contains a macro in the projection list (Select clause) of the
SQL statement, specify an alias in the SQL that matches the Column Name property of the
query item.
Note that the number sign (#) is reserved for macros. Framework Manager removes anything
that is outside the number signs when running the macro.
Steps
1. Click the query subject that you want to change.
2. From the Actions menu, click Edit Definition, and then click the Query Information tab.
The Test Results box is initially empty until you run the query.
3. Click Options, and then click the SQL Settings tab.
4. Use the SQL Type list to change the type of SQL.
If you are changing the type to native SQL, see the checklist above to ensure that the SQL
reflects the rules that apply to the native data source.
5. Click OK.
6. If you want to see the SQL, click Test Sample.
7. If you want to see the actual query, click Query.
8. If you want to see the xml that IBM Cognos BI uses, click Response.
9. Click OK.
Cognos SQL
By default, IBM Cognos Framework Manager uses Cognos SQL to create and edit query subjects.
Cognos SQL adheres to SQL standards and works with all relational and tabular data sources.
Framework Manager generates the most optimized SQL possible. In this way, Cognos SQL is
preferable.
Because query subjects in Framework Manager are similar to views in databases, the SQL for each
query subject must conform to the SQL standards that apply to views. For example, you must assign
aliases to any column that is empty or whose name is not unique. This level of conformance means
that Cognos SQL behaves more consistently than vendor-specific SQL, which does not adhere to
SQL standards.
User Guide 109
The following shows how Cognos SQL turns the above example into a With clause:
WITH T1 AS (SELECT SNO C1, AVG(QTY) C2, COUNT(*)
C3 FROM
SUPPLY GROUP BY SNO),
T2 AS (SELECT MAX(QTY) C1 FROM SUPPLY)
SELECT *FROM T1, T2
Native SQL
Native SQL is the SQL that the data source uses, such as Oracle SQL. Use Native SQL to pass the
SQL statement that you enter to the database. IBM Cognos BI may add statements to what you
Pass-through SQL
Use pass-through SQL when the SQL statement that you enter is not valid inside a derived table.
Pass-through SQL lets you use native SQL without any of the restrictions that the data source
imposes on subqueries. This is because pass-through SQL query subjects are not processed as subqueries. Instead, the SQL for each query subject is sent directly to the data source where the query
results are generated.
Because each query subject is sent to the data source as a separate statement rather than being
optimized by IBM Cognos Framework Manager, performance is slower. Therefore, in choosing
between native SQL and pass-through SQL, you must decide which is more important: performance
or using SQL that is not permitted in a subquery.
Generally, you should use pass-through SQL only if you must create a query subject that contains
constructs that are specific to a data source and that cannot be used inside a derived table, such as
in a With or OrderBy clause.
Note that the number sign (#) is reserved for macros and that column names must be unique.
Framework Manager removes anything that is outside the number signs when running the macro.
If you change the SQL Generation Type to Minimized, Framework Manager generates the following
simplified SQL:
select
CONVERSIONRATE.COUNTRYCODE as COUNTRYCODE,
COUNTRY.EUROINUSESINCE as EUROINUSESINCE
from
"2 - GOSales1 - OLE-DB".GOSALES1.dbo.CONVERSIONRATE
CONVERSIONRATE,
"2 - GOSales1 - OLE-DB".GOSALES1.dbo.COUNTRY COUNTRY
where
(COUNTRY.SALESCOUNTRYCODE = CONVERSIONRATE.COUNTRYCODE)
Minimized SQL works best when the returned result sets of each query item are equivalent. If there
are records in one column that do not correspond to records in another column, the result of the
minimized query produces additional rows. You can avoid this by setting the SQL Generation Type
to As View.
For example, if there are Product Types that are not used by any of the Products and these Product
Types all have a common Product Line, a Product Line is reported for which there are Product
Types, but for which there are no related Products.
Steps
1. Click the query subject that you want to change.
2. From the Actions menu, click Edit Definition, and then click the Query Information tab.
The Test Results box is initially empty until you run the query.
3. Click Options, and then click the SQL Settings tab.
4. Set Generate SQL to As View or Minimized.
5. Click OK.
6. If you want to see the SQL, click Test Sample.
7. If you want to see the actual query, click Query.
8. If you want to see the xml that IBM Cognos BI uses, click Response.
9. Click OK.
Dimensions
Information about dimensions based on SAP BW metadata appears in a different topic (p. 204).
A dimension is a broad grouping of data about a major aspect of a business, such as products,
dates, or markets.
The types of dimensions that you can work with in IBM Cognos Framework Manager are regular
dimensions and measure dimensions. In SAP BW, measure dimensions are called key figures.
For example, in a project for sales analysis, you include these dimensions:
Name
Type
Description
Time
Regular dimension
Dates of sales organized into years, quarters, months, weeks, and days when sales
were made
Region
Regular dimension
Product
Regular dimension
Customer
Regular dimension
Customer information
Sales
Measure dimension
You must use regular and measure dimensions to enable analysis on your relational data source.
In most data sources, measure dimensions are likely to be shared by more than one regular dimension.
Regular dimensions are often called shared dimensions. A measure dimension and regular dimensions
organized into a cluster is often referred to as a star schema group but can also be referred to as a
functional or subject area group.
You may also be interested in this topic, "Query Subjects vs. Dimensions" (p. 332).
Do you have more than one level of granularity, such as some data is recorded monthly and
some is recorded daily?
Steps
1. Select a namespace or folder where you want to place the dimension.
2. From the Actions menu, click Create, Regular Dimension, and then click the Dimension tab.
3. Click Add Hierarchy and then drag one or more objects from the Available items box to the
Hierarchies box.
You can define multiple hierarchies for a dimension. The first hierarchy is used as the default,
or primary, hierarchy.
You can also create an alternate hierarchy by copying a level. Click a level and drag it to the
right border of the dimension. You can only copy a level within the same dimension.
4. Click Add Level and then drag one or more objects from the Available items box into the new
level.
You can also create copies of levels in the Dimension Definition dialog box or in the Dimension
Map tab. Click the level and drag it to another position in the hierarchy. All attributes of the
level are also copied. You can only copy a level within the same dimension.
5. If you want to use a different item in a level, drag it from the Available items box to the Select
a level in the hierarchy control to see the query items box.
You are prompted to specify its role.
By default, Framework Manager adds the name of the namespace.
Tip: To have a multiple-part key such as first name plus last name, create a new attribute that
combines the items, and then specify that the new attribute is the business key.
6. If you want to indicate that the keys of the levels above the current level are not necessary to
identify the members in this level, select the item and select the Unique Level check box. This
indicates that key values belonging to the level should be considered unique regardless of context.
116 IBM Cognos Framework Manager
Embed calculations by clicking Add and then defining the expression (p. 155).
To change a calculation that has been embedded in the dimension, in the Dimension Map
tab, click Attributes, right-click the query item, and click Edit Expression.
8. Click OK.
9. To change the default hierarchy for a dimension with multiple hierarchies, do the following:
In the Properties pane, click the ellipsis (...) button in the Default Hierarchy box.
You can also use the Dimension Map tab to create a regular dimension. Click the regular dimension
button
If you need both hierarchies in the same report query, such as on opposing axes, you must create
a regular dimension for each hierarchy. For example, here is sales staff as two dimensions.
Tip: To change the default hierarchy for a dimension with multiple hierarchies, in the Properties
pane, click the ellipsis (...) button in the Default Hierarchy box, and select a different hierarchy.
If a hierarchy in a dimension contains a large number of members, running a query in one of the
IBM Cognos studios may be slow because the IBM Cognos engine is generating one large query
for a locally-built cube. To resolve this issue, set the Wide Member Tree property in the Properties
pane to true. The engine will then generate multiple smaller queries for the locally-built cube.
Balanced Hierarchy
Each path in a balanced hierarchy descends to the same depth.
For example, in the following diagram, the highest level is Product Line(Level 1); Level 2 is Product
Type; Level 3 is Products.
Unbalanced Hierarchy
The branches in an unbalanced hierarchy descend to different levels.
For example, in the following diagram, the highest level in an organization is the CEO (Level 1);
Level 2 is the vice-presidents and the CEOs executive assistant. The executive assistant does not
have subordinates, unlike the vice-presidents.
An unbalanced hierarchy can also be ragged. In a ragged-unbalanced hierarchy, there are gaps in
the levels and the levels descend to different depths.
of the dimension [Products] that is in the namespace [gosales]. The caption for this product is
TrailChef Canteen, which is the name shown in the metadata tree and on the report.
The first level of the hierarchy is automatically defined as the All level. It contains a single root
member, which represents the top level of the hierarchy. For example, the All level for the Time
dimension is named Time (All). You cannot delete or move the All level. You can change its name,
description, and screen tip.
Changes to the hierarchy and level structures may change the level unique name.
The business key values have changed and this changed the member key path.
The production environment has more members than the test environment.
Use unique codes and keys within a dimension for the member keys.
Use unique conformed values for similar dimensions between the target and source environments
when enabling drill through.
When using a dimensionally modeled relational model for drill-through, ensure the root business
key conforms with the root members of the other data sources.
Ensure that the business keys and dimension metadata structure are the same between the
production and test environments.
Do not change the business keys in IBM Cognos Framework Manager after going into production.
Resolve the non-unique keys within a dimension in the data source. Tildes are not recommended
in the category codes.
If you have a Transformer cube that is built with non-unique source values, do not use the
Clean House feature in Transformer because it will most likely change the category codes. We
recommend that you keep a backup copy of your MDL file.
Steps
1. In the Project Viewer pane, select a dimension or level.
2. From the Actions menu, click Edit Definition.
3. Click the Member Sort tab.
4. Select the sorting option to apply.
Sorting Option
Description
Metadata (as shown Used only to specify how members are sorted when displayed in
in the member tree) the metadata tree.
The sort of the metadata tree cannot be changed by report authors.
Data - Only as
Used as the default data sort for members in a report.
Default Report Sort If no data sort is specified, data is retrieved in the order that it was
entered in the database.
Report authors can override this value and apply a different sort
to the members displayed in a report.
Sorting Option
Description
Data - Always
Used to provide member relative functions (MRFs) with a consis(OLAP compatible) tent order of the members. This setting should only be used if
MRFs are required. Otherwise, the sorting results in unnecessary
overhead. Report authors cannot change the order of members as
delivered to the MRFs. However, authors can apply a different
sort to the members displayed in the report.
If no sort is specified and MRFs are used, the report author will
receive an error when MRFs are processed.
When this option is set, the members of the level are also sorted
in the metadata tree even if the Metadata option is not selected.
The sort of the metadata tree cannot be changed by the report
author.
Tips
To apply the default sort order to all child levels within the levels in the dimension that do
not have a sort option defined, click Detect.
To remove sort options from all child levels within the levels in the dimension, click Clear
All.
Roles
Information about roles for SAP BW metadata appears in a different topic (p. 210).
Roles define what appears in the member tree in the IBM Cognos studios. Use roles to organize
and manage metadata and to determine how to present data to your users.
You can also create expressions that refer to roles instead of query items. You must use the
roleValue function to refer to a particular role. For example, you want to query against a specific
role in a hierarchy but the query item playing that role is different at each level of the hierarchy. A
single query can span the different query items at each level. You can also use the roleValue
function when you know the role but not the underlying query item.
Default Roles
The default roles include the following:
_businessKey
Represents the key for the level. The level can be defined as unique if the business key of the
level is sufficient to identify each set of data for a level.
The _businessKey role can be assigned to only one attribute in a level.
The Root Business Key property shows the value of the business key for the root member. The
root member is an artificial level created for dimensionally modeled relational models. To
enable drill-through on conforming dimensions, you must set the Root Business Key property.
_memberCaption
Presents the caption for a member that will be shown in the IBM Cognos studios.
The _memberCaption role is necessary to leverage member functions and to enable dragging
and dropping levels in the IBM Cognos studios.
Ensure that the data type is set to string for the item that will be assigned the _memberCaption
role.
_memberDescription
Returns the description for a member within a dimension.
Custom Roles
By default, attributes are included with no role. You can assign attributes to existing roles or you
can create custom roles. Each role that you create must have a unique name.
You can translate the custom roles in the model.
Specify Roles
Roles define what appears in the member tree in the IBM Cognos studios. Use roles to organize
and manage metadata and to determine how to present data to your users.
Steps
1. Click the dimension whose roles you want to define.
2. From the Actions menu, click Edit Definition.
3. Click the Dimension tab.
4. In the Hierarchies box, click the level you want.
User Guide 123
To use a role defined by Framework Manager, click the Default Roles tab, and select a
role.
To create a role, click the Custom Roles tab, and click Add.
8. Click Close.
9. Click OK.
You can also use the Dimension Map tab to define roles. Click Attributes, right-click the query
item, and click Edit Roles.
Constraints
If the measure dimension contains a folder, you can change the order only in the Project Viewer.
You cannot define hierarchies or levels for a measure dimension.
Steps
1. Click a namespace where you want to place the measure dimension.
124 IBM Cognos Framework Manager
Goal
Action
Embed a calculation
Click Add.
You can also right-click a measure and click Add
or Edit.
Embed a filter
Convert a measure into a query item Right-click the measure and click Convert to Query
Item.
Note: If you test the measure dimension by using the Query Information tab, IBM Cognos BI
validates the measure dimension. If you test the measure dimension by using the Test tab, IBM
Cognos BI executes the measure dimension. The SQL for validate is slightly different than the
SQL for execute. To generate definitive SQL for the measure dimension, use the Test tab.
6. Click OK.
You can also use the Dimension Map tab to create a measure dimension. Click the measure
dimension button
multiple measure dimensions that are related to dimensions at different levels (p. 326)
Steps
1. Double-click the measure dimension that contains the measure.
User Guide 125
Scope Relationships
Scope relationships are necessary to define which dimensions and measures are used together for
dimensionally modeled relational models.
Scope relationships exist only between measure dimensions and regular dimensions to define the
level at which the measures are available for reporting. They are not the same as joins and do not
impact the Where clause. There are no conditions or criteria set in a scope relationship to govern
how a query is formed, it specifies only if a dimension can be queried with a specified fact. The
absence of a scope relationship results in an error at runtime.
If you set the scope relationship for the measure dimension, the same settings apply to all measures
in the measure dimension. If data is reported at a different level for the measures in the measure
dimension, you can set scope on a measure. You can specify the lowest level that the data can be
reported on.
When you create a measure dimension, IBM Cognos Framework Manager creates a scope relationship between the measure dimension and each existing regular dimension. Framework Manager
looks for a join path between the measure dimension and the regular dimensions, starting with the
lowest level of detail. If there are many join paths available, the scope relationship that Framework
Manager creates may not be the one that you intended. In this case, you must edit the scope relationship.
A scope relationship is automatically generated when you drag a dimension into the dimension map
or when you move a query subject into the dimension namespace and convert it to a regular
dimension.
Note: Shortcuts to scope relationships are not supported.
Steps
1. Click the Dimension Map tab.
Tip: To view scope relationships highlighted with a background color, click the show scope
button
If you want to remove the scope, select the hierarchy or dimension and click the remove scope
button
If you select a hierarchy, you can remove the scope from a specific hierarchy without affecting the
scope set in other hierarchies of the dimension.
If you select the dimension, all scope from all hierarchies is removed. The scope relationship between
the measure dimension and the regular dimension is also removed.
Steps
1. Select the objects that you want in a dimension.
2. From the Actions menu, click Merge in New Regular Dimension.
Steps
1. Select one or more objects that you want to explore.
2. From the Tools menu, click Launch Context Explorer.
3. To see the connected objects, click one or more objects and click the appropriate button.
Goal
Button
Test a Dimension
Information about testing SAP BW metadata appears in a different topic (p. 213).
Testing a regular dimension returns the attributes associated with the hierarchy defined as the
default.
You can see the results that an object returns by testing it. You can test when creating an object or
later on. The objects you can test are dimensions, query subjects, query sets, hierarchies, levels,
calculations, and query items.
You can view the data that will appear in a specific report before publishing a package by selecting
and testing the objects that will appear in the report. This makes it easier to debug a model and to
verify that the model meets the reporting requirements because you do not need to create and
publish packages first.
When you test an object, IBM Cognos Framework Manager returns sample data. Formatting is
not applied to the sample data. If you must test formatting, you must publish the package and view
the objects in the IBM Cognos studios.
You may see different results depending on what you test. For example, if you use the expression
editor to test a calculation that is embedded in a query subject, Framework Manager tests only the
expression, not the item, so the aggregation setting for the query item is not applied to the test.
Testing the entire query subject, which includes the calculation, gives a different result because the
aggregation setting is applied. For example, if the aggregation setting is summarize, you can see a
smaller number of rows in the test.
If you test a child segment of a segmented model, you may see an error if an object you are testing
refers to an object in another child segment and the referenced object is not available to the project
you are in. We recommend that you check that the parent model contains all the objects and that
this error message does not appear when you test the parent model.
Governor settings may affect the testing results. For more information, see "Set Governors" (p. 304).
You can change existing test settings to customize the results that the test shows. For example, in
addition to other settings, you can control the number of rows returned.
Steps
1. Select the object that you want.
2. From the Actions menu, click Edit Definition and then click the Test tab or the Query Information tab.
3. Click Options and then click the Test Settings tab.
4. Choose the options that you want.
Goal
Action
Persistence
This setting applies to all
dimensions, query subjects, and
query sets in the model.
Goal
Action
Persistence
Temporarily override In the Session Parameters box, The override values are not
session parameters
saved with the model. This setclick Set.
ting is for your current session
The Session Parameters dialog
only.
box appears.
Apply relevant design Select the Apply all relevant
This setting is saved and used in
mode filters
design mode filters when testing your next session with any
model.
check box.
This applies all relevant filters
whose usage is set to design
mode in another dimension,
query subject, or query set.
Apply a security filter In the Security Filters box, click This setting is saved and used in
your next session with this
Edit.
model.
Change the prompt
values
In The Current Prompt Values The prompt values are not saved
with the model.
box, click Prompts.
The Model Prompts Manager
dialog box appears, which
shows all prompts, and their
values, that are in the model.
Constraint
If a dimension has multiple hierarchies, only the default hierarchy is included when you convert
the dimension to a query subject.
Steps
1. Click the regular dimension.
2. From the Actions menu, click Convert to Query Subject.
Multilingual Metadata
For models that are published in multiple languages, you can view and modify model objects in the
different languages.
We recommend that you handle multilingual support in the import view for a variety of reasons.
You can reduce the number of query items contained in each dimension and query subject. With
fewer dimensions, query subjects, and query items, the model is more manageable. You can simplify
maintenance by doing all multilingual work in one place instead of in different business views. This
ensures consistency because the languages are set up correctly for all modelers to use. This is particularly important for segmented models.
To support multilingual metadata, do the following:
Define one or more parameter maps that translate the locale used when the report is run into
the language values in the data source (p. 163).
Use a macro to dynamically substitute language values from the language lookup table using
the runLocale session parameter as the key (p. 168).
Export multilingual properties in translation tables, which translators use to enter the correct
text for each language (p. 135).
Import the table that contains the translated property values (p. 136).
For information about how to enable multilingual modeling, see "Example - Create a Multilingual
Project for Relational Metadata" (p. 136).
Define multilingual properties, such as a name, screen tip, and description, for each entry
in the portal.
Specify a language, other than the default, to be used when a report is run.
For more information, see the IBM Cognos Connection User Guide.
Any text that users or authors add appears in the language in which they typed it.
Language-specific columns
A database table should contain the same columns for each supported language. For example,
if the Product table supports English, French, and German, the table has columns for ProductName_en, ProductName_fr, and ProductName_de.
Language-specific rows
A database table should contain an additional column to identify the language of each row of
data, such as a column named LANG.
These solutions can make the multilingual data sources large and difficult to manage.
You can model a single relational query subject to represent all possible data source languages by
using parameter maps and session parameters in the query subject definition. For more information,
see "Creating Prompts with Query Macros" (p. 168) and "Multilingual Metadata" (p. 131).
Note: Expression syntax is specific to the design language of the model. If you import objects from
a model designed in another language, you may have to adjust the expression syntax.
Select
PRODUCT_TYPE.PRODUCT_TYPE_CODE,
PRODUCT_TYPE.PRODUCT_LINE_CODE,
PRODUCT_TYPE.PRODUCT_TYPE_
#$Language_lookup
{$runLocale}# as Product_type
from
[gosales].PRODUCT_TYPE
PRODUCT_TYPE
Select
PRODUCT.PRODUCT_NAME,
PRODUCT_MULTILINGUAL.
PRODUCT_NUMBER
from
[gosales].PRODUCT,
[gosales].PRODUCT_MULTILINGUAL
Where
PRODUCT.PRODUCT_NUMBER =
PRODUCT_MULTILINGUAL.
PRODUCT_NUMBER
and
(PRODUCT_MULTILINGUAL."LANGUAGE" =
#sq($Language_lookup{$runLocale})#
design language
This is the language in which the model was originally created. This value is stored in the model
and cannot be changed. It serves as the default language value.
active language
This is the language in which model content is currently shown. When you open a model, the
active language is set to the language in the model that most closely matches the region and
language settings of the computer. You can change this value at any time for your current session
only. In future sessions, the model continues to open in the design language.
Steps
1. From the Project menu, click Languages, Define Languages.
2. In the Available languages box, select each language you want to add and click the arrow button
to move it to the Project languages box.
Tip: To remove a language, select it in the Project languages box and click the arrow button
to move it to the Available languages box.
3. If you want to change the active language, in the Project languages box, click a language and
click Set as Active.
4. Click OK.
At the prompt, accept the changes you made to the project.
5. Click OK.
6. If you want to view multilingual property values in the Properties pane, click the Languages
tab.
Steps
1. Select the objects you want to export.
2. From the Project menu, click Languages, Export Translation File.
3. In the Project Languages box, click the languages you want to export, and click the arrow
button to move them into the Languages to be exported box.
You must export the design language of the model that will use the translation table. For
example, if the translation table will be used in a model that uses French as the design language,
you must export French.
Steps
1. From the Project menu, click Languages, Import Translation File.
2. In the Project Languages box, click the languages in the translation table, and click the arrow
buttons to move them to the Translate from and Translate into box.
You must select the design language for this model.
3. In the Apply translation to box, select whether you want to apply the translation to all model
objects, or only to preselected objects and their children.
4. Enter the location and name of the translation file.
5. Click OK.
Steps
1. Open the go_data_warehouse project.
Ensure that the Project languages pane contains English, French, and German.
In the Project Viewer pane, click a query item and, in the Properties pane, click the Languages tab.
For the name, description, and tool tip text, you see one entry for each language.
3. Export all the languages and objects in the project to a comma-separated value file (.csv) named
GOSLDW-ML.csv.
In the Project Languages box, Ctrl+click English, French, and German, and click the top
arrow to move them to the Languages to be exported box.
In the Export languages to this file box, enter the location of GOSLDW-ML.csv.
4. Open the GOSLDW-ML.csv file in Microsoft Excel, and translate the strings.
Note that each column represents a given language, and the file contains only the text strings
that exist in the model.
5. In Framework Manager, import the translated file:
In the Project Languages box, move French and German into the Translate into box.
In the Import translation table from this file box, enter the location of GOSLDW-ML.csv.
Key
Value
de
DE
en
EN
fr
FR
8. Select an object that contains multilingual columns, such as the Order method dimension, and,
from the Actions menu, click Edit Definition.
9. To preview the results, click the Test tab and then click Test Sample.
10. From the Project menu, click Session Parameters and change the runLocale session parameter
value to fr.
11. Test the Order method dimension again to view the results.
Query Items
Information about query items for SAP BW metadata appears in a different topic (p. 219).
A query item is the smallest object in the model that can be placed in a report. It represents a single
instance of something, such as the date that a product was introduced.
For relational metadata, you can modify the properties of query items by
setting Usage and Regular Aggregate properties to reflect the intended use of the query item
(p. 141)
formatting query items to control how data appears in a report (p. 148)
identifying a column as a prompt, and controlling how your users see the prompt information
(p. 149)
You can also modify the properties for multiple query items at the same time (p. 34).
Because reports can contain different query items from one or more objects in the model, query
item properties control many aspects of the final report. When you create a model dimension or
model query subject, the query items inherit the properties of the data source query items on which
they are based.
The properties for query items or measures include the following.
Description
Name
Description
Last Changed
The date that the query item or measure was last changed. The
property is automatically updated with the current date time.
Description
Last Changed By
The user who last changed the query item or measure. This
property is automatically updated when the item is changed.
The value is the current logon username.
Model Comments
Used to add internal comments about the model. The information is used on the Analyze Publish Impact dialog and in the
Model Report. Comments are not accessible to package users.
Screen Tip
Expression
External Name
Is Hidden
Usage
The intended use for the data represented by the query item.
This property is for query items only.
Format
Currency
Data Type
Description
Precision
Scale
Size
Is Nullable
Display Type
MIME Type
Prompt Info
Prompt behavior.
Regular Aggregate
Aggregate Rules
Description
Allocation Rule
Is Unsortable
You can rename a query item in the Calculation Definition dialog box. Renaming the query item
updates references to this query item.
You may be interested in the following related topics:
the Usage, Regular Aggregate, and Aggregate Rules properties (p. 141)
Object
Usage property
Attribute
Unsupported
Identifier
Count
Measure in a measure
dimension
Fact
If the measure is semi-additive, use the Aggregate Rules property to define rules for semi-additive
aggregation (p. 146).
Object
Usage property
Identifier
Count
Count
Count
Fact
Attribute
stand-alone calculations
calculations that are embedded within measure dimensions and are based on measures from
the same measure dimension
The calculated aggregation type is not supported for calculations that are embedded within query
subjects.
Framework Manager uses the following rules to interpret the calculated aggregation type in the
Regular Aggregate property:
Standard aggregation functions (average, count, maximum, minimum, standard deviation, sum,
variance) and references to model query subjects are aggregated first. The remaining operations
are then applied to the aggregation result.
For example, to divide debt by credit for each row, the SQL looks like this:
Select
customer, debt, credit, debt/credit as
percent_debt from x
If the query item in the calculation is a fact and the aggregation type for the query item is
average, count, maximum, minimum, or sum, the aggregation type of the query item is used.
If the query item in the calculation has no aggregation type set, the aggregation type minimum
is applied in the query. It is not possible in SQL to have an aggregation setting of none.
Aggregate functions are interpreted as if they are applied to a value in a single row when these
functions are used in the detail context. For example, a Report Studio report has the Auto
Group and Summarize property set to false.
Aggregation of a query item is based on the aggregated expression derived from the item definition.
For example, you want to total this stand-alone calculation:
[namespace].[Company].[debt]
/ [namespace].[Company].[credit]
Scalar aggregates, also known as running, ranking, and moving aggregates, are calculated for
report granularity unless the For clause is explicitly specified.
Granularity of aggregate functions is set by grouping for determinants or by keys of corresponding levels in the cube.
For example, Rank([namespace].[Company].[debt] is interpreted as Rank([namespace].
[Company].[debt] for Report).
Calculation
Aggregation type
Calculated
Calculated
Calculated
Unsupported
Calculation
Aggregation type
Sum
Maximum
Count
Usage Property
The Usage property identifies the intended use for the data represented by each query item. During
importing, the Usage property is set according to the type of data that the query items represent in
the data source.
Usage property
Database object
Description
Identifier
Fact
numeric, timeinterval
Attribute
string
automatic
average
calculated
count
count distinct
maximum
minimum
sum
the Regular Aggregate property is applied to dimensions that are included in the query but are
not referenced in the Aggregate Rules dialog box
the aggregation that is specified in the Aggregate Rules dialog box is applied to their specified
dimensions, in the order that you specified the rules
For example, inventory is recorded in the data warehouse with opening and closing balances at the
month grain. If you need to report on inventory for different periods of time, you apply an aggregate
that takes the value from the appropriate time slice within the period. For an opening balance, the
value is the last balance of the previous month. For a closing balance, the value is the last balance
of the current month. In this example, the inventory measure has a Regular Aggregate property of
total and an aggregate rule for the time dimension with a value of last.
You can have only one aggregate rule for each dimension.
Note: There must be a direct relationship between the underlying query subjects from which the
measure and dimension are constructed. For example, consider the Inventory measure dimension
and the Time dimension:
You want to define an aggregate rule for Closing inventory that generates the last closing inventory
recorded for any given period of time:
If a relationship does not exist, running a query that contains the measure Closing inventory generates
the following error:
RQP-DEF-0564 Unable to determine fact grain of semi-additive dimension '[Dimensional view].[Time
dimension]' for measure '[Dimensional view].[Inventory].[Closing inventory]'. Verify that a relationship is defined between the underlying query subjects from which the dimensions are constructed.
Semi-additive measures are not supported for sparse data. Sparse data is multidimensional data in
which many of the combinations of dimension values do not have related fact data.
For SAP BW metadata, the Aggregate Rules property value is read-only. The Semi-Aggregate
property is used instead.
Steps
1. Click the measure you want to work with.
2. In the Properties pane, click the ellipsis (...) button in the Aggregate Rules property.
3. To add a dimension for this measure, click Add and select the dimension.
You can include a shortcut to a dimension if there is a scope relationship between the measure
dimension and the regular dimension.
4. To specify the aggregate operation, click the ellipsis (...) button in the Aggregation Rules box.
The following operations are supported:
sum
minimum
maximum
average
first
last
5. If you want to change the order of the aggregate rules, use the arrow buttons.
Semi-Aggregate Property
For relational metadata, the Semi-Aggregate property value is set to unsupported and is read-only.
If the value is set to unsupported in IBM Cognos Framework Manager, the semi-aggregate
behavior is ignored in the IBM Cognos studios.
The Semi-Aggregate property will not be supported in future releases. Instead, use the Aggregate
Rules property for semi-additive measures.
Identifier
Count
Attribute
Unsupported
Fact
Sum
Steps
1. In the Project Viewer pane, click one or more dimensions or query subjects.
2. In the Properties pane, click the Properties tab.
3. Change the Usage property to unknown.
4. Change the Regular Aggregate property to unsupported.
5. From the Tools menu, click Determine Usage.
6. From the Tools menu, click Determine Aggregation Rules.
Steps
1. In the Project Viewer pane, click the query item you want to format.
2. In the Properties tab of the Properties pane, click the Format property.
3. Select the appropriate Format type.
4. In the Properties box, select or type the appropriate property value.
5. Click OK.
Query Studio to create a filter expression and set the use and display items in a prompt and
prompt query
the Build Prompt Page tool in Report Studio to create a filter expression and set the use and
display items in a prompt and prompt query
generated prompts in Report Studio to set the use and display items in the prompt and prompt
query
parameter maps
session parameters
For example, a stored procedure returns all rows with a specific product number. Instead of using
the product number as the argument for the stored procedure, you can use a prompt, such as
?Product_Number?.
For examples of prompts, see "Creating Prompts with Query Macros" (p. 168) and "Example - Use
Prompts with a Stored Procedure" (p. 92).
For more information about creating prompts, see the Report Studio User Guide.
Steps
1. Click the query item.
2. In the Properties pane, click the Properties tab.
3. Click the plus sign (+) next to the Prompt Info property.
This is a compound query item property.
4. Modify the following properties to reflect the behavior you require.
Goal
Property
Set the type of prompt control that is generated when Prompt Type
the report is run.
Set the generated prompt as part of a series of gener- Cascade On Item Reference
ated cascading prompts.
Goal
Property
Specifies which query item is displayed to the report Display Item Reference
user in the prompt.
The values in the prompt are data values of the query
item.
Each value in the prompt is associated with a value
in the query item specified in the Use Item Reference
property.
Specifies which query item is passed from the prompt Use Item Reference
to the filter.
Each value is associated with a value in the query item
specified in the Display Item Reference property.
Specifies which query item is used in the filter expres- Filter Item Reference
sion to retrieve data.
Value
Prompt Control
Server Determined
Edit Box
Select Date
Select Date/Time
Select Interval
Value
Prompt Control
Select Time
Select Value
A drop-down list.
Query Studio to create a filter expression and set the use and display items in a prompt and
prompt query
the Build Prompt Page tool in Report Studio to set the use and display items in a prompt and
prompt query
generated prompts in Report Studio to set the use and display items in the prompt and prompt
query
Note: The values of the Use Item Reference and Filter Item Reference properties must be compatible.
Otherwise, the report user may receive unexpected results. For more information, see the Filter
Item Reference property (p. 153).
Default: If no values are set, the properties default to the name of the query item.
These properties are used only for data driven prompt controls whose Prompt Type property is set
to either Select Value or Select with Search.
the Build Prompt Page tool in Report Studio to create a filter expression
Default: If no value is set, the property defaults to the name of the query item.
Using the Filter Item Reference and Use Item Reference Properties
The values of the Filter Item Reference and Use Item Reference properties must be compatible. The
value of the Use Item Reference property must be a type that is expected by the Filter Item Reference
property. Otherwise, the report user may receive unexpected results. This may occur when a report
user creates a filter without creating a prompt page.
In an example model, the Use Item Reference property is set to Employee Number and the Filter
Item Reference property is Employee Name. In Report Studio, a report author creates the following
filter without creating a prompt page:
Reference.EmployeeName in ?parm1?
Report Studio automatically generates prompts when you create a filter without creating a prompt
page. Because the prompt is generated, Report Studio uses the Prompt Info properties from the
Employee Name query item in the Framework Manager model.
The Use Item Reference indicates that the values being passed to the filter are employee numbers.
The Filter Item Reference is filtering data based on Employee Name. The filter is as follows:
Reference].[Employee Name] in ("1", "2"). Since there are no Employee Name values of
"1" or "2", the report will be blank.
User Guide 153
Testing a Prompt
When you test a model object that references a prompt, IBM Cognos Framework Manager asks
you to enter the prompt value. Framework Manager uses this value for either the duration of the
session, or until you clear the prompt value.
You can change the session value of prompt values through the Options dialog box. This dialog
box is available when you modify a dimension or query subject, or define a calculation, filter, query
set, or complex relationship. You can change the prompt value at the time that you are testing the
expression that references that value.
If you select the Always prompt for values when testing check box in the Prompt dialog box,
Framework Manager prompts you for a value every time you test the object. When updating the
object or performing a count, Framework Manager uses the existing prompt value, if one exists.
A prompt on a query item in a model query subject is associated only with that query item. A
prompt on a query item in a data source query subject is associated with the entire query subject
and therefore, the prompt appears when you test any query item in the query subject.
Steps
1. Double-click the measure dimension that contains the query item.
2. Click the Measure Dimension tab.
3. Right-click the query item and click Convert to Measure.
4. Click OK.
add calculations so that your users can include calculated data in their reports (p. 155).
create and apply filters so that you limit the data that a query subject retrieves (p. 158).
add prompts that will automatically appear whenever a dimension or query subject is used in
a report; report consumers are then prompted to filter data (p. 149).
use session parameters (p. 165) and parameter maps (p. 163) in macros (p. 168) to dynamically
resolve expressions.
create a security filter to control the data that is shown to your users when they set up their
reports (p. 257).
Create a Calculation
Information about calculations for SAP BW metadata appears in a different topic (p. 237).
You can create calculations to provide your users with calculated values that they regularly use.
Calculations can use query items, parameters, variables, calculated members, expressions, and
expression components, such as functions.
Punctuation characters, such as the question mark (?), must be in 7-bit ASCII character code. If
you type a punctuation character from a multi-byte enabled keyboard, ensure that you type the 7bit ASCII representation of the character. For example, type Alt+063 for the question mark.
Avoid using characters that are used for expression operators in the name of the calculation. Syntax
errors may occur when the expression is evaluated. For example, a calculation named Margin * 10
causes errors when used in an expression such as [Margin * 10]< 20.
In expressions, an operator or function may require operands to be of a particular dimensional
type. When an operand is not of the required type, one or more coercion rules may be applied to
coerce the operand to the appropriate type. Because coercion rules are not applied to expressions
in model query subjects, ensure that those expressions are valid without relying on coercion rules.
For more information about coercion rules, see the IBM Cognos Report Studio User Guide.
Use an embedded calculation when you want to use a calculation with only one dimension or
query subject.
You can create an embedded calculation when modifying a relational data source query subject,
model query subject, or dimension.
If you start with an embedded calculation, you can later convert it into a stand-alone expression
that you can apply to other dimensions or query subjects. Tip: Right-click the calculation
expression in the Calculations tab and click Convert to Stand-Alone Calculation.
When you embed a calculation, the data source query subject must have a relationship to any
query subject referenced by the expression. This relationship is necessary even if the expression
references a model query subject based on the same table as the data source query subject in
which you are embedding the expression.
To create a calculation on an unrelated query subject, do one of the following:
Ensure that there is a join path between the new query subject and the one that contains
the calculation.
Base the embedded calculation on a query item that is based on the data source query
subject you want.
Convert the calculation to a stand-alone calculation, so that it is not part of the query
subject.
To create a stand-alone calculation, click the namespace or folder and, from the Actions
menu, click Create, Calculation.
To create an embedded calculation for a data source query subject, double-click the data
source query subject. On the Calculations tab, click Add.
To create an embedded calculation for a model query subject, double-click the model query
subject. On the Query Subject Definition tab, click Add.
Goal
Action
Add items
On the Model tab, click a query item, filter, or calculation and click the arrow.
Add functions
Add parameters
Click the options button, select the Restrict the maximum number of rows to be returned check box, and
type the required number of rows to be returned.
You can test only calculations that contain query items. If a calculation contains a function,
for example _add_days, the Test Sample button is not available.
Tip: If there is an invalid expression in the calculation, review the Tips box in the expression
editor for more information.
5. Click OK.
6. Modify the Data Type property to identify the type of data the calculation returns.
The IBM Cognos studio uses this information to format the data that the calculation returns.
You may be interested in the following related topics:
Create a Filter
Information about filters for SAP BW metadata appears in a different topic (p. 239).
A filter is an expression that specifies the conditions that rows or instances must meet to be retrieved
for the dimension, query subject, calculation, or report to which the filter is applied. A filter returns
a boolean value so that you can limit the rows returned by a dimension or query subject.
For example, you can use the in_range function to create a filter that retrieves data for products
introduced in a specific time frame. The syntax for this example looks like this:
[gosales_goretailers].[Products].[Introduction
date]
in_range {Feb 14, 1999 : July 14, 2007}
Note: When using a date or time function, you must use a 24-hour clock. IBM Cognos Framework
Manager does not support "a.m." or "p.m." in expressions. For example, use 20:00 to signify 8
p.m.
You can restrict the data represented by dimensions or query subjects in a project by creating a
security filter. The security filter controls the data that your users can see when they set up their
reports.
You can also apply governors to restrict the data that the queries in a package retrieve.
Framework Manager supports stand-alone filters and embedded filters.
Use an embedded filter when you want to use a filter with only one dimension or query subject.
Ensure that there is a join path between the new query subject and the one that contains
the filter.
Base the embedded filter on a query item that is based on the data source query subject
you want.
Convert the calculation to a stand-alone filter, so that it is not part of the query subject.
Steps
1. Do one of the following:
If you want to create a stand-alone filter, click the namespace or folder and, from the
Actions menu, click Create, Filter.
If you want to create an embedded filter, double-click the dimension or query subject that
will contain the filter, click the Filters tab, and then click Add.
Goal
Action
Add functions
Add parameters
Goal
Action
Retrieve all data and show a speci- Click the options button, select the Restrict the
fied number of rows
maximum number of rows to be returned check box,
and type the required number of rows to be
returned.
4. Click OK.
You can also apply governors to restrict the data that the queries in a package retrieve (p. 304).
You may be interested in the following related topics:
Apply a Filter
Information about filters for SAP BW metadata appears in a different topic (p. 242).
To apply a filter, you must modify the dimension, data source query subject, or model query subject.
The query subject must either contain the query items that the filter references, or have a relationship
path to the query subjects that contain the query items.
You can embed a stand-alone filter in dimensions or query subjects, but if you want a different
usage for each embedded filter, you must create different versions of the stand-alone filter. Otherwise,
your users could be required to fill in a prompt that you thought was optional if there is any instance
Steps
1. Create a filter.
2. Select the filter and, from the Actions menu, click Edit Definition.
3. Click the Filters tab, and drag the filter you created to the Filters box.
4. Select a usage value for the filter.
Usage Value
Description
Always
Use this usage value to ensure specified data is filtered out of all
reports. For example, your company may have obsolete information that it stores but does not want to report on.
Always is the default usage value.
Retrieves a small subset of the data for the sample report. Use this
usage value when you do not need to see all the data, for example
when testing a query subject.
To apply design mode filters in Framework Manager, select the
Apply all relevant design mode filters when testing option. This
option is available on the Test Settings tab.
Your users may need the design mode filter in Query Studio when
they want to focus on designing the layout and format of a report
and not retrieve all the data as they work. To access the design
mode filter in Query Studio, run the report with limited data.
Usage Value
Description
Optional
5. If you want to view the SQL, click the Query Information tab.
6. Click OK.
Steps
1. Open the go_sales sample model. It is located in c10_location/webcontent/samples/Models/go_
sales/go_sales.cpf
2. Create a filter to limit the retrieval of data to only those country codes in the conversion rate
table whose value is 2:
Click the Filters folder and, from the Actions menu, click Create, Filter, and name the new
filter ConversionRateCountryCode.
In the Available Components box, open the Database view folder and then open the GoSales
folder.
Add the Country Code query item from Conversion Rate query subject to the Expression
definition box, and type ='2' at the end of the expression.
Click OK.
In the Available Model Objects box, open the Database view folder.
Add Country query item and the ISO 3-letter code query item from the Country query
subject to the Query Items and Calculations box.
Open the Filters folder and drag ConversionRateCountryCode to the Filters box.
Click the ellipsis (...) button under Usage for the ConversionRateCountryCode filter, and
click Optional.
7. If you want to view the SQL, click the Query Information tab.
8. Click OK.
Constraint
We recommend that you do not base a parameter map on a query item or table with a large result
set, such as 50,000 rows. Each time you use the parameter map in an expression or in SQL,
To manually enter values, click New Key, type a key, and press Tab to enter a value for
that key.
To import keys and values, click Import File and identify the location of the appropriate
.csv or .txt file. For a .txt file to be used for import, the values must be separated by tabs
and the file must be saved as UTF8 or Unicode format. ANSI text files are not supported.
Note: If you are going to use a parameter in a data source query subject, the value must use
English-specific punctuation. This means that you must use a period (.) to represent a decimal
and a comma (,) to separate lists of values.
5. Modify existing parameters as required.
Goal
Action
Remove a parameter
Modify a parameter
Select the row you want to modify, click the Edit button, and type a value.
6. Click Finish.
Key
Value
en
EN
fr
FR
When you examine the SQL for the Product Line query subject, you see the following:
Select
PRODUCT_LINE.PRODUCT_LINE_CODE,
#'PRODUCT_LINE.PRODUCT_LINE_' + $Language_lookup{$runLocale}#
as Product_Line
from
[gosales].PRODUCT_LINE PRODUCT_LINE
The runLocale macro returns a locale setting that is used by the Language_lookup macro to specify
a language value.
runLocale
Returns the code for the current active language in Framework Manager. The model content
is shown in this language.
You can change the active language at any time for your current session only. In future sessions,
the model continues to open in the design language. For more information, see the section "Add
a Language to a Project" (p. 134).
account.defaultName
Specifies the name of the current user as defined in the authentication provider. For example,
user's first and last name.
If you log on anonymously, you will see Anonymous.
account.personalInfo.userName
Specifies the user ID used to log on to IBM Cognos BI.
If you log on anonymously, you will not see this parameter.
current_timestamp
Specifies the current date and time.
machine
Specifies the name of the computer where Framework Manager is installed.
If your authentication source supports other parameters and you entered information about them
in the authentication source, you see other session parameters, such as account.personalInfo.email
or account.personalInfo.surname.
You can define additional parameters by using model session parameters. Model session parameters
are stored in a parameter map named _env. They are set in the project and can be published with
a package.
Model session parameters must have their values set within the scope of objects in the Framework
Manager model. The scope can include the use of existing environment session parameters, as well
as static values.
Each session parameter must have a name and a default value. You can define an override value to
test the results that value returns. The override value is valid only when you have the model open,
and is not saved when you save the model. If no override value exists, Framework Manager uses
the default value when it executes a query that contains a session parameter.
The rules governing the use of parameters include the following:
All possible return values must have the same data type.
Steps
1. From the Project menu, click Session Parameters.
2. Click New Key and type a session parameter key and value.
3. Choose how to handle the override value.
To avoid having to set the override value every time you edit the project, set the session
parameter as a value.
To avoid having to remove the project setting each time before you publish it, set the session
parameter as a session override.
Goal
Action
Remove a parameter
5. Click OK.
They can be used to dynamically complete the properties of a data source query subject.
This enables different users to supply different connection information and thus access different
data sources. The properties that can contain macros are: Content Manager Datasource, Catalog,
Cube, and Schema.
An example using the Content Manager Datasource property is #$DataSourceMap{$UserId}#
You can replace the following query subject elements with a parameter.
Element
Example
#'Product_name_'+ $languageCode#
Product_#$language#
Where clause
Product_lang = #sq($languageCode)#
Element
Example
#$data_source#.#$schema#.Products
Syntax
Use the following syntax to reference session parameter and parameter values.
Object
Syntax
Example
Session key
$session_key
#$my_account#
$map{<key>}
#$map_one{'abc'}#
#$map_one{$my_account}#
You can add the following elements to further define the macro expression.
Symbol
Purpose
Square brackets [ ]
Encloses model objects, such as a namespace or query subject and macro names that contain restricted characters,
such as a number sign, hyphen, or space.
Symbol
Purpose
+ operator
For information about functions, see "Using the Expression Editor" (p. 381).
Create a Macro
Macros are fragments of code that you can insert anywhere in the Select statement that defines
a query subject. You can include references to session parameters, parameter maps, and parameter
map entries. Parameter values are set when you run the query.
Constraints
When you reference a parameter, you must do the following:
use a number sign (#) at the beginning and end of each set of one or more parameters.
Everything between the number signs is treated as a macro expression, which is processed at
runtime. Framework Manager removes anything that is outside the number signs.
Do not insert macros between existing quotation marks or square brackets because IBM Cognos
Framework Manager does not execute anything within these elements.
Steps
1. Select the data source query subject you want to modify.
2. From the Actions menu, click Edit Definition.
3. On the SQL tab, click Insert Macro to start the Macro Editor.
4. In the Available components box, click the parameter maps, session parameters, or functions
you want to use, and drag them to the Macro definition box.
Ensure that you type the macro expression between the number signs. If you enter text before
or after the number signs, when you click OK, Framework Manager deletes this text.
5. Insert single or double quotation mark functions.
Tip: Click the arrow next to these buttons
quotation marks.
6. If you want to edit a parameter map or session parameter, click it in the Macro definition box.
The Parameter Map or Session Parameters dialog box appears. You can set override values for
session parameters, add new items, or change values.
7. Check the macro in the Information box.
If a macro is incorrect, an error message appears.
Tip: To clear a macro, click the clear all button
8. Click OK.
When default values are specified in the syntax of macro prompts, you may see an error. Use prompt
syntax such as where Country = ?Enter Country?.
The prompt and promptmany functions have the following parameters. All argument values must
be specified as strings.
Name
This mandatory parameter is the name of the prompt. Name can also refer to the name of a
parameter on a user-created prompt page, in which case the user-created prompt page appears when
the report is run instead of the default prompt page that the macro would generate.
Datatype
This optional parameter is the prompt value data type. The default value is string. Prompt values
are validated. In the case of strings, the provided value is enclosed in single quotation marks and
embedded single quotation marks are doubled.
Values include the following:
boolean
date
datetime
decimal
double
float
int
integer
interval
long
memberuniquename
Memberuniquename is not an actual data type. This value must be used when the data type of
the parameter is member unique name (MUN).
numeric
real
short
string
time
timeinterval
timestamp
token
Token is not an actual data type. It is a way to pass SQL. A token does not pass values.
xsddate
xsddatetime
xsddecimal
xsddouble
xsdduration
xsdfloat
xsdint
xsdlong
xsdshort
xsdstring
xsdtime
DefaultText
This optional parameter is the text to be used by default. If a value is specified, the prompt is
optional.
Text
This optional parameter is text that precedes any user-provided values, such as 'and column1 = '.
QueryItem
This parameter is optional. The prompt engine can take advantage of the Prompt Info properties
of the query item. Descriptive information can be shown, although the prompt value is a code.
TextFollowing
This optional parameter is the closing parenthesis that is used most often for the promptmany
function. This parameter is also useful when the prompt is optional and is followed by hardcoded
filters in the SQL statement.
The Datatype argument is not specified. Therefore, it is a string, which is correct in this case.
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.COUNTRY = #prompt('CountryName')#
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.COUNTRY_CODE >
#prompt('Starting CountryCode',
'integer',
'',
'',
'[gosales].[COUNTRY_MULTILINGUAL].[COUNTRY_CODE]')#
Optional Prompt and Mandatory Filter with the Data Type and Default Value Specified
Note the following:
The DefaultText argument is specified. Therefore, the user may omit entering a value, in
which case the value 10 is used. This makes it an optional prompt, but not an optional filter.
Example 1:
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.COUNTRY_CODE >
#prompt('Starting CountryCode',
'integer',
'10'
)#
Example 2:
[gosales].[COUNTRY].[COUNTRY] = #prompt('countryPrompt','string','''Canada''')#
Result 2:
[gosales].[COUNTRY].[COUNTRY] = Canada
The defaultTextparameter must be specified such that is literally valid in the context of the
macro, because no formatting takes place on this value. See details below.
The default string Canada in Example 2 is specified as a string using single quotes, in which
the embedded single quotes are doubled up, thus 3 quotes. This results in the string being
properly displayed within single quotes in the expression.
As a general rule for the string datatype, the defaultText should always be specified as in
the previous note, except in the context of a stored procedure parameter.
For the defaultText of types date or datetime, a special format should be used in the context
of SQL. Examples of these formats are DATE 2001-12-25 and DATETIME 2001-12-25
The DefaultText argument is specified as a space character. In this case, the generated text is
just the space character, which eliminates the Where clause from the query.
The Text argument is specified, which is written into the generated SQL before the user-provided
prompt value.
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
#prompt('Starting CountryCode',
'integer',
' ',
// < = = this is a space
'where COUNTRY_MULTILINGUAL.COUNTRY_CODE >'
)#
Syntax Substitution
Note the following:
The Datatype argument is set to token, which means that the user-provided value is entered
without any checking on the provided value.
Because checking is not performed on the value, the expression editor may indicate that the
expression is not valid. When a valid user-provided value is supplied or if you provide a valid
default value, expression editor will interpret the expression as valid.
Token should be used only if there is a list of pick-values for the user.
The DefaultText argument is specified. Therefore, this is an optional prompt and group by
COUNTRY is used in the generated SQL.
Select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
#prompt('Sort column',
'token',
'group by COUNTRY',
'group by '
)#
The name of the prompt is specified using a lookup in the parameter map named PromptLabels.
The key value is the session variable $language.
select
ORDER_METHOD.ORDER_METHOD_CODE as ORDER_METHOD_CODE,
ORDER_METHOD.ORDER_METHOD_#$language#
as ORDER_METHOD_EN
from
gosales.gosales.dbo.ORDER_METHOD ORDER_METHOD
#prompt($PromptLabels{$language},
'',
' ',
'where ORDER_METHOD.ORDER_METHOD_' + $language + '
>'
)#
Part of the prompt information is run from a parameter map instead of being coded directly
inside the SQL.
The whole macro containing the prompt can be a value in a parameter map.
select
ORDER_METHOD.ORDER_METHOD_CODE as ORDER_METHOD_CODE,
ORDER_METHOD.ORDER_METHOD_#$language#
as ORDER_METHOD_EN
from
gosales.gosales.dbo.ORDER_METHOD ORDER_METHOD
#prompt($DynPromptLabels{'ex9'},
'',
' ',
'where ORDER_METHOD.ORDER_METHOD_' + $language + '
>'
)#
This resembles the first example on prompting for a country (p. 174).
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
This resembles the second example on prompting for a country (p. 174).
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.COUNTRY_CODE
IN (
#promptmany('Selected CountryCodes',
'integer',
'',
'',
'[gosales].[COUNTRY_MULTILINGUAL].[COUNTRY_CODE]')#
)
Optional Prompt with the Data Type and Default Value Specified
Note the following:
The In clause and both parentheses are part of the SQL statement.
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
where COUNTRY_MULTILINGUAL.COUNTRY_CODE IN (
#promptmany('Selected CountryCodes',
'integer',
'10'
)#
)
select
COUNTRY_MULTILINGUAL.COUNTRY_CODE as COUNTRY_CODE,
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
COUNTRY_MULTILINGUAL."LANGUAGE" as LANGUAGE1,
COUNTRY_MULTILINGUAL.CURRENCY_NAME as CURRENCY_NAME
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
#promptmany('Selected CountryCodes',
'integer',
' ',
// < = = this
is a space
Keep the metadata from the data source in a separate namespace or folder.
In IBM Cognos Framework Manager, this is called the import view.
Create one or more optional namespaces or folders for resolving complexities that affect
querying using query subjects or dimensional objects.
To use IBM Cognos Analysis Studio or any OLAP-style queries, there must be a namespace or
folder in the model that represents the metadata with dimensional objects.
Create one or more namespaces or folders for the augmented business view of the metadata
that contains shortcuts to dimensions or query subjects.
In Framework Manager, these are called the business view. Use business concepts to model the
business view. One model can contain many business views, each suited to a different user
group. You publish the business views.
Security can be defined in any of the views. It depends on your business requirements. For example,
if you need to keep everyone from viewing an object, you add security to the object in the import
view. Typically security is applied in the business view.
To organize the model, you can do the following:
Star schema groups can contain the selected dimensions, query subjects, or shortcuts. The objects
in a star schema group cannot reference, or be referenced by, any object outside the group. Therefore,
Framework Manager automatically creates a shortcut for any object that is referenced by an object
outside the group.
For example, in a project for sales analysis, you include these dimensions:
Steps
1. Select one or more dimensions or query subjects.
2. From the Tools menu, click Create Star Schema Grouping.
180 IBM Cognos Framework Manager
To add shortcuts to the group, click Create a shortcut for all selected objects.
To move the objects to the group, click Create shortcuts only for objects that are used
outside the star schema.
5. To move the selected objects to a separate namespace, ensure that the Create a new namespace
for this grouping check box is selected and type the name in the Namespace name box.
6. Click OK.
7. If there are multiple relationships, also known as role-playing dimensions, create relationship
shortcuts for them (p. 83), or create individual dimensions or query subjects if you must rename
them.
Framework Manager shows a list of objects with which it has relationships so that you can
quickly select the objects that you want in the group.
The name of the group is based on the name of the fact table.
The new group is created under the same parent as the selected object.
Using these relationships, how do you write a report that uses only items from Product and Time?
The business question could be which products were forecasted for sale in 2005 or which products
were actually sold in 2005. Although this query involves only Product and Time, these dimensions
are related through multiple facts. There is no way to guess which business question is being asked.
You must set the context for the fact-less query.
In this example, we recommend that you create two namespaces, one containing shortcuts to
Product, Time, and Product forecast, and another containing Product, Time, and Sales.
When you do this for all star schemas, you resolve join ambiguity by placing shortcuts to the fact
and all dimensions in a single namespace. The shortcuts for conformed dimensions in each namespace
are identical and are references to the original object. Note: The exact same rule is applied to regular
dimensions and measure dimensions.
With a namespace for each star schema, it is now clear to your users which items to use. To create
a report on which products were actually sold in 2005, they use Product and Year from the Sales
Namespace. The only relationship that is relevant in this context is the relationship between Product,
Time, and Sales, and it is used to return the data.
Steps
1. Select one of the measure dimensions.
2. From the Tools menu, click Create Star Schema Grouping.
3. If you want to exclude an object from the group, in the Available objects box, clear the check
box next to the object.
4. Click Create a shortcut for all selected objects.
5. To move the selected objects to a separate namespace, ensure that the Create a new namespace
for this grouping check box is selected and type the name in the Namespace name box.
6. Click OK.
7. Repeat these steps for the other measure dimension.
Select the query subjects that are required to access the data, and put them in a new namespace
(p. 187).
Rename the new model dimension. By default, its name is composed of the concatenated
names of the original objects.
Use the dimension map to define hierarchies and levels for the dimension (p. 115).
Specify determinants if the levels are stored in a single query subject (p. 92).
Use Shortcuts
Information about shortcuts for SAP BW metadata appears in a different topic (p. 247).
A shortcut is a pointer to an object, such as a relationship, a dimension, a query subject, or a folder.
We recommend that you use shortcuts in the business view when there is an overlap between user
groups and you want to include the metadata in more than one folder. With shortcuts, you can
have multiple references to an object.
For example, you create folders named Orders, Products, and Customers. If you want both Orders
and Customers to contain the same dimension, you must create a shortcut to the dimension and
add it to both folders.
Note: Two shortcuts to namespaces or folders must not have the same name in a model. For other
types of shortcuts (e.g., a shortcut of a query subject), the name must be unique within the parent
namespace.
When you create a shortcut, IBM Cognos Framework Manager does not set the Screen Tip and
Description properties. Unless you define these properties, the values shown in the IBM Cognos
studios are the same as those defined in the object that the shortcut references.
Tip: To go to the object that the shortcut references, right-click the shortcut and click Go To Target.
Shortcuts are less flexible from a presentation perspective than model objects, but they require much
less maintenance because they are automatically updated when the target object is updated. If
maintenance is a key concern and there is no need to customize the appearance of the query subject,
use shortcuts.
IBM Cognos Framework Manager has two types of shortcuts:
alias shortcuts, which behave as if they were a copy of the original object with completely
independent behavior. Alias shortcuts are available only for query subjects and dimensions.
Regular shortcuts are typically used as conformed dimensions with star schema groups, creating
multiple references with the exact same name and appearance in multiple places. In the example
below, the shortcuts created for Products and Order Time behave as references. If a query is written
that brings Products from both Product Forecast and Sales Target, the query uses the definition of
Products based on the original and this definition appears only once in the query.
Alias shortcuts are typically used in role-playing dimensions or shared tables. Because there is
already an example in this document for role-playing dimensions, we will look at the case of shared
tables. In this example, Sales Staff and Sales Branch can be treated as different hierarchies. From
our knowledge of the data, we know that because staff can move between branches, we need to be
able to report orders against Sales Branch and Sales Staff independently as well as together. To
achieve this, we need to create an alias to Sales Branch that can be used as a level in the Sales Staff
hierarchy.
With the new alias shortcut in place, it is possible to create queries that require orders by sales
branch and orders by sales staff with their current branch information simultaneously.
Reference
Use when you want an exact replica of a query subject in several places to behave as one object
if referenced in the same query.
Alias
Use when you want an exact replica of a query subject to behave as an independent object that
follows an independent join path. Independent join paths must first be defined in the model.
The Shortcut Processing governor controls the behavior for all shortcuts. The Shortcut Processing
governor takes priority over the Treat As property. For example, if the governor is set to Automatic,
Steps
1. Right-click the query subjects, dimensions, or folders that you want to create shortcuts to, and
do one of the following:
Click Create Star Schema Grouping. This command is also available from the Tools menu.
2. For shortcuts to query subjects or dimensions, in the Properties pane, set the Treat As property
to Alias or Reference.
To move selected objects to the folder, click Move the selected items to the new folder.
When you move an object that participates in a relationship, the relationships to this object
also move.
To create shortcuts that reference selected objects, click Create a shortcut for the selected
items. Do not select all the objects in the namespace to avoid creating a recursive structure
in the published package.
Steps
1. In the Project Viewer pane, click a query subject or dimension.
2. From the Actions menu, click Create, Query Item Folder.
A new query item folder appears in the Project Viewer, under the query items that belong to
that query subject or dimension.
3. Drag the query items that you want into the query item folder.
You cannot add query items that do not exist in the parent query subject or dimension.
Steps
1. In the Project Viewer pane, click a measure dimension.
2. From the Actions menu, click Create, Measure Folder.
A new folder appears in the Project Viewer, under the measures that belong to that measure
dimension.
3. Drag the query items that you want into the measure folder.
You cannot add measures that do not exist in the parent measure dimension.
Rename your query items only in the active languages of the project.
When making changes, ensure that your current project active language is not the same as the
project design language.
Select the check boxes for the objects that you want to import.
Specify how the import should handle duplicate object names. Choose whether to import
and create a unique name. If you choose to create a unique name, the imported object
appears with a number. For example, you see QuerySubject and QuerySubject1 in your
project.
If you want to import system objects, select the Show System Objects check box, and then
select the system objects that you want to import.
You see a list of objects that could not be imported, and a count of objects that were imported.
6. Click Finish.
Save the project file (.cpf) and all related files in one folder. When you save a project with a
different name or format, ensure that you save the project in a separate folder.
7. Click the project name in Project Viewer, and set the project property Use Design Locale for
Reference ID to true.
Note: Changing this property back to false later, after renaming query items in the model,
would result in breaking reports based on this model.
Analyze a Model
You can analyze the metadata in a model by using the Model Advisor, which is an automated tool
that applies rules based on current modeling guidelines and identifies areas of the model that you
need to examine. To assist you in understanding the nature of the highlighted issue as well as some
possible actions, you are provided with links to the appropriate sections of the documentation. The
Model Advisor is not a replacement for a knowledgeable modeler; it provides new modelers with
an assistive tool and more experienced modelers with a diagnostic tool.
You can select one or more tests to run against the selected model or subset of a model. We recommend that you verify the model and fix errors before analyzing the model (p. 251).
Use the issues that are identified to resolve potential query generation issues.
As you build additional views, use the Model Advisor to analyze each one for potential issues.
Before publishing the model, use the Model Advisor on objects that will be published.
If you are analyzing an older, established model or a model that is not yet complete, use the Model
Advisor to validate modeling practices. The workflow is similar to that used for new models: start
at the database view and work up.
the relationship references all query items in a unique determinant and the cardinality of the
relationship is not 1:1 or 0:1
the relationship references some of the query items in a unique determinant and the cardinality
of the relationship is not 1:n or 0:n
The Model Advisor also flags occurrences where the keys of a relationship do not match the keys
of a group by determinant.
For example, if you test the Products (model) query subject as a whole, you see that four tables are
referenced in the from clause of the query.
select
PRODUCT_LINE.PRODUCT_LINE_CODE as Product_Line_Code,
PRODUCT_LINE.PRODUCT_LINE_EN as Product_Line,
PRODUCT_TYPE.PRODUCT_TYPE_CODE as Product_Type_Code,
PRODUCT_TYPE.PRODUCT_TYPE_EN as Product_Type,
PRODUCT.PRODUCT_NUMBER as Product_Number,
PRODUCT_MULTILINGUAL.PRODUCT_NAME as Product_Name
PRODUCT_MULTILINGUAL.DESCRIPTION as Product_Description,
PRODUCT.INTRODUCTION_DATE as Introduction_Date,
PRODUCT.PRODUCT_IMAGE as Product_Image,
PRODUCT.PRODUCTION_COST as Production_Cost,
PRODUCT.MARGIN as Margin
from
gosl_82..gosl.PRODUCT_LINE PRODUCT_LINE,
gosl_82..gosl.PRODUCT_TYPE PRODUCT_TYPE,
gosl_82..gosl.PRODUCT PRODUCT,
gosl_82..gosl.PRODUCT_MULTILINGUAL PRODUCT_MULTILINGUAL
where
If you test only Product Name, you see that the resulting query uses only Product Multilingual,
which is the table that was required. This is the effect of minimized SQL.
select
PRODUCT_MULTILINGUAL.PRODUCT_NAME as Product_Name
from
gosl_82..gosl.PRODUCT_MULTILINGUAL PRODUCT_MULTILINGUAL
where
(PRODUCT_MULTILINGUAL."LANGUAGE" - NEN")
stand-alone calculations
calculations that are embedded within measure dimensions and are based on measures from
the same measure dimension
For more information about calculated aggregations, see "Rules for Interpreting Calculated
Aggregations" (p. 143).
Any modification of the SQL in a data source query subject. This includes the use of macros.
Note: The metadata queries generated by IBM Cognos software are well supported by most relational
database management system vendors and should not have a noticeable impact on most reporting
applications.
Constraints
The Model Advisor is only intended for use with relationally-based metadata models. We do not
recommend running the Model Advisor against an entire model; instead apply it to specific views
User Guide 195
Steps
1. Click one or more objects to analyze.
Select a folder or namespace to analyze all its objects. If an object references an object in
another folder or namespace, the referenced object is also analyzed.
Select a package before publishing it to ensure it follows the recommended guidelines for
modeling.
Control how data is used and formatted by checking query item properties (p. 219).
If required, add more business rules, such as calculations and filters, to refine the retrieved data
and to ensure that the right information is available for your users (p. 237).
Organize the model by creating separate views for each user group that reflect the business
concepts familiar to your users (p. 246).
If required, adjust settings in Framework Manager and the IBM Cognos studios to optimize
performance.
After working with the model, you can create a package and publish it for your users. For more
information, see "Publish a Package" (p. 266).
Note: You can also create packages for SAP BW cubes and queries directly in IBM Cognos Connection. For more information, see the section about packages in the Administration and Security
Guide.
197
S_RFC
Set the Activity field to the value: 16
Set the Name of RFC to be protected field to the value: SYST, RSOB, SUGU, RFC1, RS_UNIFICATION, RSAB, SDTX, SU_USER
Set the Type of RFC object to be protected field to the value: FUGR
S_TABU_DIS
Set the Activity field to the value: 03
Set the Authorization Group field to the value: &NC&
Note: &NC& represents any table that does not have an authorization group. For security
reasons, create a new authorization group and assign the table RSHIEDIR to it. The new
authorization group restricts the users access to the above table only, which is needed by the
modeling tool. Create the new authorization group as a customization in the SAP system.
S_USER_GRP
Set the Activity field to the value: 03, 05
Set the User group in user master main field to the default value.
S_RS_COMP
Set the Activity field to the default value.
Set the Info Area field to the value: InfoArea Technical Name
Set the Info Cube field to the value: InfoCube Technical Name
Set the Name (ID) of reporting components field to the default value.
Set the Type of reporting components field to the default value.
S_RS_COMP1
Set the Activity field to the default value.
S_RS_HIER
Set the Activity field to the value: 71
Set the Hierarchy Name field to the value: Hierarchy Name
Set the InfoObject field to the value: InfoObject Technical Name
Set the Version field to the value: Hierarchy Version
S_RS_ICUBE
Set the Activity field to the value: 03
Set the InfoCube sub-object field to the values: DATA and DEFINITION
Set the Info Area field to the value: InfoArea Technical Name
Set the InfoCube field to the value: InfoCube Technical Name
Tips
&NC& represents any table that does not have an authorization group. For security reasons,
create a new authorization group and assign the table RSHIEDIR to it. The new authorization
group restricts the users access to the above table only, which is needed by Framework Manager.
Create the new authorization group as a customization in the SAP BW system.
You can use the asterisk (*) to represent all values, when it appears alone, or partial values,
when used anywhere in a string.
SAP BW Hierarchies
When importing metadata, Framework Manager generates a dimension in each SAP BW characteristic.
Only one hierarchy associated with a given characteristic can be used in a report. Therefore, you
should group dimensions that represent the hierarchies of a single characteristic into a folder or
model query subject to make reporting easier for your users.
If there are multiple hierarchies in an SAP BW data source, the first hierarchy that is imported
becomes the default hierarchy.
Framework Manager supports the following types of hierarchies:
characteristic
This is a list of all the characteristic values.
text node
Non-leaf nodes contain only text and do not reference any other data source object.
characteristic value
The nodes of each level of a presentation hierarchy are values from another characteristic.
User Guide 199
recursive
The nodes of the entire presentation hierarchy are from the characteristic itself.
If a characteristic is not in a time dimension but it is a date and is treated as a date in SAP BW, the
characteristic is imported with the date data type.
Framework Manager does not support hierarchies that contain two or more types of nodes. These
hierarchies are imported but are hidden in the Framework Manager model.
Because hierarchical metadata is automatically generated for SAP BW, you cannot change it in
Framework Manager.
Versioned Hierarchies
You can import the following types of versioned hierarchies from an SAP BW data source:
The type of dimension determines which hierarchy is used and, for time-dependent hierarchies,
which date to use to control the version.
Framework Manager sets the query key date of time-dependent hierarchies based on dates that are
contained within the time-dependent hierarchy. You can then select specific versions of hierarchies.
For hierarchies with versions on time, the default is the current date and time. The hierarchy that
you apply to a characteristic depends upon the type of query key date: fixed, current, or variable.
The query key date is set for a specific date.
For fixed date, include only the version that corresponds to the fixed date in the underlying SAP
BW Query. For example, if the SAP BW Query has a fixed date such as 2005, only 2005 is imported.
For current date, include only the version that encompasses a time span appropriate for the present
until some reasonable time in the future.
For variable, set the date for the variable in Framework Manager and include only the version of
the hierarchy applicable to that date.
200 IBM Cognos Framework Manager
SAP BW Structures
Many existing SAP BW queries contain structures that you can use in IBM Cognos queries to
control the amount and order of information that your users see. For example, with dual structures,
you can create a crosstab report with one structure on each axis.
The structures are:
characteristic structure
A characteristic structure is a collection of characteristic values (members) from one or more
dimensions. You create a characteristic structure in SAP by adding a structure to the query,
and then adding the required members to the structure. In IBM Cognos software, the structure
appears as an additional dimension that has only one multiple-root level.
When you import the SAP BW query into Framework Manager, the key figure structure appears
in the measure dimension called Key Figures and the characteristic structure appears as an additional
dimension.
If you re-import the same SAP BW query into Framework Manager, you must use the same setting
for the SAP BW Dual Structures Support check box. Framework Manager does not allow you to
select a different setting for the same query because different objects are then generated in the model
and this leads to errors. You can use different settings for different queries.
If you select the short name and the field is empty, the long name is shown.
If you select the long name and the field is empty, the short name is shown.
If you select either short name or long name and both fields are empty, the technical name
is shown.
SAP BW object
Namespace.
Characteristic
Dimension
Dimension. The dimension may contain hierarchies representing each presentation hierarchy. The default hierarchy
contains two levels representing
- the aggregation of all characteristic values, also known
as the All value
- all characteristic values
Key figure
SAP BW object
Level.
Note: Level names must be defined in the Administrator
Workbench to be meaningful.
Attribute
SAP BW variable
For information about setting access privileges to retrieve metadata from SAP BW, see "Access to
SAP BW Metadata and Data" (p. 198).
Dimensions
Information about dimensions based on relational metadata appears in a different topic (p. 114).
A dimension is a broad grouping of data about a major aspect of a business, such as products,
dates, or markets.
The types of dimensions that you can work with in IBM Cognos Framework Manager are regular
dimensions and measure dimensions. In SAP BW, measure dimensions are called key figures.
For example, in a project for sales analysis, you include these dimensions:
Name
Type
Description
Time
Regular dimension
Region
Regular dimension
Product
Regular dimension
Customer
Regular dimension
Customer information
Sales
Steps
1. Click the regular dimension you want to modify.
2. From the Actions menu, click Edit Definition.
3. Choose the action that you want:
Embed calculations by selecting the level, clicking Add, and then defining the expression
(p. 237).
4. Click OK.
IBM Cognos software uses default settings that will not fail for the hierarchy type.
For dimensions that represent SAP BW characteristics, the Balanced property is set to true and
the Ragged property is set to false.
For dimensions that represent presentation hierarchies, the Balanced property is set to false
and the Ragged property is set to true.
These settings may not reflect the appropriate values as IBM Cognos software does not determine
the actual hierarchy structure. You can improve performance of SAP BW models and queries by
adjusting dimension settings in IBM Cognos Framework Manager and in the IBM Cognos studios.
For each dimension, check the settings for the Balanced(p. 206) and Ragged(p. 208)properties to
ensure that the values are set appropriately.
In addition to hierarchies in dimensions, there are hierarchies in SAP BW metadata (p. 199).
Balanced Hierarchy
Each path in a balanced hierarchy descends to the same depth.
For example, in the following diagram, the highest level is Product Line(Level 1); Level 2 is Product
Type; Level 3 is Products.
In SAP BW, all leaf nodes of a hierarchy are values of the characteristic, but each path does not
need to descend to the lowest level of the hierarchy.
You can define whether a dimension represents a balanced hierarchy by modifying the Balanced
property of a dimension. The value that you set depends on the type of object that the dimension
represents, and whether the hierarchy is balanced.
Dimension represents
characteristic
true
true
false
false
For a dimension that represents a characteristic without a presentation hierarchy, this property is
read-only and is assigned a value of true.
If a presentation hierarchy is balanced, then set the Balanced property of its associated dimension
to true. By default, it has a value of false for all presentation hierarchies. A hierarchy is balanced
if all leaf characteristic values occur at the lowest level of the hierarchy. By setting the Balanced
property to true as appropriate, the IBM Cognos BI server can generate more efficient MDX.
When all paths are of the same depth, set the Balanced property to true, otherwise set it to false.
If you assign a value of true to the Balanced property of an unbalanced hierarchy, queries that
involve this dimension may return incorrect data.
If you assign a value of false to the Balanced property of a balanced hierarchy, performance may
be slower.
Unbalanced Hierarchy
The branches in an unbalanced hierarchy descend to different levels.
For example, in the following diagram, the highest level in an organization is the CEO (Level 1);
Level 2 is the vice-presidents and the CEOs executive assistant. The executive assistant does not
have subordinates, unlike the vice-presidents.
An unbalanced hierarchy can also be ragged. In a ragged-unbalanced hierarchy, there are gaps in
the levels and the levels descend to different depths.
In SAP BW, this occurs only when there are "not assigned" (or "#") nodes in a presentation hierarchy. However, the presence of such a node does not ensure that the hierarchy is unbalanced. You
must study the layout of a hierarchy to be certain.
Ragged Hierarchy
At least one path in the hierarchy skips at least one level.
For example, the highest level is Company (Level 1); Level 2 is Branch; Level 3 is Building; Level
4 is Department. Some branches may only have one building location, with the same departments
as multi-building locations.
In SAP BW, this occurs only when there are "not assigned" (or #) nodes in a presentation hierarchy.
However, the presence of such a node does not ensure that the hierarchy is ragged. You must study
the layout of a hierarchy to be certain.
IBM Cognos software uses default settings that will not fail for the hierarchy type.
For dimensions that represent SAP BW characteristics, the Balanced property is set to true and
the Ragged property is set to false.
For dimensions that represent presentation hierarchies, the Balanced property is set to false
and the Ragged property is set to true.
You can define whether a dimension represents a ragged hierarchy by modifying the Ragged property
of a dimension. The value that you set depends on the type of object that the dimension represents,
and whether you know if the hierarchy is ragged.
Dimension represents
characteristic
false
false
true
true
Network Hierarchy
A member of the hierarchy has more than one parent.
For example, an employee may report through different organizations and have multiple managers.
For SAP BW, this employee will be included in the count of all employees only once, and not be
included in every organization.
Roles
Information about roles for relational metadata appears in a different topic (p. 122).
Roles define what appears in the member tree in the IBM Cognos studios. Use roles to organize
and manage metadata and to determine how to present data to your users.
You can also create expressions that refer to roles instead of query items. You must use the
roleValue function to refer to a particular role. For example, you want to query against a specific
role in a hierarchy but the query item playing that role is different at each level of the hierarchy. A
single query can span the different query items at each level. You can also use the roleValue
function when you know the role but not the underlying query item.
You can assign multiple roles to one query item, but the same role cannot be assigned to different
query items in the same level.
Default roles are pre-defined for all parent-child hierarchies and for all levels in level-based hierarchies. Most of these roles are not visible in the IBM Cognos studios.
The roles that are reserved by IBM Cognos BI start with an underscore. The name for a custom
role cannot start with an underscore.
Default Roles
The default roles include the following:
_businessKey
Represents the key for the level. This role is also used to drill through from one data source to
another because the business key should be consistent across your organization.
The _businessKey role can be assigned to only one attribute in a level.
_dimensionUniqueName
Returns the name of the dimension as defined in the Framework Manager model.
_hierarchyUniqueName
Returns the name of the hierarchy as defined in the Framework Manager model.
_levelLabel
Returns the label that is assigned to the level.
_levelNumber
Returns the number for the level.
_levelUniqueName
Returns the name that is assigned to the level.
_longName
Is assigned to the query item that represents the long name for a level.
_memberCaption
Presents the caption for a member that will be shown in the IBM Cognos studios.
_memberDescription
Returns the description for a member within a dimension.
_memberUniqueName
Returns the IBM Cognos member unique name.
_parentUniqueName
Defines the name that is assigned to the parent of the selected query item.
_planningDefault
Specifies which query item to use when measures are selected. This role is applicable only for
IBM Cognos Planning and SAP BW.
_rollupType
Defines how a query item is aggregated.
_shortName
Is assigned to the query item that represents the short name for a level.
If a query item uses a default role, you cannot change its role. This applies to SAP BW metadata
only.
Custom Roles
You can create custom roles. Each role that you create must have a unique name. The roles that
are reserved by IBM Cognos start with an underscore. The name for a custom role cannot start
with an underscore. You can translate the custom roles in the model.
User-defined properties in OLAP data sources are assigned roles with the same name as the query
item.
Specify Roles
Roles define what appears in the member tree in the IBM Cognos studios. Use roles to organize
and manage metadata and to determine how to present data to your users.
Steps
1. Click the dimension whose roles you want to define.
2. From the Actions menu, click Edit Definition.
3. Click the Dimension tab.
4. In the Hierarchies box, click the level you want.
5. In the Select a level in the hierarchy control to see the query items box, click a query item.
6. Under Role, click the ellipsis (...) button.
7. Click the Custom Roles tab, and click Add.
8. Click Close.
9. Click OK.
You can also use the Dimension Map tab to define roles. Click Attributes, right-click the query
item, and click Edit Roles.
Steps
1. Click the key figures dimension you want to modify.
2. From the Actions menu, click Edit Definition.
3. Choose the action that you want:
Embed calculations by clicking Add and then defining the expression (p. 237).
Change the order of measures, items, or calculations by using the arrow buttons. However,
if the measure dimension contains a folder, you can change the order only in the Project
Viewer.
4. Click OK.
Steps
1. Select one or more objects that you want to explore.
2. From the Tools menu, click Launch Context Explorer.
3. To see the connected objects, click one or more objects and click the appropriate button.
Goal
Button
4. If you want to see details about an object, such as its relationships and query items, right-click
the object, click Navigate Diagram, Diagram Settings, and then select the details you want.
Steps
1. Select the object that you want.
2. From the Actions menu, click Edit Definition and then click the Test tab or the Query Information tab.
3. Click Options and then click the Test Settings tab.
4. Choose the options that you want.
Goal
Action
Persistence
This setting applies to all
dimensions, query subjects, and
query sets in the model.
Temporarily override In the Session Parameters box, The override values are not
session parameters
saved with the model. This setclick Set.
ting is for your current session
The Session Parameters dialog
only.
box appears.
Goal
Action
Persistence
In The Current Prompt Values The prompt values are not saved
with the model.
box, click Prompts.
The Model Prompts Manager
dialog box appears, which
shows all prompts, and their
values, that are in the model.
Steps
1. Select the namespace folder and, from the Actions menu, click Create, Query Subject.
2. In the Name box, type a name for the new query subject.
3. Click Model and click OK.
Note: For SAP BW metadata, you can only create model query subjects.
4. Click the Query Subject Definition tab.
5. To add items to the model query subject, drag items from the Available Model Objects box to
the Query Items and Calculations box.
You can change the order of items and calculations. However, if the query subject contains a
query item folder, you can change the order only in the Project Viewer.
6. To embed calculations in the model query subject, click Add and define the calculation.
7. To embed filters in the model query subject, click the Filters tab.
8. To test the model query subject, click the Test tab.
9. Click OK.
A warning appears if any modifications invalidated relationships, other query subjects, calculations, or filters.
You may be interested in the following related topics:
modifying the properties for multiple query subjects at the same time (p. 34)
You can merge any number of the same type of objects into a new query in a single operation. The
merge always creates a new model query subject.
The new query subject contains any filters that exist in the original query subject.
Notes
Ensure that model query subjects do not contravene the logic of the model. For example, if a
query subject with multiple characteristics is used in combination with other query subjects,
there can be problems when you run the report.
Do not include query items from different query subjects or hierarchies from the same dimension.
This causes a run-time error.
Steps
1. Ctrl+click the objects that you want to merge into a single query subject.
2. From the Actions menu, click Merge in New Query Subject.
The Evaluate Object command evaluates the selected objects and ensures that they can run.
When IBM Cognos Framework Manager evaluates a query subject, a request is sent to the SAP
BW data source. Physical attributes, such as data type, are then updated as needed for the query
subject.
You can also synchronize the entire project (p. 301).
Steps
1. Select the query subject you want to evaluate.
2. From the Tools menu, click Evaluate Object.
If you changed the Regular Aggregate property to unsupported, the property is reset when you
evaluate the query subject. If the property is set to any other value, the property is not changed.
Query Items
Information about query items for relational metadata appears in a different topic (p. 138).
A query item is the smallest piece of the model that can be placed in a report. It represents a single
instance of something, such as the date that a product was introduced.
Key figures and attributes are imported as query items in IBM Cognos Framework Manager.
Only one hierarchy from a dimension should be used in the same report.
For SAP BW metadata, you can modify only text-based properties, such as the name or screen tip.
Because reports can contain different query items from one or more objects in the model, query
item properties control many aspects of the final report. When you create a model dimension or
model query subject, the query items inherit the properties of the data source query items on which
they are based.
The properties for query items or measures include the following.
Description
Name
Description
Last Changed
The date that the query item or measure was last changed. The
property is automatically updated with the current date time.
Last Changed By
The user who last changed the query item or measure. This
property is automatically updated when the item is changed.
The value is the current logon username.
Model Comments
Used to add internal comments about the model. The information is used on the Analyze Publish Impact dialog and in the
Model Report. Comments are not accessible to package users.
Screen Tip
Expression
Description
External Name
Is Hidden
Usage
The intended use for the data represented by the query item.
This property is for query items only.
Format
Currency
Data Type
Precision
Scale
Size
Description
Is Nullable
Display Type
MIME Type
Prompt Info
Prompt behavior.
Regular Aggregate
Aggregate Rules
Allocation Rule
Is Unsortable
modifying the properties for multiple query items at the same time (p. 34)
Object
Usage property
Attribute
Unsupported
Identifier
Count
Measure in a measure
dimension
Fact
If the measure is semi-additive, use the Aggregate Rules property to define rules for semi-additive
aggregation (p. 146).
For SAP BW metadata, you cannot change these properties for dimensions.
Calculation
Aggregation type
key items
unsupported
calculated
Usage Property
The Usage property identifies the intended use for the data represented by each query item. During
importing, the Usage property is set according to the type of data that the query items represent in
the data source.
You need to verify that this property is set correctly. For example, if you import a numeric column
that participates in a relationship, the Usage property is set to identifier. You can change the
property.
For SAP BW query items, the value of the Usage property depends on the type of dimensional item
the query item is based on.
SAP BW object
Description
Identifier
hierarchy level
Fact
key figure
Attribute
display attribute
automatic
average
average non-zero is supported only when it is set in the data source. You cannot change the
property to average non-zero in Framework Manager.
calculated
count
count distinct
count non-zero is supported only when it is set in the data source. You cannot change the
property to count non-zero in Framework Manager.
maximum
median
minimum
standard deviation
sum
variance
Calculation
Aggregation type
key items
unsupported
calculated
Semi-Aggregate Property
For SAP BW metadata, the Semi-Aggregate property shows the value that is set in the data source,
and the property is read-only.
If the value is set to unsupported in IBM Cognos Framework Manager, the semi-aggregate
behavior is ignored in the IBM Cognos studios.
The Semi-Aggregate property will not be supported in future releases. Instead, use the Aggregate
Rules property for semi-additive measures.
Steps
1. In the Project Viewer pane, click the query item you want to format.
2. In the Properties tab of the Properties pane, click the Format property.
3. Set the format type to currency to ensure that currency formatting is applied to all types of
reports.
4. In the Currency scope box, specify the type of currency. If you do not see the currency you
want to use, click the Add button.
Query Studio to create a filter expression and set the use and display items in a prompt and
prompt query
the Build Prompt Page tool in Report Studio to create a filter expression and set the use and
display items in a prompt and prompt query
generated prompts in Report Studio to set the use and display items in the prompt and prompt
query
parameter maps
session parameters
Steps
1. Click the query item.
2. In the Properties pane, click the Properties tab.
3. Click the plus sign (+) next to the Prompt Info property.
This is a compound query item property.
4. Modify the following properties to reflect the behavior you require.
Goal
Property
Set the type of prompt control that is generated when Prompt Type
the report is run.
Set the generated prompt as part of a series of gener- Cascade On Item Reference
ated cascading prompts.
Specifies which query item is displayed to the report Display Item Reference
user in the prompt.
The values in the prompt are data values of the query
item.
Each value in the prompt is associated with a value
in the query item specified in the Use Item Reference
property.
Specifies which query item is passed from the prompt Use Item Reference
to the filter.
Each value is associated with a value in the query item
specified in the Display Item Reference property.
Specifies which query item is used in the filter expres- Filter Item Reference
sion to retrieve data.
Value
Prompt Control
Server Determined
Edit Box
Select Date
Value
Prompt Control
Select Date/Time
Select Interval
Select Time
Select Value
A drop-down list.
Note: If the caption is a different datatype than the business key (MUN) for the level, use the Filter
Item Reference in conjunction with setting the Prompt Type for the caption. This ensures that the
right datatype is used when filtering in the studios.
Query Studio to create a filter expression and set the use and display items in a prompt and
prompt query
the Build Prompt Page tool in Report Studio to set the use and display items in a prompt and
prompt query
generated prompts in Report Studio to set the use and display items in the prompt and prompt
query
Note: The values of the Use Item Reference and Filter Item Reference properties must be compatible.
Otherwise, the report user may receive unexpected results. For more information, see the Filter
Item Reference property (p. 153).
Default: If no values are set, the properties default to the name of the query item.
These properties are used only for data driven prompt controls whose Prompt Type property is set
to either Select Value or Select with Search.
the Build Prompt Page tool in Report Studio to create a filter expression
Default: If no value is set, the property defaults to the name of the query item.
Using the Filter Item Reference and Use Item Reference Properties
The values of the Filter Item Reference and Use Item Reference properties must be compatible. The
value of the Use Item Reference property must be a type that is expected by the Filter Item Reference
property. Otherwise, the report user may receive unexpected results. This may occur when a report
user creates a filter without creating a prompt page.
Report Studio automatically generates prompts when you create a filter without creating a prompt
page. Because the prompt is generated, Report Studio uses the Prompt Info properties from the
Employee Name query item in the Framework Manager model.
The Use Item Reference indicates that the values being passed to the filter are employee numbers.
The Filter Item Reference is filtering data based on Employee Name. The filter is as follows:
Reference].[Employee Name] in ("1", "2"). Since there are no Employee Name values of
"1" or "2", the report will be blank.
Testing a Prompt
When you test a model object that references a prompt, IBM Cognos Framework Manager asks
you to enter the prompt value. Framework Manager uses this value for either the duration of the
session, or until you clear the prompt value.
You can change the session value of prompt values through the Options dialog box. This dialog
box is available when you modify a dimension or query subject, or define a calculation, filter, query
set, or complex relationship. You can change the prompt value at the time that you are testing the
expression that references that value.
If you select the Always prompt for values when testing check box in the Prompt dialog box,
Framework Manager prompts you for a value every time you test the object. When updating the
object or performing a count, Framework Manager uses the existing prompt value, if one exists.
A prompt on a query item in a model query subject is associated only with that query item. A
prompt on a query item in a data source query subject is associated with the entire query subject
and therefore, the prompt appears when you test any query item in the query subject.
SAP BW Variables
SAP BW variables are parameters of an SAP BW Query that are set up during query definition.
When you run the query, the SAP BW variables are filled with values. They function as placeholders
and can be processed in different ways. They are automatically exposed as prompts at run time.
SAP BW variable information is included in a composite custom property named SAP BW Variables
that exists only if a data source has one or more variables associated with it. The SAP BW Variables
property contains one or more composite properties, each of which must be assigned a unique
name. Each property represents a description of a single SAP BW variable. Because the variable
information is specified in a custom property, Framework Manager does not validate these properties.
The SAP BW variable information is obtained using the SAP BW BAPI MDDataProviderBW::
GetVariables.
Framework Manager supports these types of SAP BW variables:
characteristic
There are two kinds of characteristic variables: characteristic value and hierarchy node. Characteristic values variables select characteristic values. Hierarchy node variables select values
from any position in a presentation hierarchy.
hierarchy
The user is not prompted for a value because IBM Cognos software automatically populates
it at run time based on the selected hierarchy. Variables for hierarchies function act as placeholders for the hierarchy of a characteristic. All the values for hierarchy variables are read-only.
formula
The user types a numeric value at run time. Use formula variables if a formula component
should be entered only when a query is run. For example, you can use a formula variable for
a value-added tax rate to process the current rate at run time.
authorization
Authorization variables are like other variables, but IBM Cognos software automatically populates the variable values with the users credentials. SAP BW uses these credentials to supply
the information needed by an SAP BW Query that has security applied to it.
Variables for hierarchies function as placeholders for the hierarchy of a characteristic. All the values
for hierarchy variables are read-only.
Name Property
This property is a string value.
SAP BW equivalent: VARIABLE_NAME
Restrictions: Read-only.
Caption Property
The string value for this property is a composite and is locale-dependent. Represent each locale in
the model by a custom property whose value is the locale name. For example, if the locales en-ca
and fr-fr exist in the model, define two custom properties named en-ca and fr-fr.
User Guide 231
Value
SAP BW Equivalent
value
SAP_VAR_SEL_TYPE_VALUE
interval
SAP_VAR_SEL_TYPE_INTERVAL
complex
SAP_VAR_SEL_TYPE_COMPLEX
multiValued
SAP_VAR_SEL_TYPE_COMPLEX
Restrictions: Read-only.
Value
SAP BW Equivalent
optional
SAP_VAR_INPUT_TYPE_OPTIONAL
mandatory
SAP_VAR_INPUT_TYPE_MANDATORY
mandatoryNotInitial
SAP_VAR_INPUT_TYPE_MANDATORY_NOT_INITIAL
Restrictions: Read-only.
Description Property
This property is a string value.
Value
Restrictions
typeIn
pickList
calendar
hierarchyPickList
notApplicable
Property
Default value
Type
numeric
Caption
Selection Type
value
Property
Default value
Entry Type
typeIn
false
You can change the default values for a numeric variable except for the Prompt Type property,
which is read-only.
Property
Default value
Type
characteristic
Caption
Selection Type
Entry Type
Property
Default value
Prompt Type
typeIn or pickList
This depends on the number of members in the referenced
dimension.
If the value is invalid, typeIn is used.
false
false
Property
Default value
Type
characteristic
Caption
Selection Type
Entry Type
Default LowValue
Default HighValue
Prompt Type
hierarchy PickList
You can change the Prompt Type property to typeIn or
pickList.
Level Restriction
zero (0)
false
Picklist Prompts
Each picklist prompt contains a pre-defined number of values. These values are determined by the
Maximum Number of Values property.
If the number of actual values is less than or equal to the default number of values, the prompt is
generated as a single picklist prompt. If the number of actual values exceeds the default number,
two prompts are generated in this order:
a bound range parameter with a starting value of 1 and an ending value determined by the
Maximum Number of Values property
This parameter is of the type xsdUnsignedLong and is optional. The name of the parameter is
the name of the original prompt followed by _range_prompt. The caption is locale-specific. If
this is a multilingual model, you must store the template for the caption in a message file.
add calculations so that your users can include calculated data in their reports (p. 237).
create and apply filters so that you can limit the data that a query subject retrieves (p. 239).
add prompts that will automatically appear whenever a dimension or query subject is used in
a report; report consumers are then prompted to filter data (p. 226).
use session parameters (p. 245) and parameter maps (p. 243) to dynamically resolve expressions.
create a security filter to control the data that is shown to your users when they set up their
reports (p. 257).
Create a Calculation
Information about calculations for relational metadata appears in a different topic (p. 155).
Goal
Action
Add items
On the Model tab, click a query item, filter, or calculation and click the arrow.
Add functions
Add parameters
Goal
Action
Click the options button, select the Restrict the maximum number of rows to be returned check box, and
type the required number of rows to be returned.
You can test only calculations that contain query items. If a calculation contains a function,
for example _add_days, the Test Sample button is not available.
5. Click OK.
6. Modify the Data Type property to identify the type of data the calculation returns.
The IBM Cognos studios use this information to format the data that the calculation returns.
For information about functions, see "Using the Expression Editor" (p. 381).
Create a Filter
Information about filters for relational metadata appears in a different topic (p. 158).
A filter is an expression that specifies the conditions that rows or instances must meet to be retrieved
for the dimension, query subject, calculation, or report to which the filter is applied. A filter returns
a boolean value so that you can limit the rows returned by a dimension or query subject.
For example, you can use the in_range function to create a filter that retrieves data for products
introduced in a specific time frame. The syntax for this example looks like this:
[gosales_goretailers].[Products].[Introduction
date]
in_range {Feb 14, 1999 : July 14, 2007}
Note: When using a date or time function, you must use a 24-hour clock. IBM Cognos Framework
Manager does not support "a.m." or "p.m." in expressions. For example, use 20:00 to signify 8
p.m.
Use an embedded filter when you want to use a filter with only one dimension or query subject.
You can create an embedded filter when modifying a dimension, relational data source query
subject, or model query subject.
If you start with an embedded filter, you can later convert it into a stand-alone expression that
you can apply to other dimensions or query subjects. Tip: Right-click the filter expression in
the Filters tab and click Convert to Stand-alone Filter.
When you embed a filter, the data source query subject must have a relationship to any query
subject referenced by the expression. This relationship is necessary even if the expression references a model query subject based on the same table as the data source query subject in which
you are embedding the expression.
To create a filter on an unrelated query subject, do one of the following:
Ensure that there is a join path between the new query subject and the one that contains
the filter.
Base the embedded filter on a query item that is based on the data source query subject
you want.
Convert the calculation to a stand-alone filter, so that it is not part of the query subject.
Steps
1. Do one of the following:
If you want to create a stand-alone filter, click the namespace or folder and, from the
Actions menu, click Create, Filter.
If you want to create an embedded filter, double-click the dimension or query subject that
will contain the filter, click the Filters tab, and then click Add.
Goal
Action
Add functions
Add parameters
Retrieve all data and show a speci- Click the options button, select the Restrict the
fied number of rows
maximum number of rows to be returned check box,
and type the required number of rows to be
returned.
4. Click OK.
You may be interested in the following related topics:
You can also apply governors to restrict the data that the queries in a package retrieve (p. 304).
Apply a Filter
Information about filters for relational metadata appears in a different topic (p. 160).
To apply a filter, you must modify the dimension, data source query subject, or model query subject.
The query subject must either contain the query items that the filter references, or have a relationship
path to the query subjects that contain the query items.
You can embed a stand-alone filter in dimensions or query subjects, but if you want a different
usage for each embedded filter, you must create different versions of the stand-alone filter. Otherwise,
your users could be required to fill in a prompt that you thought was optional if there is any instance
where the usage is set to mandatory. For information about mandatory and optional prompts, see
(p. 171).
For example, in query subject A, you embed a stand-alone filter and define it as optional. In query
subject B, you define it as mandatory. When your users create a report that uses both query subjects,
they are required to choose values in both filters, even the one defined as optional. All instances of
the filter are considered to be mandatory when used in the same query. The solution is to create
different versions of the filter, each with its own name.
Steps
1. Create a filter.
2. Select the filter and, from the Actions menu, click Edit Definition.
3. Click the Filters tab, and drag the filter you created to the Filters box.
4. Select a usage value for the filter.
Usage Value
Description
Always
Use this usage value to ensure specified data is filtered out of all
reports. For example, your company may have obsolete information that it stores but does not want to report on.
Always is the default usage value.
Retrieves a small subset of the data for the sample report. Use this
usage value when you do not need to see all the data, for example
when testing a query subject.
To apply design mode filters in Framework Manager, select the
Apply all relevant design mode filters when testing option. This
option is available on the Test Settings tab.
Your users may need the design mode filter in Query Studio when
they want to focus on designing the layout and format of a report
and not retrieve all the data as they work. To access the design
mode filter in Query Studio, run the report with limited data.
Usage Value
Description
Optional
5. If you want to view the SQL, click the Query Information tab.
6. Click OK.
To manually enter values, click New Key, type a key, and press Tab to enter a value for
that key.
To import keys and values, click Import File and identify the location of the appropriate
.csv or .txt file. For a .txt file to be used for import, the values must be separated by tabs
and the file must be saved as UTF8 or Unicode format. ANSI text files are not supported.
Note: If you are going to use a parameter in a data source query subject, the value must use
English-specific punctuation. This means that you must use a period (.) to represent a decimal
and a comma (,) to separate lists of values.
5. Modify existing parameters as required.
Goal
Action
Remove a parameter
Modify a parameter
Select the row you want to modify, click the Edit button, and type a value.
6. Click Finish.
This parameter map is used when the SAP BW variable Target Currency is used in a report.
These are the only properties related to SAP BW variables that can use parameter maps.
runLocale
Returns the code for the current active language in Framework Manager. The model content
is shown in this language.
You can change the active language at any time for your current session only. In future sessions,
the model continues to open in the design language. For more information, see the section "Add
a Language to a Project" (p. 134).
account.defaultName
Specifies the name of the current user as defined in the authentication provider. For example,
user's first and last name.
If you log on anonymously, you will see Anonymous.
account.personalInfo.userName
Specifies the user ID used to log on to IBM Cognos BI.
If you log on anonymously, you will not see this parameter.
current_timestamp
Specifies the current date and time.
machine
Specifies the name of the computer where Framework Manager is installed.
If your authentication source supports other parameters and you entered information about them
in the authentication source, you see other session parameters, such as account.personalInfo.email
or account.personalInfo.surname.
You can define additional parameters by using model session parameters. Model session parameters
are stored in a parameter map named _env. They are set in the project and can be published with
a package.
All possible return values must have the same data type.
Steps
1. From the Project menu, click Session Parameters.
2. Click New Key and type a session parameter key and value.
3. Choose how to handle the override value.
To avoid having to set the override value every time you edit the project, set the session
parameter as a value.
To avoid having to remove the project setting each time before you publish it, set the session
parameter as a session override.
Goal
Action
Remove a parameter
5. Click OK.
Keep the metadata from the data source in a separate namespace or folder.
In IBM Cognos Framework Manager, this is called the import view.
Create one or more optional namespaces or folders for resolving complexities that affect
querying using query subjects or dimensional objects.
To use IBM Cognos Analysis Studio or any OLAP-style queries, there must be a namespace or
folder in the model that represents the metadata with dimensional objects.
Create one or more namespaces or folders for the augmented business view of the metadata
that contains shortcuts to dimensions or query subjects.
In Framework Manager, these are called the business view. Use business concepts to model the
business view. One model can contain many business views, each suited to a different user
group. You publish the business views.
Security can be defined in any of the views. It depends on your business requirements. For example,
if you need to keep everyone from viewing an object, you add security to the object in the import
view. Typically security is applied in the business view.
You can
Use Shortcuts
Information about shortcuts for relational metadata appears in a different topic (p. 184).
A shortcut is a pointer to an object, such as a relationship, a dimension, a query subject, or a folder.
We recommend that you use shortcuts in the business view when there is an overlap between user
groups and you want to include the metadata in more than one folder. With shortcuts, you can
have multiple references to an object.
For example, you create folders named Orders, Products, and Customers. If you want both Orders
and Customers to contain the same dimension, you must create a shortcut to the dimension and
add it to both folders.
Note: Two shortcuts to namespaces or folders must not have the same name in a model. For other
types of shortcuts (e.g., a shortcut of a query subject), the name must be unique within the parent
namespace.
When you create a shortcut, IBM Cognos Framework Manager does not set the Screen Tip and
Description properties. Unless you define these properties, the values shown in the IBM Cognos
studios are the same as those defined in the object that the shortcut references.
Tip: To go to the object that the shortcut references, right-click the shortcut and click Go To Target.
Shortcuts are less flexible from a presentation perspective than model objects, but they require much
less maintenance because they are automatically updated when the target object is updated. If
User Guide 247
alias shortcuts, which behave as if they were a copy of the original object with completely
independent behavior. Alias shortcuts are available only for query subjects and dimensions.
Step
Right-click the query subjects, dimensions, or folders that you want to create shortcuts to, and
click Create, Shortcut.
To move selected objects to the folder, click Move the selected items to the new folder.
When you move an object that participates in a relationship, the relationships to this object
also move.
To create shortcuts that reference selected objects, click Create a shortcut for the selected
items. Do not select all the objects in the namespace to avoid creating a recursive structure
in the published package.
analyze the model for potential modeling issues that you should examine before publishing the
metadata (p. 191)
set security to restrict access to metadata and data across IBM Cognos products (p. 256)
specify the suppression options that will be available to package users. (p. 263)
In addition, you have the option to externalize query subjects and dimensions to convert them to
formats that you can use in Transformer or other applications (p. 263).
If you have published packages, you verify them and repair any problems (p. 251).
Note: Externalizing queries will not be supported in future releases of IBM Cognos Transformer.
Verification Categories
When you verify a model or package, IBM Cognos Framework Manager looks for messages in
the following categories:
Category
Description
Internal Model Inconsisten- Verifies that objects are properly defined and that duplicate
cies
names are not used. We recommend that you always run this
group of tests.
251
Category
Description
Invalid or Incomplete Object Checks for dangling references or references to missing objects.
References
Determinant Completeness
Dimension Completeness
Query Status
Backward Compatibility
Steps
1. Choose one of the following:
Goal
Action
Verify a model
Verify a package
Goal
Action
Verify selected
objects
2. On the Options tab, select the message severity levels that you want to see in the results.
By default, all message severity level check boxes are selected. Clear the ones that you do not
want.
3. Select the categories that you want to verify.
By default, all category check boxes are selected. Clear the ones that you do not want.
4. Click Verify Model.
The Verify Model Results tab shows the results.
5. To sort the messages, click Sort in the severity, object type, or name column heading.
6. To see the object that is related to the message, under the Actions heading, click Find in Project
Viewer.
7. To repair problems for a group, select a grouping criteria from the list.
8. Select the check box beside each message for the problem that you want to repair.
Tips:
To select all messages, select the check box at the top of the check box column. To clear
all selected messages, clear the check box at the top of the check box column.
If you grouped the messages, select the check box at the top of the group check box column
to select all messages in the group.
To hide the message detail information, click Collapse in the group heading.
invalid references
invalid objects, invalid relationships, invalid aggregation rules, missing locales, unsupported
prompt types, inferred roles, and re-evaluate; in no particular order
You can also repair problems by clicking the Edit Definition icon under the Actions heading
for the message. In the dialog box, modify the definition of the object as required.
When the repair process is finished, a summary of the repair results appears. The model or package
is verified again and the results are shown in the Verify Model Results tab.
Tip: Problems that cannot be repaired during the verification of a package may be repaired using
verify model.
User Guide 253
Reusing Packages
You can reuse packages by creating nested packages. When you create nested packages, you create
a master package that is based on other existing packages. Using nested packages saves you time,
and they are easier to maintain. Another advantage of using nested packages is that you publish
only the master package.
For example, you create three separate packages named Canada, Mexico, and the United States.
Each package contains the project objects and security appropriate for that package. You can create
one master North America package and include the packages Canada, Mexico, and the United
States.
You can also reuse packages to create a consolidated package with connections to multiple data
sources.
Option
Description
Select
The object can be used in reports and can be selected by your users.
Hide
The data within the object cannot be used in reports because it cannot
be selected by your users. Any existing reports referencing this object
will not run.
For example, you include a model query subject in a package. Because
model query subjects are dependent on data source query subjects
(p. 85), you must add the data source query subject to your package.
If you do not want your users to see the data source query subject,
hide it.
Option
Description
Unselect
The object is not published. It cannot be used for reports and cannot
be selected by your users.
Note: IBM Cognos Framework Manager supports Ctrl+shift and Alt+shift functionality. Use
these keystrokes to select multiple objects that you wish to include or hide. For example, if you
wish to only include two items in a large branch, select the entire branch, then use Ctrl+shift to
deselect the items you wish to include, and hide the remaining selected items.
A macro for the model query subject references query items in another query subject.
Security
In IBM Cognos Framework Manager, security is a way of restricting access to metadata and data
across IBM Cognos products.
There are different types of security in Framework Manager:
Each type of security uses users, groups, and roles to define access.
There are business reasons for restricting access to data. For example, you may have confidential
data that only specific users are allowed to see. You may have a variety of data, and your users
only need to retrieve data from specific tables or columns. Or, you may have a table that contains
many records, and your users only need to retrieve a subset of records from that table.
If you are using SAP BW metadata, there can be underlying SAP BW security that affects your users
access to level members. You cannot override SAP BW security in Framework Manager. For more
information, see "Import from an SAP BW Data Source" (p. 197).
Before you add security in Framework Manager, ensure that security was set up correctly in IBM
Cognos BI. For more information, see the Administration and Security Guide.
Users
A user entry is created and maintained in an authentication provider to uniquely identify a human
or a computer account. You cannot create users in IBM Cognos BI.
Information about users, such as first and last names, passwords, IDs, locales, and e-mail addresses,
is stored in the providers.
Users can become members of groups defined in authentication providers and groups defined in
IBM Cognos BI. A user can belong to one or more groups. If users are members of more than one
group, their access permissions are merged.
you want to avoid cluttering your organization security systems with information used only in
IBM Cognos BI
Steps
1. Click the query subject you want, and from the Actions menu, click Specify Data Security.
2. To add new users, groups, or roles, do the following:
In the Select Users and Groups window, add users, groups, or roles. For information about
how to do this, see the Administration and Security Guide.
3. If you want to base the group on an existing group, click a group in the Based On column.
Tip: If you do not see the group you want in the list, you must add the group to the security
filter.
4. If you want to add a filter to a group, in the Filter column, click either Create/Edit Embedded
Filter or Insert from Model.
Everyone
Group1
Authors
Group2
System Administrators
Group3
Query Users
Group2
NTLM
Group2
When you add a filter to the query subject, the filter uses a macro to look up a list of values, for
example:
Security_column in (#CSVIdentityName(%Roles_Groups)#)
For users in the Everyone, Authors, and System Administrators roles, testing shows this as:
Security_column in ('Group1','Group2','Group3')
For users in the Everyone, Authors, and System Administrators roles, testing shows this as:
Security_column in ('Everyone','Authors','System
Administrators')
there is no way to distinguish between groups and roles so each group and role must have a
unique name.
this function works only in a filter and always returns 0..n values
Tips:
To see a list of the object-based packages, double-click the Packages folder. The list appears in
the Explorer tab. To see which objects are secured against that specific object-based package,
click the Packages folder, and from the Actions menu, click Packages, Explore Packages(p. 271).
To determine if object-based security is set in the model, click the Packages folder, and from
the Actions menu, click Packages, Explore Packages(p. 271). Click the Roles Explorer tab. If
object-based security was set, you see a package for the Everyone role.
To determine which objects are explicitly secured in the model, look at the objects icon in the
Project Viewer. The top left corner of the icon is marked with an overlay.
To find all objects that were explicitly secured under a given object, select the object and, from
the Tools menu, click Find All Secured Objects.
To remove object-based security for a particular user, group, or role, delete the package for
that user, group, or role from the Project Viewer.
To completely remove object-based security from the model, delete the package for the Everyone
role from the Project Viewer.
To deny access to a user, group, or role, select the Deny check box next to the name for
the user, group, or role. Deny takes precedence over Allow.
To grant access to a user, group, or role, select the Allow check box.
Tip: To allow everyone to see all objects unless specifically denied access, select the Allow check
box for the Everyone role.
4. Click OK.
A list of new and updated object-based packages appears.
Decide whether the objects can be selected, unselected, or hidden in the package (p. 254).
When you apply administrative access to a package, you give access to the user or users who are
responsible for
ensuring that no reports are impacted when a Framework Manager package is republished to
the server
Steps
1. Click the package you want to edit, and from the Actions menu, click Package, Edit Package
Settings. This invokes IBM Cognos Connection.
2. In IBM Cognos Connection, click the Permissions tab.
3. Create, add, or remove groups or roles as required. For information about how to do this, see
the IBM Cognos Connection User Guide.
4. After you finish modifying the security definition for the package, click OK to return to
Framework Manager.
Specify Languages
You can specify which languages are published with each package. You can create several packages
based on the same model, each using a different language.
For example, the package for the Mexican sales office includes Spanish and English. The package
for the Canadian sales office includes French and English.
You can also specify the languages for all packages at one time.
You must add languages to the project (p. 131) before you can specify the languages that your users
require in packages.
Allow Null Suppression - When true, this property makes suppression available to IBM
Cognos studio users. When false, suppression is not available in the published package.
Allow Multi-Edge Suppression -When true, users can select multi-edge or single edge
suppression options. When false, users will only have access to single edge suppression.
The Allow Null Suppression property must also be true.
Allow Access to Suppression Options - When true, users can choose the types of values
that will be suppressed, such as zero or missing values. By default, all the types of values
are suppressed. The Allow Null Suppression property must also be true.
Shortcuts
If a shortcut is included in a package and it points to a query subject that has been externalized,
the shortcut will also be externalized. The name of the data file is the name of the query subject to
which the shortcut points. If more than one shortcut points to the same query subject, then the
query subject is externalized each time the shortcut is encountered.
Query Processing
Native SQL is used to generate an IQD, so the native SQL produced when externalizing must run
successfully.
Some queries cause more than one query to be issued, or local processing to be performed to retrieve
data, or both. To prevent this, ensure that the Query Processing property for all data source objects
in the model is set to Database Only. For more information about query processing, see "Improve
Performance by Setting Query Processing Type" (p. 312).
Create a model query subject or a data source query subject that contains the dimensions you
want to externalize (p. 85).
In the Properties pane, set the Externalize Method property to the method you want.
Publish the package to externalize the dimensions you selected (p. 251).
Publish a Package
In IBM Cognos Framework Manager, you can publish a package (p. 254) to any folder in Content
Manager so your users can access it.
You can also publish a package to a network location. A package on a network location cannot
be used by your users. Publishing to a network location is useful for backing up a package.
Note: When you publish to a LAN location, be careful that you do not over-write any existing files,
particularly Framework Manager models and the model that is currently open.
Objects that are excluded or hidden, but are necessary in a query path, are included but marked as
hidden in a published package.
The governor settings that take precedence are the ones that apply to the model that is currently
open (whether it is a parent model or a child model).
To avoid problems, troubleshoot the package before publishing it by using the Verify the Package
Before Publishing check box in the Publish wizard to ensure that it is complete and does not contain
errors.
When you publish a package, you can
Set the number of model versions to retain on the server. For more information about model
versions, see "Update a Report to Use the Latest Version of a Package" (p. 270).
Tip: To see the number of model versions set for a package, select a package and, in the Property
pane, find the Max Versions property.
Externalize query subjects and dimensions so that you can use them with Transformer (p. 263).
For more information about dynamic query mode, see the Dynamic Query Guide.
Note: You can create packages directly in IBM Cognos Connection for IBM Cognos PowerCubes
and SAP BW cubes and queries. For more information, see the section about packages in the
Administration and Security Guide.
Steps
1. Select the package you want to publish.
2. From the Actions menu, click Package, Publish Packages.
3. Choose where to publish the package:
To publish the package to the report server, click IBM Cognos Content Store, click open,
and select an existing folder or create a new folder in the Content Store.
To publish the package to a network location, click Location on the network. Ensure that
you select a different location than the directory where the project files are stored. In general,
avoid saving to the same location as a model as the model could be overwritten.
4. To enable model versioning when publishing to the IBM Cognos Content Store, select the
Enable model versioning check box and type the number of model versions of the package to
retain.
Tip: To delete all but the most recently published version on the server, select the Delete all
previous model versions check box.
5. Click Next.
6. In the Add Security window, define security for the package (optional):
Goal
Actions
Run the script, excluding any steps that publish the package.
If the original version of the package still exists, the report runs against the original version. If
you want the report to run against the latest version of the package, you must update the report
to use the latest version of the package. See the steps below.
If the original version of the package no longer exists, the report is updated to run against the
most recent version.
Step
Move one report to the latest version of the model by editing and saving the report.
Before republishing the model, move all reports to the latest version of the model by
selecting the Delete all previous model versions check box in the Publish wizard.
Before republishing the model, disable model versioning by setting the model version limit
to 1.
Exploring your projects to see packages and roles in a project (p. 271).
Viewing the objects in your packages to see where specific objects exist (p. 272).
Creating documentation about your model to satisfy the specific requirements of your company
(p. 272).
Explore a Package
When you have a large number of projects and object-based security in a project, it can be difficult
to keep everything organized. You can explore packages to see the packages and roles in a project.
On the Package Contents tab, you see a list of all the packages (normal and object-based) in a
project, as well as the objects that were selected, unselected, or hidden for each package.
On the Object Security tab, you see a list of all the users, groups, and roles in a project, and in
which package the object-based security is applied. You can also see whether the objects in the
project are hidden or visible to that specific user, group, or role.
Steps
1. Select the Packages folder.
2. From the Actions menu, click Package and click Explore Packages.
3. Choose what you want to do.
271
Goal
Action
4. Click Close.
Steps
1. Click the object you want to see, and from the Actions menu, select Edit Package Inclusion.
2. To edit the package, click Edit Package.
For more information, see "Create or Modify a Package" (p. 254).
3. Click OK.
Steps
1. Click the object that you want to document.
Tip: Click the top-level namespace to document the entire model.
2. From the Tools menu, click Model Report.
The model report appears.
You can save, print, or change the format of the report.
Multiuser Modeling
You can implement multiuser modeling in IBM Cognos Framework Manager by:
Decide how you want to share the metadata in your organization. For more information, see
"Methodologies for Branching" (p. 274).
Divide the project into logical pieces and branch the project to create the logical pieces. For
more information, see "Ways to Branch a Project" (p. 276).
Communication between team members that are working on various branches is very important.
Before making a major change to your branch, talk to the other team members to see how the
change will impact their branches. For example, adding objects to a branch will probably not
impact other team members but deleting an object that other team members are using in their
branches will create a conflict when you merge your branch back into the root project.
Merge the branches in the reverse order that you created them in. For example, Sean creates a
branch from the root project. Susan creates a branch from Sean's branch. When it is time to
merge the branches back into the root project, Susan first merges her branch back into Sean's
branch and then Sean merges his branch back into the root project.
Merge branches back into the root project often, after making a few changes to your branch,
rather than making many changes and merging only occasionally. This makes it easier to resolve
conflicts during the merge process. You can merge all branches back to the root project and
then branch the project again. Each team member receives an updated version of the model.
In a branched project, any archived transactions (p. 296) will not be available when you merge
back into the main project.
Root project
common
FA 1 metadata
FA 2 metadata
FA 1
branch
FA 2
branch
common
common
FA 1 metadata
FA 2 metadata
Root Project
FA 2
metadata
FA 1
metadata
FA 1
branch
FA 2
branch
FA 1
metadata
FA 2
metadata
Distribution by Layers
In distribution by layers, the metadata is organized in layers. Each layer requires access to the
metadata of the layer above it. For example, a model contains three layers. The top layer is the root
project, consisting of a fully modeled physical layer. The root project is branched to create the second
layer, the intermediate branch. The intermediate branch contains a fully modeled development
layer. The intermediate branch is branched to create the third layer, the presentation branch. The
presentation branch contains a fully modeled business layer where reporting packages are defined
and published.
Root project
Physical Layer
Branches can be created within
a layer. The branches must
be merged back before
branching to the next layer.
merge
Intermediate branch
branch
branch
Development Layer
Presentation branch
Presentation Layer
By model layers
Create separate branches for the import layer, the intermediate layer, and the presentation
layer.
Create a Branch
You can create a branch in a project.
Steps
1. Open the project from which you want to branch.
2. From the Project menu, click Branch to.
Merge Projects
You can merge a branch back into its root project.
To merge a branch back into the root project, IBM Cognos Framework Manager shows a list of
transactions that have been performed on the branch. Beside each transaction is a check box. For
each transaction that has its check box selected, Framework Manager attempts to perform the
transaction on the project with which you are merging. If a transaction is completed successfully,
it is marked with a check mark and the next transaction is attempted. If a transaction fails, it is
marked with an "X" and processing stops.
When a transaction fails, you may be able to correct the problem immediately. For example, if an
object is missing, Framework Manager identifies the missing object and prompts you to replace it
with another object.
When you reach the end of the transaction list, you can accept or cancel the changes. If you accept
the changes, the transactions that were successful are removed from the transaction list. If you do
not accept the changes, the transaction list is not updated and you can perform the same merge
again at a later time.
Some conflicts cannot be resolved during the merge process or there may be more than one transaction related to a failed transaction. In these situations, you can skip the transactions by selecting
the Uncheck dependent transactions check box. Framework Manager then clears the check box for
each transaction related to the failed transaction. When Framework Manager resumes running the
transaction list, it does not run the transactions if their check boxes are cleared. When you reach
the end of the transaction list, you can accept the changes to that point, troubleshoot the transactions
that were skipped, fix the error, and then perform the merge again. When you perform the merge
again, the transaction list contains only the transactions that were not performed.
Note: Before the transaction list is run, Framework Manager makes a backup of the merging project.
The backup is stored in the same directory as the merging project.
Steps
1. Open the project into which you want to merge a branch.
2. From the Project menu, click Merge from.
3. In the Select Project to Merge From dialog box, click the Files of Type list and click All
Files (*.*).
4. Locate the log.xml file for the branch to be merged, and click Open.
The Perform the Merge window opens, showing a list of transactions. The transactions that
you selected are run.
To run the entire transaction list continuously from start to finish, click Run.
When a transaction is completed, a check mark or an "X" appears beside it. A check mark
indicates that the transaction was applied successfully to the model you are merging into. An
"X" means that the transaction failed. Detailed information for each transaction is listed under
Transaction Details. If a transaction fails, the merge process pauses.
6. Choose one of the following:
Goal
Action
Click Skip.
Click Step.
Click Continue.
Click Accept.
7. Perform the previous step until you reach the end of the transaction list or you have accepted
or reverted the changes.
If you accepted the changes, they appear in the Project Viewer. If you reverted the changes,
none of the changes appear.
8. If you accepted the changes, save the merged project in the project page. If you decide not to
save the changes, close the project without saving it.
Note: If you accept the changes in the Perform the Merge window but do not save the project
you can never perform the same merge again. After you accept transactions they are removed
from the transaction list.
Case 1:
An object used in the branch project is not in the root project. In the Merge dialog box, you see the
Replace box indicating the name of the object that is missing from the root project.
To resolve this problem, you need to select an alternative object from the root project. Do the following:
1. From the Project Viewer or Diagram, select the name of the object to use in place of the missing
object.
In the Merge dialog box, the object appears in the Replacement Field.
2. Click Replace.
The transaction runs again, substituting your replacement object for the missing object.
For more complex problems, you may be prompted to select the object that cannot be found in the
root project from the Object Naming Conflict Resolution dialog box.
If a warning appears, you are unable to resolve the problem using this dialog box. Instead, do one
of the following:
Case 2:
For all failed transactions, you can resolve the problem by modifying the root project.
To modify a root project, do the following:
1. Modify the model as required.
2. From the Perform the Merge dialog box, click Continue to run the entire transaction list starting
from the failed transaction.
Case 3:
You are unable to fix the transaction.
To resolve this problem, do the following:
1. Click Skip to skip the next transaction.
2. Clear the check box for the failed transaction.
3. Ensure the Uncheck dependent transactions check box is selected.
4. From the Perform the Merge dialog box, click Continue.
ensuring that the namespace in the main project and any links in the project to folders have
the same identifier (p. 76)
For example, you have a main project and a link in the project to a folder. The folder you
link to must exist in a namespace that has the same name as the main project. If the identifier
in the main project and that of the linked folder are not the same, any relationships,
shortcuts, or expressions that reference objects in the link, from the main project, may not
work.
updating references in both the main project and segments in the project
For example, you have a main project and a segment in the project. In the main project,
you have a relationship named qs1_qs2 that exists between query subject1 and query subject2. The query subject named query subject 2 is in the segment. You open the segment,
rename query subject2 to query subject3, and save the segment. When you open the main
project, an error occurs because the relationship qs1_qs2 is broken. In Framework Manager,
any object that relies on a reference, such as shortcuts, model query subjects, and expressions
are also affected.
ensuring that the main project and any segments in the project have the same languages
For example, you have a main project and a segment in the project. In the segment, you
defined the languages English and French. You open the main project, add the language
Chinese, and save the segment. When you open the segment, an error occurs because the
language Chinese is not defined in the segment.
Accept the default project name when creating the segmented project.
The segmented project must be created in a sub-folder within the master project folder. The
default project name is the same as the folder or namespace that contains it.
Segment the model (p. 282) for each namespace you created.
Use a source control repository when possible to restrict access and track changes to your
projects and segments.
You cannot test objects in a segment or linked project if they refer to objects that exist in an
unavailable segment.
You cannot create new objects in a segment or linked project if they refer to objects that exist
in an unavailable segment.
When you link to a project, all referenced objects (namespace objects, data sources, and
parameter maps) are linked. Packages are not linked.
Changes that you make to a child segment are not reflected in the main project, even after doing
a refresh (F5). This happens because another child segment linked to the parent or the main
project itself is open. Close all child segment projects and then reopen the main project.
The point at which you create a segment in a project determines the point at which you can
see the segment. If you create a nested segment from the main project, you can see the nested
segment from the main project. If you open the segment containing the nested segment as a
standalone project, you cannot see the nested segment. If you create a nested segment from a
segment opened as a standalone project, you can see the nested segment from the standalone
project. If you open the main project, you cannot see the nested segment created from the
standalone segmented project.
Create a Segment
With segments, you can organize a project according to business rules and organizational requirements, and share and reuse project information.
You create segments at the folder level or the namespace level. You can create a new project in a
new folder, complete with its own associated project files.
When a new segment is created, existing parameter maps from the main project are copied to the
new segment. After the segment is created, parameter maps are unique to each segment and cannot
be shared between segments. For example, if you are working in the main project, you can use a
parameter map in a query subject belonging to a segment. However, if you open the segment, the
parameter map is not available.
You can access a segment only from the project in which it was created. For example, you open
the main project and create a segment (Segment A). Then you create another segment (Segment B)
inside Segment A. From the main project, you can see Segment A and Segment B. However, if you
open Segment A by itself, you do not see Segment B.
Before you create segments, consider dividing your project into business units. For example, you
have a project named Sales. You can create two folders, one named Products and the other named
Orders. You can divide the Sales project at the Products folder and at the Orders folder.
Steps
1. Click the folder or namespace you want to divide, and from the Project menu, click Create
Segment.
We recommend that you accept the default settings for the project name.
2. To rename the segment, in the Project Name box, type a different name.
This does not change the folder name. If you want to rename the folder, you should rename it
in Project Viewer before creating the segment.
For ease of use, we recommend keeping the same name for both the folder and the segment.
3. Click OK.
The Project Viewer is refreshed and the icons representing the segmented folder or the segmented
namespace are shown.
Create a Link
You create links to help organize work across large projects, to maintain consistency, and to reuse
information.
For example, the project named Inventory contains the folder named Products. You can create a
link from the Sales Products to Inventory Products. If any changes or additions are made to the
Inventory Products folder, you will see them in the Sales Products folder.
If you plan to link model segments, ensure that you follow the recommendations for model segmentation (p. 280).
A linked project is shared by other projects. It should not be created in a sub-directory within the
master project directory.
You must create the project, folder, or namespace before you can link to it.
The projects you link must have and the same design language the same languages defined.
Steps
1. In the Project Viewer, click the project, segment, namespace, or folder that you want to link
to.
Tip: You can create links only to folders, namespaces, projects, or segments.
2. From the Project menu, click Link Segment.
3. Locate and click the .cpf file of the project that contains the object that you want to link to.
4. Click Open.
If the project you selected requires upgrading, you are prompted. For more information,
see "Upgrading Models" (p. 365).
If the project uses a mapped drive letter, you are prompted to keep the mapped drive letter
or to change it to a UNC path.
You must choose the UNC path if your project will be shared by others.
To link to another project, click Add Project, locate the .cpf file and click Open. Select the
project and click Add.
6. Click OK.
A new folder appears in the Project Viewer.
Steps
1. Create a share that will host the project that is to be protected.
2. Give read-only access to that share for any developer leveraging the project.
Note: You can also make a project read-only by changing the file properties.
The appearance of the user interface changes when a project is read-only. Greyed out names,
properties or actions indicate that no modifications can be made.
Add all the files that exist in the project directory to the external repository.
Tip: The project directory is the directory that contains the <project name>.cpf file.
Segment a Project
You can create a segment for a project that is stored in an external repository. The segments are
project directories that are stored under the main project directory. Maintain the same hierarchy
in the repository as in the project directory.
The segments can be opened individually as stand-alone projects.
A segment can also be opened as part of the main project. In this situation, you must check out the
project for each segment that you want to modify.
Copy, move, rename, or delete your projects to organize them in meaningful ways for your
reporting environment (p. 285).
Analyze the changes made to a model to see how they affect the packages and the reports that
use the model (p. 287).
Export your model to exchange metadata between different data warehouse tools and repositories (p. 291).
Reuse the same model and reports with different sets of data (p. 292).
Copy a Project
When you copy a project, you create a replica of that project in another location. All files in the
project folder, including sub-folders, are copied to the new location. When you make changes to
the project in one folder, these changes are not reflected in copies of the project in other folders.
Copying a segmented model copies all segments as well as the main project.
There may be times when you cannot copy a project and must use Save As instead. Saving the
project with a new name creates a new project folder while saving the project with the existing
name overwrites the current project. This is useful if you want to save changes made to a read-only
project or if you want to save a project with a different name or to a new location without overwriting the original project.
You cannot create a copy of a project in the same folder as the original. If you copy a project under
an existing project folder, Framework Manager treats it like a project segment (p. 280).
If a project or segment is open when you copy it, the last saved version is copied.
Steps
1. From the File menu, click Manage Projects, Copy.
Move a Project
You may decide to move a project if your folder becomes so full that it is difficult to locate particular projects. When you move a project, you are actually copying it to a new folder and deleting it
from the current folder. All files in the project folder, including sub-folders, are moved to the new
location.
Moving a segmented model moves all segments as well as the main project.
Before you can move a project, the project must be closed in Framework Manager.
Steps
1. From the File menu, click Manage Projects, Move.
2. In the From box, click the browse button and select the .cpf file for the project you want to
move.
Note: The project folder name is shown in the text box.
3. In the To box, type the new location or click the browse button and select the new project
location.
4. Click OK.
Rename a Project
When you rename a project, you provide a new name for the .cpf file. You are not changing the
location of the project. Secondary project files and log files keep their original name.
If a project appears in the recent projects list on the Framework Manager Welcome page and you
proceed to rename it, you cannot open the project by clicking the link. You must open the project
using the Open command from the File menu.
Before you can rename a project, the project must be closed in Framework Manager.
Steps
1. From the File menu, click Manage Projects, Rename.
2. In the From box, click the browse button and select the .cpf file for the project you want to
rename.
Delete a Project
When you delete a project, the project folder and all its contents, including any user files, are deleted
from the file system and sent to the recycle bin.
If your project is segmented and you delete the main project, the segments are deleted as well.
Deleting a project segment deletes only the segment and not the model it is based on.
We recommend that you delete segments from within the model. If you delete the segment using
Delete from the File menu, it appears as if the segment still exists within the model. For more
information, see "Segmenting and Linking Projects" (p. 280).
Before you delete a project, ensure that the project and all its segments are closed. Framework
Manager does not support a file locking mechanism so it is possible under certain circumstances
to delete a project with open segments. If you delete a project with open segments, the segments
can no longer be saved.
Steps
1. From the File menu, click Manage Projects, Delete.
2. In the Project Folder box, click the browse button and select the .cpf file for the project you
want to delete.
Note: The project folder name is shown in the text box.
3. Click OK.
The project folder and all its contents are deleted.
Steps
1. In the Project Viewer, click a package that has been published.
2. From the Actions menu, click Package, Analyze Publish Impact.
3. Choose what you want to do:
Goal
Action
Display modelers comments, last changed Click the double down arrow.
by, and last date changed
4. Click Close.
Steps
1. From the Analyze Publish Impact dialog box, do one of the following:
Select each object for which you want to determine the report dependencies by selecting
individual check boxes.
Select all objects by selecting the check box at the top of the check box column.
Goal
Action
4. Click Search.
A list of report names appears in the Report Dependency window under Impacted Reports.
The results show both direct and indirect dependencies. The names of objects that indirectly
impact reports are displayed in a lighter color.
5. To sort the results, click Sort at the top of a column.
6. Click Close.
Constraint
You cannot show dependencies for parameter maps.
Steps
1. In the Project Viewer, click an object.
2. From the Tools menu, click Show Object Dependencies.
The objects that depend on the selected object appear under Dependent objects.
3. To show the object identifier for the dependent objects, select the Show Object ID check box.
4. If the object has children and you want to see the dependencies for a child object, click the plus
sign (+) beside the object that contains the child object.
5. Click a child object under the parent object.
The objects that depend on the child object appear under Dependent objects.
Note: You can also show object dependencies from the following:
The Project Viewer by right-clicking an object and selecting Show Object Dependencies.
The Context Explorer window by right-clicking an object and selecting Show Object Dependencies.
The Analyze Publish Impact window by clicking the Show Dependencies icon under Actions
in the row that contains the object.
Constraints
You cannot remap data source query subjects or data source dimensions.
Remapping is only supported when using the design locale of the model.
Steps
1. In the Project Viewer, right-click an object and select Remap To New Source.
2. If you want to change the matching criteria, click Options and do the following:
Choose the matching criteria for the object you are using to remap, and for the original
object that you are remapping.
You can match objects by name or by object reference.
The default criteria options are By Name for the object you are using to remap, and By
Object References for the original object that you are remapping.
Click OK.
To use the criteria you specified, select the Use matching criteria options check box.
Notes:
If the matching criteria is By Name to By Name, spaces within the string are removed.
Goal
Action
Remap multiple objects auto- Under Available Model Objects, drag a query subject to
matically
any row under Query Items, Measures, Calculations, and
Filters.
All of the objects that meet the matching criteria are
remapped and their values appear under Remap To.
Change the expression for an Click the ellipsis () button beside the object. For
object
information on how to create an expression, see "Create
a Calculation" (p. 155).
Restore a remap value to the Right-click the row that contains the object that you
original source value
want to restore, and select Restore to Original Value.
Clear the remap value and the Click the row that contains the object, and click Clear.
original value for the selected
object
Clear the remap value for all Click Clear All.
objects
Export Metadata
You can export your IBM Cognos Framework Manager model as a Common Warehouse Metamodel (CWM) file. CWM exchanges metadata between different data warehouse tools and repositories. Each instance of the CWM metamodel is exchanged using XMI (.xml metadata interchange)
documents.
When you export a Framework Manager model as a Common Warehouse Metamodel (CWM) file,
joins, folders, namespaces, prompts, and calculations are not exported. Only query subjects, query
items, and functions are exported.
Constraint
Do not use Japanese characters in the export path.
Steps
1. Right-click the root namespace of the metadata you want to export, and click Export Model.
You are prompted to save the project.
2. Select the export target.
3. In the Framework Manager Specific Export Options dialog box, click the options you want.
Note: We recommend that you use the default options. These default options optimize the
metadata import. If you change the options, you may see unexpected results. To revert to the
default options, click Use Defaults.
4. Click Next.
5. In the Third Party Specific Export Options dialog box, use the File option to identify the file
to contain the exported metadata.
Click the other options you want.
In the Option Description pane, you see a description of the options available. The options are
based on the selected data source. For more information, see the data source vendor documentation.
Note: We recommend that you use the default options. These default options optimize the
metadata export. If you change the options, you may see unexpected results. To revert to the
default options, click Use Defaults.
6. Click Next.
The input validation results from the export process appear.
7. Click Next and click Finish.
Project Reuse
You may have to use the same model and reports with different sets of actual data. The data sets
may be different databases, accounts, or schemas in a single database. You may encounter multiple
data sets
Steps
1. Create a single session parameter whose value identifies whether you are in design mode. When
you are in design mode, set the value of this session parameter to a specific value, such as design.
Otherwise, leave the value empty.
a key whose name is the design value of the session parameter above, and whose value is
the name of the design mode catalog or schema for that data source.
3. Select the data source, and replace the catalog and schema property values with a macro that
uses the corresponding parameter map and session parameter.
For example, use
#$DBSchemaName ($DeployOrDesign) #
Model Portability
You can use a IBM Cognos Framework Manager model to access data from different database
instances. The database instances can be from the same or different vendors.
There are several things to consider when moving a Framework Manager model from one relational
database to another. Unlike changing from one identical database to another on the same platform,
it may not be sufficient to change the data source connection information.
Review the generation of determinants and relationships based on indexes and do not assume that
the indexes reliably describe functional dependencies or relationships for reporting.
Scalar functions are imported into a model prefixed by a catalog or schema qualification in the
SQL statement. As with tables and views, you may have to remove or alter the location qualification
when switching vendors. For example, if you create a model against an ORACLE database, and
the connection is changed to point to an equivalent SQL Server database, an error results because
the model data source type has remained OR instead of changing to the appropriate data source
type.
To move a model from one relational database to another, do the following:
Evaluate the DDL (Data Definition Language) to determine portability for physical names by
avoiding using reserved key words in the ANSI standard and vendor documentation.
avoiding conversions.
Evaluate the DDL to determine portability for data types in terms of compatibility and the
precision and scale of data types.
Review any native SQL statements in your models and reports for relational-specific syntax
that may or may not be supported.
Steps
1. From the Project menu, click View Transaction History.
Tip: To make the dialog box larger, double-click the caption. Double-click again to restore the
dialog box to its original size.
2. Click the transaction numbers that you want.
Tip: To view the details of a transaction, click the plus sign (+) next to a transaction number.
3. Click Save as Script.
4. Type a name for the file.
5. Click Save. Do not save the file in the logs folder.
6. Click Close.
Steps
1. From the Project menu, click Run Script.
2. Select the script you want, and click Open.
3. If you want to view the details of a transaction, click the transaction.
4. Set the starting or stop point that you want.
To set the starting point for running the script, select the script and then click Set the
starting point. You can do this at any time to skip an instruction or run instructions that
have already been executed
To set a stop point for the script, select the script and then click Set the stop point
You can stop the script to make a manual fix and then start it again.
Tip: To remove the stop point, click Remove the stop point
5. Using the toolbar buttons, choose the run action that you want.
Button
Description
Runs the script
After an error is encountered, clicking this button attempts to re-execute
the failed instruction.
Skips to the next transaction and runs the script to the end
Runs the selected transaction only
Skips to the next transaction and stops, but does not run any transactions
Syntax
At the command prompt, ensure you navigate to the installation location of the BmtScriptPlayer.
exe.
Use the following syntax to run the Script Player:
BmtScriptPlayer [-c|-m] <projectname> [-a <actionlogname>][options]
where <projectname> is the name of the project and <actionlogname> is the name of the action
log.
For example,
BmtScriptPlayer -m goSales.cpf -a import.xml
Options
You can specify how the Script Player runs using the following options.
Note: If you are working in a UNIX environment, you may want to create a script to hide credentials
that are passed on the command line.
Option
Description
-a FILEPATH
-b NUM
-c FILEPATH
-e NUM
Option
Description
-g
-k DIRECTORY
-m FILEPATH
-n
-p PASSWORD
-s NAMESPACE
-t DIRECTORY
-T PASSPORT
-u USER
-x
-y PASSPORT
Examples
This table shows some examples of Script Player commands.
Command
Description
BmtScriptPlayer -c <projectname> Create a project and apply the transactions num-a <actionlogname> -b2 -e20
BmtScriptPlayer-m <projectname>
-a <actionlogname> -n
Open an existing project and apply all the transactions from the action log. Do not save the project.
Solution
Action
Skip transactions that include this Click Exclude and in the Exclude Transactions that Use
object
this Object dialog box, select the level of exclusion that you
want.
The current transaction and all subsequent ones that reference the excluded object are ignored. For example, if a
transaction attempts to create a package that uses the
excluded object, the package is not created.
Note: We recommend that you attempt to fix errors before
skipping transactions.
Replace this and all following
occurrences of the object
Solution
Action
Retargeting an Object
If a transaction refers to an object that no longer exists, the script stops and a dialog box appears
with the name of the problematic object. You can retarget the object by clicking Replace and
selecting a new object.
If a missing object appears in an expression, the script stops and a dialog box appears with the
name of the problematic object. You must fix the problem manually by opening the expression that
contains the missing object.
Steps
1. From the Project menu, click View Transaction History.
2. Locate the entry in a log file for the transaction that occurred after the last transaction you
want to archive.
All transactions in the current log file prior to the selected transaction will be archived.
3. Click Archive Log File.
Synchronize Projects
You can use IBM Cognos Framework Manager log files to synchronize your project. You may
choose to synchronize your project if you
When you synchronize your project, you create a new project by replaying from the log files, all
the actions you made in the original project.
Special considerations should be taken before synchronizing projects that contain segmented models
or linked models.
If your data source is a relational database, you can update only the query subjects and do not need
to perform a full project synchronization. You must perform a project synchronization to synchronize
changes made in another data source.
If you import a subset of a data source, any new objects that were added to the data source are not
included when you synchronize. The action log recorded the importing of objects that you originally
specified. When you synchronize, only the originally imported objects are re-imported.
You can use project synchronization to run the complete action history of the model and update
the model's metadata. You can also save portions of the action log to a separate script file for later
use, or you can save the entire action log to a script file if you want to build the same model in
batch mode. If you encounter errors when trying to run an action log script, see "Fixing Errors
Caused by Invalid Objects" (p. 300).
After synchronizing, you can choose to accept the new changes and create a new project, or return
to the original project. If you accept the new changes, the original project is replaced.
Because every action that you made in your project is rerun, synchronization may take a long time.
If an object that is referenced by a transaction no longer exists, either because it was renamed or
deleted, you will receive errors during the synchronization. For example, if you imported a table
named Products and then renamed the table to New Products in your data source, you will receive
an error when you synchronize the project. The synchronization cannot detect that the table named
New Products was previously imported using a different name. You must manually retarget the
object to complete the synchronization. For information about fixing synchronization errors, see
"Fixing Errors Caused by Invalid Objects" (p. 300).
Note: Action logs from IBM Cognos ReportNet are not supported in this release.
Before synchronizing a project, you should understand how synchronization impacts segmented
(p. 302) and linked (p. 303) models. You should also ensure that data source connections have not
changed and that data sources are online. You can check your connections by testing a few key
query subjects.
Segmented Models
A segmented model should be synchronized only by synchronizing the main project. The results of
synchronizing the entire project are written to the log file of the main project. The ability to synchronize individual segments is lost after the first synchronization of the main project.
If you are working in the main project and change a segment, the main log file is updated. If you
are working in the segment and make changes, the segment log file is updated.
Synchronization commands do not necessarily run in the order they appear in the log files. This
happens because it is possible to update segments concurrently and the action logs are replayed
Linked Models
Log files are contained in the project that is open and not in the model that is updated.
If you open a main project and make changes to a linked model, the actions are logged in the log
file of the main project. If you then synchronize the linked model, the change is lost because it did
not appear in the set of log files that were used in the synchronization.
Synchronization can be run only on the main project or a stand-alone segment. You cannot synchronize linked projects or segments in the main project. If the segments are updated by the linked
project, the synchronization can produce unpredictable results in the main project.
We recommended that you do not use model synchronization in combination with linked projects.
Steps to Synchronize
1. From the Project menu, click Synchronize.
2. We recommend that you create a backup of your Framework Manager project by selecting the
Backup project into this directory check box.
3. If you want to view the details of a transaction, click the transaction.
4. Set the starting or stop point that you want.
To set the starting point for running the script, select the script and then click Set the
starting point. You can do this at any time to skip an instruction or run instructions that
have already been executed
To set a stop point for the script, select the script and then click Set the stop point
You can stop the script to make a manual fix and then start it again.
Tip: To remove the stop point, click Remove the stop point
5. Using the toolbar buttons, choose the run action that you want.
Button
Description
Runs the script
After an error is encountered, clicking this button attempts to re-execute
the failed instruction.
Skips to the next transaction and runs the script to the end
Runs the selected transaction only
Skips to the next transaction and stops, but does not run any transactions
Query Behavior
By monitoring and adjusting the behavior of queries in your project, you can improve the performance of your model.
You can do the following:
Set governors to reduce system resource requirements and improve performance by ensuring
that the metadata in a package contains the appropriate limits. For example, you can set limits
on the amount of data retrieved or the time that a query can take (p. 304).
Specify whether aggregate rollups are computed locally or in the database. For relational
metadata, you can improve performance by selecting the right type of query processing. After
initial report execution, by turning the query reuse feature on, you can create reports without
querying the database again (p. 311).
Improve performance by setting the query processing type to determine whether SQL processing
is performed by the database server or processed locally (p. 312).
Improve performance by reusing cached data when running a report. By reusing cached data,
you can create a report without querying the database again (p. 313).
Select the vendor-specific function sets for the data sources defined in the project (p. 314).
Indicate the behavior of individual functions based on the data sources in the project (p. 315).
Control and optimize how queries are run by modifying the properties of a data source that
was created using the Metadata Wizard in IBM Cognos Framework Manager (p. 317).
Set Governors
Use governors to reduce system resource requirements and improve performance. You set governors
before you create packages to ensure the metadata in the package contains the specified limits. All
packages that are subsequently published use the new settings.
The governor settings that take precedence are the ones that apply to the model that is currently
open (whether it is a parent model or a child model).
In a new project the governors do not have values defined in the model. You must open the Governors window and change the settings if necessary. When you save the values in the Governors
Outer Joins
You can control whether outer joins can be used in your query or report. An outer join retrieves
all rows in one table, even if there is no matching row in another table. This type of join can produce
very large, resource-intensive queries and reports.
Governors are set to deny outer joins by default. For example, outer joins are not automatically
generated when you test a query item in Framework Manager.
SQL is generated automatically when you
run a report
create a new model query subject based on other objects (p. 96)
If you keep the setting as Deny, you are notified only if you create a relationship in the Diagram
tab that includes outer joins. You are not notified if you create a relationship in a data source query
subject that includes outer joins.
If you set the governor to Allow, dimension to fact relationships are changed from inner joins to
outer joins.
The outer joins governor does not apply in these circumstances:
SQL that is generated by other means. If you set this governor to Deny, it does not apply to
the permanent SQL found in a data source query subject, whether the SQL was generated on
import (p. 58), manually entered, or based on existing objects (p. 85).
Framework Manager needs to generate an outer join to create a stitched query. A stitched query
is a query that locally combines the results of two or more sub-queries by using a locally processed outer join.
Cross-Product Joins
You can control whether cross-product joins can be used in your query or report. A cross-product
join retrieves data from tables without joins. This type of join can take a long time to retrieve data.
The default value for this governor is Deny. Select Allow to allow cross-product joins.
Shortcut Processing
You can control how shortcuts are processed by IBM Cognos software.
When you open a model from a previous release, the Shortcut Processing governor is set to Automatic. Automatic is a shortcut that exists in the same folder as its target and behaves as an alias,
or independent instance. However, a shortcut existing elsewhere in the model behaves as a reference
to the original. When you create a new model, the Shortcut Processing governor is always set to
Explicit.
If you set the governor to Explicit, the shortcut behavior is taken from the Treat As property. If
the Shortcut Processing governor is set to Automatic, we recommend that you verify the model and,
when repairing, change the governor to Explicit. This changes all shortcuts to the correct value
from the Treat As property based on the rules followed by the Automatic setting.
The Shortcut Processing governor takes priority over the Treat As property. For example, if the
governor is set to Automatic, the behavior of the shortcut is determined by the location of the
shortcut relative to its target regardless of the setting of the Treat As property is.
If the governor is set to Server determined, the CQEConfig.xml file is used to determine the
governor value. If there is no active CQEConfig.xml file or no parameter entry for the governor
in the CQEConfig.xml file, then the Implicit setting is used.
The Explicit setting uses the from clause with the keywords inner join in an on predicate.
For example,
SELECT
publishers.name, publishers.id,
books.title FROM publishers INNER JOIN books ON publishers.id
= books.publisher_id ORDER BY publishers.name, books.title;
You can set the join type on the query property in Report Studio to override the value of this governor.
Regardless of the setting you use for this governor, the Explicit setting is used for left outer joins,
right outer joins, and full outer joins.
This governor has no impact on typed-in SQL.
The Enabled setting allows aggregation of the measure for the attributes. Note: This is the default
behavior for IBM Cognos Framework Manager versions prior to 8.3.
select
Product.Product_line_code as Product_line_code,Order_method.Order_method_
code as Order_method_code, //measure attributeXSUM(Sales.Quantity for Order_
method.Order_method_code, Product.Product_line_code) as Quantity //
aggregated measure
from ...
The Group By setting adds the attributes of the level in the group by clause. with no aggregation
for the attribute. The distinct clause indicates a group by on all items in the projection list. The
Group By setting is recommended if the data has no duplicate records. It can enhance the use of
materialized views and may result in improved performance. For example,
select distinctProduct.Product_line
as Product_line, //level attribute
Product.Product_line_code as Product_line_code
from
(...) Product
The Group By setting adds the attributes of the determinants in the group by clause with no
aggregation for the attribute. This setting is recommended if the data has no duplicate records. It
can enhance the use of materialized views and may result in improved performance. For example,
select
PRODUCT_LINE.PRODUCT_LINE_CODE as Product_line_code,
PRODUCT_LINE.PRODUCT_LINE_EN as Product_line //attribute
from
great_outdoors_sales..GOSALES.PRODUCT_LINE PRODUCT_LINE
collation level
character set
nullability
precision
scale
column length
data type
The With clause is turned on for models created in IBM Cognos BI. For upgraded models, it is
turned off unless it was explicitly turned on in the Cognos ReportNet model prior to upgrading.
unspecified
The aggregation rollup is not specified.
local
All aggregation rollups are computed locally (in the report server) using a running aggregate
(for example, RSUM). Running aggregates spread the cost of this computation as the data is
retrieved. Use this option if the local computer has more idle resources than the database
computer, or if you find through experiment that it is the fastest method.
database
Aggregation rollups are computed by the underlying database software if possible. Otherwise,
they are computed locally (provided local query processing is enabled). Running aggregates are
used, but the cost is incurred by the database server instead of the report server. Use this option
if the database computer has more idle resources than the local computer, or if you find through
experiment that it is the fastest method.
extended
Steps
1. In the Project Viewer, click the data source you want to change.
2. In the Properties pane, in the Rollup Processing list box, select the type of rollup processing
that you want.
limited local
The database server does as much of the SQL processing and execution as possible. However,
some reports or report sections use local SQL processing.
database only
The database server does all the SQL processing and execution. An error appears if any reports
or report sections require local SQL processing.
Although the database server can usually run the SQL and run reports much faster, local processing
is sometimes necessary. For example, choose limited local processing if you want to create cross
database joins, or if you want your users to use unsupported SQL99 functions.
Some complex queries require limited local processing, such as a query that must generate an At
clause to avoid double-counting.
limited local
Limited Local is not supported at this time.
database only
Little, or possibly none of the query processing is performed by the report server. Local processing only occurs if the database cannot handle the query. Consider using this value only if your
report performance is unacceptable with the default setting, and becomes usable with this setting.
Steps
1. In the Project Viewer, click the data source you want to change.
2. In the Properties pane, in the Query Processing list box, click either Limited Local or Database
Only.
If most report consumers run reports interactively but run them only once, you may not experience a high level of performance improvement by caching data.
Note: Regardless of the query reuse settings, reports that run in batch mode do not cache data.
The size of the cache may impact scalability. For example, if a report has a large result set, the
cache will also be large. This should be taken into account when sizing and configuring your
server environment.
Steps
1. From the Project menu, click Project Function List.
2. Select the Set function list based on the data source type check box.
Tip: To disable this filter, select the Include all function sets check box.
3. In the Function set page, click the appropriate data source row.
Quality of Service
With IBM Cognos Framework Manager, you can query any combination of data source types,
but not all data sources support functions the same way. The quality of service indicator provides
you and your users with a visual clue about the behavior of individual functions when used in
conjunction with the data sources in the model.
Each function specified in your data source may have a different quality of service, depending on
the type of data source in use. For each query feature that does not have the same quality of service
across packages, you can override the level of service and add text to describe the specific situation
in that model. Your users can see the quality of service indicators and the context specific description,
and use this information when determining which functions to use in reports.
The quality of service for a function is specified at the data source level and can be set for an individual function (p. 381) or for all functions in a package. The quality of service indicators are:
If there is more than one type of data source in the model, the quality of service values are aggregated
according to the following rules:
In all other cases, the lowest common dominator is used. For example, if the quality of service
is Unconstrained in one data source and Limited Support in another data source, the quality
of service for that function becomes Limited Support. If the quality of service is Limited Support
in one data source and Limited Availability in another data source, the quality of service is
reported as Limited Availability.
Impacts on Performance
The quality of service indicators has no direct impact on query performance. Service indicators are
intended to give you some control over which functions are available for use. You can then prevent
your users from using functions that could result in long running queries or queries that fail.
It is important to note that if you use functions that are not available in your data source, IBM
Cognos Framework Manager tries to compensate by using local processing on the report server.
This may have an impact on query performance because the work is done on your report server
instead of on your data source server.
In some situations, local processing may require more data to be retrieved from the data source
server, which has an impact on both the data source server and the network. For example, OLAP
functions are not available in a relational data source. If you attempt to use OLAP functions with
a relational data source, Framework Manager uses the dimensional information in the data source
to generate a local cube and run the OLAP functions against the cube. This requires retrieval of
dimensional information from the data source server and extra processing on the report server.
Steps
1. From the Project menu, select Project Function List.
2. Click Define Quality of Service.
3. Expand the tree nodes to view the quality of service for each function.
4. To override the quality of service, click the arrow beside each function and select the quality
of service indicator from the list.
5. After changing the quality of service, you can add detailed information about the function in
the text box on the right.
Description
Name
Query Processing
Rollup Processing
Catalog
Cube
Schema
Type
Description
Query Type
Query Interface
Function Set ID
Parameter Maps
319
Cardinality
Relationships exist between two query subjects. The cardinality of a relationship is the number of
related rows for each of the two query subjects. The rows are related by the expression of the relationship; this expression usually refers to the primary and foreign keys of the underlying tables.
IBM Cognos software uses the cardinality of a relationship in the following ways:
A query that uses multiple facts from different underlying tables is split into separate queries for
each underlying fact table. Each single fact query refers to its respective fact table as well as to the
dimensional tables related to that fact table. Another query is used to merge these individual queries
into one result set. This latter operation is generally referred to as a stitched query. You know that
you have a stitched query when you see coalesce and a full outer join.
A stitched query also allows IBM Cognos software to properly relate data at different levels of
granularity (p. 326).
0:1 to 0:n
0:1 to 1:n
1:1 to 0:n
1:1 to 1:n
Use the Relationship impact statement in the Relationship Definition dialog box to help you
understand cardinality. For example, Sales Staff (1:1) is joined to Orders (0:n).
It is important to ensure that the cardinality is correctly captured in the model because it determines
the detection of fact query subjects and it is used to avoid double-counting factual data.
When generating queries, IBM Cognos software follows these basic rules to apply cardinality:
1 to n cardinality implies fact data on the n side and implies dimension data on the 1 side.
A query subject may behave as a fact query subject or as a dimensional query subject, depending
on the relationships that are required to answer a particular query.
Use the Model Advisor to see an assessment of the behavior implied by cardinality in your model.
For more information, see "Single Fact Query" (p. 351) and "Multiple-fact, Multiple-grain Query
on Conformed Dimensions " (p. 352).
The SQL generated for this query will be split, treating Sales staff and Order details as facts. The
results of these two subqueries are stitched using the information retrieved from Sales branch. This
gives a report that lists the Sales staff information by Sales branch next to the Order details and
Order header information by Sales branch.
The SQL in this example also generates a stitched query, which returns a similar result as above.
Note that a stitch operation retains the information from both sides of the operation by using a full
outer join.
Determinants
Determinants reflect granularity by representing subsets or groups of data in a query subject and
are used to ensure correct aggregation of this repeated data. Determinants are most closely related
to the concept of keys and indexes in the data source and are imported based on unique key and
index information in the data source. We recommend that you always review the determinants that
are imported and, if necessary, modify them or create additional ones. By modifying determinants,
Year Key
Month Key
Day Name
2006
200601
January 06
20060101
2006
200601
January 06
20060102
You can define three determinants for this data set as follows -- two Group By determinants (Year
and Month) and one unique determinant (Day). The concept is similar but not identical to the
concept of levels and hierarchies.
Name of the
Determinant
Key
Attributes
Uniquely Identified
Group By
Year
Year Key
None
No
Yes
Month
Month Key
Month Name
No
Yes
Day
Day Key
Day Name
Yes
No
Month Key
Month Name
Year Key
In this case, we use only one key for each determinant because each key contains enough information
to identify a group within the data. Often Month is a challenge if the key does not contain enough
information to clarify which year the month belongs to. In this case, however, the Month key
includes the Year key and so, by itself, is enough to identify months as a sub-grouping of years.
Note: While you can create a determinant that groups months without the context of years, this is
a less common choice for reporting because all data for February of all years would be grouped
together instead of all data for February 2006 being grouped together.
Region
Country Key
State/Province Key
City Key
North America
USA
Illinois
Springfield
North America
USA
Missouri
Springfield
North America
USA
California
Dublin
Europe
Ireland
n/a
Dublin
Similar to the example about Time, you can define three determinants for this data set as follows - two Group By determinants (Country and State/Province) and one unique determinant (City).
Name of the
Determinant
Key
Attributes
Country
Country Key
None
No
Yes
State/Province
No
Yes
City
Country Key
Yes
No
None
State/Province Key
City Key
In this case, we used Country Key, State/Province Key, and City Key to ensure uniqueness for City.
We did this because in the data we were given, some city names were repeated across states or
provinces, which in turn were repeated for countries.
A query subject that behaves as a dimension has multiple levels of granularity and will be joined
on different sets of keys to fact data.
For example, Time has multiple levels, and it is joined to Inventory on the Month Key and to
Sales on the Day Key. For more information, see "Multiple-fact, Multiple-grain Queries" (p. 326).
There is a need to count or perform other aggregate functions on a key or attribute that is
repeated.
For example, Time has a Month Key and an attribute, Days in the month, that is repeated for
each day. If you want to use Days in the month in a report, you do not want the sum of Days
in the month for each day in the month. Instead, you want the unique value of Days in the
month for the chosen Month Key. In SQL, that is XMIN(Days in the month for Month_Key).
There is also a Group by clause in the Cognos SQL.
There are less common cases when you need to use determinants:
You want to uniquely identify the row of data when retrieving text BLOB data from the data
source.
Querying blobs requires additional key or index type information. If this information is not
present in the data source, you can add it using determinants. Override the determinants
imported from the data source that conflict with relationships created for reporting.
A join is specified that uses fewer keys than a unique determinant that is specified for a query
subject.
If your join is built on a subset of the columns that are referenced by the keys of a unique
determinant on the 0..1 or 1..1 side of the relationships, there will be a conflict. Resolve this
conflict by modifying the relationship to fully agree with the determinant or by modifying the
determinant to support the relationship.
You want to override the determinants imported from the data source that conflict with relationships created for reporting.
For example, there are determinants on two query subjects for multiple columns but the relationship between the query subjects uses only a subset of these columns. Modify the determinant
information of the query subject if it is not appropriate to use the additional columns in the
relationship.
Time is the focal point of the granularity issue in this example. Sales is joined to Time on the Day
key, and Product forecast is joined to Time on the Month key. Because of the different join keys,
a minimum of two determinants must be clearly identified on Time. For example, the determinants
for Month and Day have their keys identified. Day is the unique key for Time, Month keys are
repeated for each day in the month.
For example, the determinant for Month is as follows.
The Product query subject could have at least three determinants: Product line, Product type, and
Product. It has relationships to both fact tables on the Product key. There are no granularity issues
with respect to the Product query subject.
By default, a report is aggregated to retrieve records from each fact table at the lowest common
level of granularity. If you create a report that uses Quantity from Sales, Expected volume from
Product forecast, Month from Time, and Product name from Product, the report retrieves records
from each fact table at the lowest common level of granularity. In this example, it is at the month
and product level.
To prevent double-counting when data exists at multiple levels of granularity, create at least two
determinants for the Time query subject. For an example, see "Determinants" (p. 322).
Month
Product name
Quantity
Expected volume
April 2007
Aloe Relief
1,410
1,690
April 2007
132
125
February 2007
Aloe Relief
270
245
February 2007
February 2006
Aloe Relief
1
88
92
If you do not specify the determinants properly in the Time query subject, incorrect aggregation
may occur. For example, Expected volume values that exist at the Month level in Product forecast
is repeated for each day in the Time query subject. If determinants are not set correctly, the values
for Expected volume are multiplied by the number of days in the month.
Month
Product name
Quantity
Expected volume
April 2007
Aloe Relief
1,410
50,700
April 2007
132
3,750
February 2007
Aloe Relief
270
7,134
February 2007
February 2006
Aloe Relief
29
88
2,576
The model query subject starts to function as a view, which overrides the As View or Minimized
setting in the SQL Generation type for a query subject.
This means that the SQL stays the same no matter which items in the query subject are referenced. For more information, see "What Is Minimized SQL?" (p. 330).
When a determinant is created on a model query subject, the determinant is ignored unless a
relationship is also created.
Here is an example of a relationship on a model query subject that purposely overrides the Minimized
SQL setting and simplifies the model. In this example, Order Header and Order Details are combined
so that they behave as a single fact. They are placed in their own folder and all relationships to
To decide where to specify relationships and determinants in the model, you must understand the
impact of minimized SQL to your application.
For more information about relationships, determinants, and minimized SQL, see the Model
Advisor topics in the IBM Cognos Framework Manager User Guide.
If you test the Products model query subject as a whole, you see that four tables are referenced in
the from clause of the query.
If you test only Product name, you see that the resulting query uses only Product Multilingual,
which is the table that was required. This is the effect of minimized SQL.
select
PRODUCT_MULTILINGUAL.PRODUCT_NAME as Product_Name
from
gosl_82..gosl.PRODUCT_MULTILINGUAL PRODUCT_MULTILINGUAL
where
(PRODUCT_MULTILINGUAL."LANGUAGE" - NEN")
The SQL in a data source query subject has been modified. This includes the use of macros.
Note: The generated metadata queries are well supported by most relational database management
system vendors and should not have a noticeable impact on most reporting applications.
The query subject should have a determinant specified for each level of the hierarchy in the
regular dimension.
The determinants should be specified in the same order as the levels in the regular dimension.
If you expect to have multiple hierarchies that aggregate differently, you may need to consider
creating an additional query subject with different determinants as the source for the other
hierarchy.
By creating a complete relational model that delivers correct results and good performance, you
will have a strong foundation for developing a dimensional model. In addition, by ensuring that a
layer of model objects, either query subjects or dimensions, exists between the data source and the
objects exposed to the studios, you are better able to shield your users from change.
alias shortcuts, which behave as if they were a copy of the original object with completely
independent behavior. Alias shortcuts are available only for query subjects and dimensions.
Regular shortcuts are typically used as conformed dimensions with star schema groups, creating
multiple references with the exact same name and appearance in multiple places. In the example
below, the shortcuts created for Products and Order Time behave as references. If a query is written
that brings Products from both Product Forecast and Sales Target, the query uses the definition of
Products based on the original and this definition appears only once in the query.
Alias shortcuts are typically used in role-playing dimensions or shared tables. Because there is
already an example in this document for role-playing dimensions, we will look at the case of shared
tables. In this example, Sales Staff and Sales Branch can be treated as different hierarchies. From
our knowledge of the data, we know that because staff can move between branches, we need to be
able to report orders against Sales Branch and Sales Staff independently as well as together. To
achieve this, we need to create an alias to Sales Branch that can be used as a level in the Sales Staff
hierarchy.
If we run a query to show Revenue, Product cost, and Margin for each product using the Order
details fact, we get the following results:
Product number
Revenue
Product cost
Margin
$23,057,141
$11,292,005
61038%
$11,333,518
$6,607,904
49606%
Notice that the value for Margin seems to be wrong. This is because of the order of operations used
in computing Margin. Margin is computed as:
Margin = sum( (Revenue - Product cost) / Revenue )
The aggregation took place after the mathematical operation and, in this case, it produces undesired
results.
To produce the desired values for Margin, we need to aggregate before the mathematical operation:
Margin = ( sum(Revenue) - sum(Product cost) ) / sum(Revenue)
Product number
Revenue
Product cost
Margin
$23,057.141
$11,292,005
51.03%
$11,333,518
$6,607,904
41.70%
You can accomplish this in IBM Cognos Framework Manager by creating a stand-alone calculation
for Margin and setting its Regular Aggregate property to Calculated. Each query item in the calculation's expression is aggregated as specified in its Regular Aggregate property. The Regular
Aggregate properties for Revenue and Product cost are set to Sum and thus, when computing the
calculation, sum is used to aggregate those terms.
Note: The calculated aggregation type is not supported for calculations that are embedded within
query subjects. It is supported only for stand-alone calculations and for calculations that are
embedded within measure dimensions and are based on measures from the same measure dimension.
User Guide 335
In this example, Margin is based on the measures Product cost and Revenue that are within the
same measure dimension, Sales. If the Regular Aggregate property for Margin is set to Calculated,
it is rolled up as:
Margin = sum(Revenue - Product cost ) / sum(Revenue)
If Margin is based on the source query items of the measures Product cost and Revenue (Sales
(model).Product cost, Sales (model).Revenue), the calculated aggregation is not supported and the
aggregation behaves as automatic. In this case, Margin is rolled up as:
Margin = sum( Revenue - Product cost) / Revenue)
For more information about modifying how query items are aggregated, see the IBM Cognos
Framework Manager User Guide.
Regular Dimensions
Regular dimensions represent descriptive data that provides context for data modeled in measure
dimensions. A regular dimension is broken into groups of information called levels. In turn, the
various levels can be organized into hierarchies. For example, a product dimension can contain the
levels Product Line, Product Type, and Product organized in a single hierarchy called Product.
Another example is a time dimension that has the levels Year, Quarter, Month, Week, and Day,
organized into two hierarchies. The one hierarchy YQMD contains the levels Year, Quarter, Month,
and Day, and the other hierarchy YWD contains the levels Year, Week, and Day.
The simplest definition of a level consists of a business key and a caption, each of these referring
to one query item. An instance (or row) of a level is defined as a member of that level. It is identified
by a member unique name, which contains the values of the business keys of the current and higher
levels. For example, [gosales].[Products].[ProductsOrg].[Product]->[All Products].
of the dimension [Products] that is in the namespace [gosales]. The caption for this product is
TrailChef Canteen, which is the name shown in the metadata tree and on the report.
The level can be defined as unique if the business key of the level is sufficient to identify each set
of data for a level. In the Great Outdoors Sales model, the members of the Product level do not
require the definition of Product type because there are no product numbers assigned to many different product types. A level that is not defined as unique is similar to a determinant that uses
multiple-part keys because keys from higher levels of granularity are required (p. 323). If members
within ancestor members are not unique but the level is defined as unique, data for the non-unique
members is reported as a single member. For example, if City is defined as unique and identified
by name, data for London, England and London, Canada will be combined.
A regular dimension may also have multiple hierarchies; however, you can use only one hierarchy
at a time in a query. For example, you cannot use one hierarchy in the rows of a crosstab report
and another hierarchy from the same dimension in the columns. If you need both hierarchies in the
same report, you must create two dimensions, one for each hierarchy.
Measure Dimensions
Measure dimensions represent the quantitative data described by regular dimensions. Known by
many terms in various OLAP products, a measure dimension is simply the object that contains the
fact data. Measure dimensions differ from fact query subjects because they do not include the foreign
keys used to join a fact query subject to a dimensional query subject. This is because the measure
dimension is not meant to be joined as if it were a relational data object. For query generation
purposes, a measure dimension derives its relationship to a regular dimension through the underlying
query subjects. Similarly the relationship to other measure dimensions is through regular dimensions
that are based on query subjects built to behave as conformed dimensions. To enable multiple-fact,
multiple-grain querying, you must have query subjects and determinants created appropriately
before you build regular dimensions and measure dimensions.
Scope Relationships
Scope relationships exist only between measure dimensions and regular dimensions to define the
level at which the measures are available for reporting. They are not the same as joins and do not
impact the Where clause. There are no conditions or criteria set in a scope relationship to govern
how a query is formed, it specifies only if a dimension can be queried with a specified fact. The
absence of a scope relationship may result in an error at runtime or cause fact data to be rolled up
at a high level than expected given the other items in the report.
If you set the scope relationship for the measure dimension, the same settings apply to all measures
in the measure dimension. If data is reported at a different level for the measures in the measure
dimension, you can set scope on a measure. You can specify the lowest level that the data can be
reported on.
In this example, the Sales Target measure dimension has only one measure that is in scope to the
Order Month level on the Order Time Dimension and to the Product level of the Product Dimension.
This means that if your users try to drill beyond the month level, they will see repeated data.
Import the metadata. For information about importing, see the IBM Cognos Framework
Manager User Guide.
Simplify the relational model using star schema concepts by analyzing cardinality for facts and
dimensions and by deciding where to put relationships and determinants (p. 329).
Add data security, if required. For information about data security, see the Framework Manager
User Guide.
Then you can define the dimensional representation of the model (p. 345) if it is required, and
organize the model for presentation (p. 348).
determinants
Relationships and cardinality are discussed here. For information on the Usage and Regular
Aggregate properties, see the Framework Manager User Guide.
You can use the Model Advisor to highlight relationships that may cause issues for query generation
and resolve them in one of the ways described below. Note that there are other ways to resolve
issues than the ones discussed here. The main goal is to enable clear query paths.
Role-Playing Dimensions
A table with multiple valid relationships between itself and another table is known as a role-playing
dimension. This is most commonly seen in dimensions such as Time and Customer.
For example, the Sales fact has multiple relationships to the Time query subject on the keys Order
Day, Ship Day, and Close Day.
Remove the relationships for the imported objects, fact query subjects, and role-playing dimensional
query subjects. Create a model query subject for each role. Consider excluding unneeded query
items to reduce the length of the metadata tree displayed to your users. Ensure that a single appropriate relationship exists between each model query subject and the fact query subject. Note: This
will override the Minimized SQL setting but given a single table representation of the Time
dimension, it is not considered to be problematic in this case.
Decide how to use these roles with other facts that do not share the same concepts. For example,
Product forecast fact has only one time key. You need to know your data and business to determine
if all or any of the roles created for Time are applicable to Product forecast fact.
In this example, you can do one of the following:
Create an additional query subject to be the conformed time dimension and name it clearly as
a conformed dimension.
Pick the most common role that you will use. You can then ensure that this version is joined
to all facts requiring it. In this example, Close Day has been chosen.
You can treat Ship Day, Order Day, and Close Day as interchangeable time query subjects with
Product forecast fact.
In this case, you must create joins between each of the role-playing dimensions and Product
forecast fact. You can use only one time dimension at a time when querying the Product forecast
fact or your report may contain no data. For example, Month_key=Ship Month Key (200401)
and Month key=Close Month Key (200312).
If modeling dimensionally, use each model query subject as the source for a regular dimension, and
name the dimension and hierarchies appropriately. Ensure that there is a corresponding scope
relationship specific to each role.
Loop Joins
Loop joins in the model are typically a source of unpredictable behavior. This does not include star
schema loop joins.
User Guide 341
Create a model query subject to represent Manager. Create a relationship with a 1..1 to 1..n
between Manager and Sales Staff. Then merge into a new model query subject.
For a simple two-level structure using a model query subject for Manager that is based on Sales
Staff, the model looks like this:
For a recursive, balanced hierarchy, repeat this for each additional level in the hierarchy.
For a deep recursive or unbalanced hierarchy, we recommend that the hierarchy be flattened in the
data source and that you model the flattened hierarchy in one regular dimension.
One way to simplify the model is to create one model query subject for each descriptive business
concept. Your users may not know the relationship between the individual query subjects so it is
helpful to group them together; in addition, having to expand each model object and select a query
item requires more effort.
The next step for analysis is to create a regular dimension with a level for each query subject.
To simplify the model in this example, apply star schema concepts to create one model query subject
that combines the foreign keys of both Order header and Order details and includes all measures
at the Order details level. This query subject should be joined to the same query subjects that Order
header and Order details were joined to. You may choose to remove the original relationships from
the two data source query subjects except for the relationship that defines the join between them.
For a discussion of the pros and cons of creating relationships to model query subjects, see the
examples in "What Is Minimized SQL?" (p. 330).
In the example below, Order header and Order details have been combined into a new model query
subject named Sales. This query subject has been joined to Product, Time, and Order method.
The next step for analysis is to create a measure dimension based on the model query subject.
Then you can organize the model for presentation (p. 348).
You can specify multiple hierarchies on regular dimensions in Framework Manager. Multiple
hierarchies for a regular dimension behave as views of the same query. However, you can use only
one hierarchy at a time in a query. For example, you cannot use one hierarchy in the rows of a
crosstab report and another hierarchy from the same dimension in the columns. If you need both
hierarchies in the same report, you must create two dimensions, one for each hierarchy. In cases
where you have multiple hierarchies with significantly different levels or aggregation, you may
choose to model so that a separate query subject with appropriate determinants exists as the foun-
Use this approach if dramatically different sets of columns are relevant for each hierarchy and it is
more intuitive for your users to model the hierarchies as separate dimensions with separate and
simpler queries.
Keep the metadata from the data source in a separate namespace or folder.
Create one or more optional namespaces or folders for resolving complexities that affect
querying using query subjects.
To use IBM Cognos Analysis Studio, there must be a namespace or folder in the model that
represents the metadata with dimensional objects.
Create one or more namespaces or folders for the augmented business view of the metadata
that contains shortcuts to dimensions or query subjects.
Use business concepts to model the business view. One model can contain many business views,
each suited to a different user group. You publish the business views.
For information about the topics not covered here, see the Framework Manager User Guide.
Using these relationships, how do you write a report that uses only items from Product and Time?
The business question could be which products were forecasted for sale in 2005 or which products
were actually sold in 2005. Although this query involves only Product and Time, these dimensions
are related through multiple facts. There is no way to guess which business question is being asked.
You must set the context for the fact-less query.
In this example, we recommend that you create two namespaces, one containing shortcuts to
Product, Time, and Product forecast, and another containing Product, Time, and Sales.
When you do this for all star schemas, you resolve join ambiguity by placing shortcuts to the fact
and all dimensions in a single namespace. The shortcuts for conformed dimensions in each namespace
are identical and are references to the original object. Note: The exact same rule is applied to regular
dimensions and measure dimensions.
With a namespace for each star schema, it is now clear to your users which items to use. To create
a report on which products were actually sold in 2005, they use Product and Year from the Sales
Namespace. The only relationship that is relevant in this context is the relationship between Product,
Time, and Sales, and it is used to return the data.
Preserve data when fact data does not perfectly align across common dimensions, such as when
there are more rows in the facts than in the dimensions.
Prevent double-counting when fact data exists at different levels of granularity by ensuring that
each fact is represented in a single query with appropriate grouping. Determinants may need
to be created for the underlying query subjects in some cases.
351
When you filter on the month and product, the result is as follows.
Note that this is a simplified representation and not an example of how this would appear in a
model built using IBM Cognos modeling recommendations.
The Result
Individual queries on Sales and Product Forecast by Month and Product yield the following results.
The data in Sales is actually stored at the day level.
A query on Sales and Product Forecast respects the cardinality between each fact table and its
dimensions and writes SQL to return all the rows from each fact table. The fact tables are matched
on their common keys, month and product, and, where possible, are aggregated to the lowest
common level of granularity. In this case, days are rolled up to months. Nulls are often returned
for this type of query because a combination of dimensional elements in one fact table may not
exist in the other.
Note that in February 2004, Course Pro Umbrellas were in the forecast but there were no actual
sales. The data in Sales and Product Forecast exist at different levels of granularity. The data in
Sales is at the day level, and Product Forecast is at the month level.
The SQL
The SQL generated by IBM Cognos software, known as a stitched query, is often misunderstood.
A stitched query uses multiple subqueries, one for each star, brought together by a full outer join
on the common keys. The goal is to preserve all dimensional members occurring on either side of
the query.
The following example was edited for length and is used as an example to capture the main features
of stitched queries.
select
coalesce(D2.MONTH_NAME,D3.MONTH_NAME) as MONTH_NAME,
coalesce(D2.PRODUCT_NAME,D3.PRODUCT_NAME) as PRODUCT_NAME,
D2.EXPECTED_VOLUME as EXPECTED_VOLUME,
D3.QUANTITY as QUANTITY
from (select TIME.MONTH_NAME as MONTH_NAME,
PRODUCT_LOOKUP.PRODUCT_NAME as PRODUCT_NAME,
XSUM(PRODUCT_FORECAST_FACT.EXPECTED_VOLUME for
TIME.CURRENT_YEAR,TIME.QUARTER_KEY,TIME.MONTH_KEY,
PRODUCT.PRODUCT_LINE_CODE, PRODUCT.PRODUCT_TYPE_CODE,
PRODUCT.PRODUCT_KEY) as EXPECTED_VOLUME
from
(select TIME.CURRENT_YEAR as CURRENT_YEAR,
TIME.QUARTER_KEY as QUARTER_KEY,
TIME.MONTH_KEY as MONTH_KEY,
XMIN(TIME.MONTH_NAME for TIME.CURRENT_YEAR,
TIME.QUARTER_KEY,TIME.MONTH_KEY) as MONTH_NAME
from TIME_DIMENSION TIME
group by TIME.MONTH_KEY) TIME
join PRODUCT_FORECAST_FACT PRODUCT_FORECAST_FACT
on (TIME.MONTH_KEY = PRODUCT_FORECAST_FACT.MONTH_KEY)
join PRODUCT PRODUCT on (PRODUCT.PRODUCT_KEY =
PRODUCT_FORECAST_FACT.PRODUCT_KEY)
where
(PRODUCT.PRODUCT_NAME in ('Aloe Relief','Course Pro
Umbrella')) and
(TIME.MONTH_NAME in ('April 2004','February 2004','February
2006'))
group by
TIME.MONTH_NAME,
PRODUCT_LOOKUP.PRODUCT_NAME
) D2
full outer join
(select TIME.MONTH_NAME as MONTH_NAME,
PRODUCT_LOOKUP.PRODUCT_NAME as PRODUCT_NAME,
XSUM(SALES_FACT.QUANTITY for TIME.CURRENT_YEAR,
TIME.QUARTER_KEY, TIME.MONTH_KEY,
PRODUCT.PRODUCT_LINE_CODE, PRODUCT.PRODUCT_TYPE_CODE,
PRODUCT.PRODUCT_KEY ) as QUANTITY
from
If the cardinality were modified to use only 1-1 relationships between query subjects or dimensions,
the result of a query on Product Forecast and Sales with Time or Time and Product generates a
single Select statement that drops one join to prevent a circular reference.
When you combine these queries into a single query, the results are as follows.
The SQL
Because a circular join path was detected in the model, the generated SQL did not include one of
the relationships that was not necessary to complete the join path. In this example, the relationship
between Time and Product Forecast was dropped.
A circular join path rarely results in a query that produces useful results.
select
TIME_.MONTH_NAME as MONTH_NAME,
PRODUCT_LOOKUP.PRODUCT_NAME as PRODUCT_NAME,
XSUM(SALES_FACT.QUANTITY for
TIME_.CURRENT_YEAR, TIME_.QUARTER_KEY, TIME_.MONTH_KEY,
PRODUCT.PRODUCT_LINE_CODE, PRODUCT.PRODUCT_TYPE_CODE,
PRODUCT.PRODUCT_KEY ) as QUANTITY,
XSUM(PRODUCT_FORECAST_FACT.EXPECTED_VOLUME for TIME_.CURRENT_YEAR,
TIME_.QUARTER_KEY, TIME_.MONTH_KEY, PRODUCT.PRODUCT_LINE_CODE,
PRODUCT.PRODUCT_TYPE_CODE, PRODUCT.PRODUCT_KEY ) as EXPECTED_VOLUME
from
(select TIME.DAY_KEY,TIME.MONTH_KEY, TIME.QUARTER_KEY,
TIME.CURRENT_YEAR,TIME.MONTH_EN as MONTH_NAME
from TIME_DIMENSION TIME) TIME
join
SALES_FACT on (TIME_.DAY_KEY = SALES_FACT.ORDER_DAY_KEY)
join
PRODUCT_FORECAST_FACT on (TIME_.MONTH_KEY =
PRODUCT_FORECAST_FACT.MONTH_KEY)
join
PRODUCT (PRODUCT.PRODUCT_KEY = PRODUCT_FORECAST_FACT.PRODUCT_KEY)
where
(PRODUCT.PRODUCT_NAME in ('Aloe Relief','Course Pro Umbrella'))
and
(TIME_.MONTH_NAME in ('April 2004','February 2004','February 2006'))
The Result
The results of individual queries on the respective star schemas look like this.
Querying the same items from both star schemas yields the following result.
In this result, the lower level of granularity for records from Sales results in more records being
returned for each month and product combination. There is now a 1-n relationship between the
rows returned from Product Forecast and those returned from Sales.
When you compare this to the result returned in the example of the multiple-fact, multiple grain
query on conformed dimensions, you can see that more records are returned and that Expected
Volume results are repeated across multiple Order Methods. Adding Order Method to the query
effectively changes the relationship between Quantity data and Expected Volume data to a 1-n
relationship. It is no longer possible to relate a single value from Expected Volume to one value
from Quantity.
Grouping on the Month key demonstrates that the result in this example is based on the same data
set as the result in the multiple-fact, multiple-grain query but with a greater degree of granularity.
The SQL
The stitched SQL generated for this example is very similar to the SQL generated in the multiplefact, multiple-grain query (p. 352). The main difference is the addition of Order Method. Order
Method is not a conformed dimension and affects only the query against the Sales Fact table.
358 IBM Cognos Framework Manager
In this example, both Product type and Product could be identified as being ambiguously defined.
However, this ambiguity is not detrimental to either the results generated or the performance of
any query using one or more of these query subjects. You do not need to fix this query pattern
because, using the rules for fact detection, only one fact is identified in any query that combines an
Items from these query subjects are used Query subject that behaves as a fact in the
in a query:
query:
Product line and Product type
Product type
Product
Sales
Product forecast
Test this model by authoring a report on the number of orders per city, per country. Using this
model returns an incorrect result. The numbers are correct for the cities but some cities are shown
as being in the wrong country. This is an example of an incorrectly related result.
Usually the first place to look when you see something like this is in the SQL.
The SQL
In this example, we see a stitched query, which makes sense if we have multiple facts in the model.
A stitched query is essentially a query that attempts to stitch multiple facts together. It uses the
relationships that relate the facts to each other as well as the determinants for the conformed, or
common, dimensions defined in the model. A stitched query can be identified by two queries with
a full outer join. The wrapper query must include a coalesce statement on the conformed dimensions.
Note the following problems in the SQL:
select
D3.COUNTRY as COUNTRY,
D2.CITY as CITY,
D2.number_of_orders as number_of_orders
from
(select
SALES_BRANCH.CITY as CITY,
XCOUNT(ORDER_HEADER.ORDER_NUMBER for SALES_BRANCH.CITY) as
number_of_orders,
RSUM(1 at SALES_BRANCH.CITY order by SALES_BRANCH.CITY
asc local)
as sc
from
gosales.gosales.dbo.SALES_BRANCH SALES_BRANCH
join
gosales.gosales.dbo.ORDER_HEADER ORDER_HEADER
on (SALES_BRANCH.SALES_BRANCH_CODE = ORDER_HEADER.SALES_BRANCH_CODE)
group by
SALES_BRANCH.CITY
order by
CITY asc
) D2
full outer join
(select
COUNTRY_MULTILINGUAL.COUNTRY as COUNTRY,
RSUM(1 at COUNTRY_MULTILINGUAL.COUNTRY order by
COUNTRY_MULTILINGUAL.COUNTRY asc local) as sc
from
gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL
group by
COUNTRY_MULTILINGUAL.COUNTRY
order by
COUNTRY asc
) D3
on (D2.sc = D3.sc)
The problem is that the query splits because the query engine sees this as a multiple-fact query.
However, the split does not have a valid key on which to stitch because there is no item that both
facts have in common.
There is more than one way to solve this problem but both require understanding the data.
Solution 1
You can add a filter to Country Multilingual that changes the cardinality of the relationship to 1-1.
Select *
from [GOSL].COUNTRY_MULTILINGUAL
Where
COUNTRY_MULTILINGUAL."LANGUAGE"=EN
Or you can add a filter on the relationship and change the cardinality to 1-1.
COUNTRY.COUNTRY_CODE = COUNTRY_MULTILINGUAL.COUNTRY_CODE
and COUNTRY_MULTILINGUAL.LANGUAGE = EN
Either choice results in a model that has a single fact in this query.
Solution 2
Simplify the model by consolidating the related query subjects. This gives the greatest benefit by
simplifying the model and reducing the opportunities for error in query generation.
To find the most current product documentation, including all translated documentation, access
one of the IBM Cognos Information Centers at http://publib.boulder.ibm.com/infocenter/cogic/
v1r0m0/index.jsp.
Understand the impact of the governors that are set during the upgrade (p. 366).
Understand the impact of the upgrade on query subjects based on SAP BW metadata (p. 367).
365
The Allow enhanced model portability at run time governor (p. 309) is selected.
This governor is used when upgrading a ReportNet 1.x model. It prevents rigid enforcement
of data types so that an IBM Cognos BI model can function as a ReportNet 1.x model until
you update the data types in the metadata. After verifying that the model is upgraded successfully,
clear this governor.
The status property of all data source query subjects is set to Needs Re-evaluation. The query
engine ignores the data types in the model that are flagged as Needs Re-evaluation and retrieves
the data type information from the data source. This may have a slightly negative impact on
performance when running reports.
The Allow dynamic generation of dimension information governor (p. 310) is selected.
This governor ensures consistent behavior with ReportNet by deriving a form of dimension
information from the relationships, key information, and index information in the data source.
When this governor is selected and a model contains query subjects but no dimensions, IBM
Cognos BI generates queries that avoid double-counting. This also provides compatibility with
ReportNet. When you verify the model, a warning displays when this governor is selected.
The Suppress Null values for SAP BW data sources governor (p. 310) is selected for SAP BW
metadata only.
This governor controls the creation of outer joins in models based on SAP BW metadata.
Some queries can be very large because null values are not filtered out. Null suppression removes
a row or column for which all of the values in the row or column are null (empty).
SAP BW performs null suppression. This reduces the amount of data transferred to the IBM
Cognos studios and improves performance.
ReportNet
IBM Cognos BI
char
nChar
decimal
numeric
varChar
nVarChar
varChar
timestampTZ
varChar
IntervalTZ
Data types are stored in the model so that IBM Cognos BI can avoid accessing the data source every
time it needs to determine the data types for query items. This results in improved performance.
Some query items, mostly calculations, may appear broken after the upgrade. This may happen
under the following circumstances:
The data type of the underlying items for a calculation was changed and it is not possible to
automatically assign the data type to the calculation.
You must test the affected calculations and correct the issues.
Open an existing model, and upgrade and publish it without any changes in query functionality.
Continue to design the production model, publish it without the dimensional information, and
gradually move to dimensions and determinants.
Convert query subjects with dimension information to either query subjects with determinants
or to dimensions (p. 368).
If you make changes to the model before verifying it, do not change the determinants. Doing so
may result in losing the dimension information, and will not let you verify the model later.
Determinants
Use determinants to preserve existing reports while extending your application.
Determinants reflect granularity by representing subsets or groups of data in a query subject.
They ensure correct aggregation of this repeated data. Determinants are imported based on
unique key and index information in the data source.
Unlike the dimension information, model query subjects inherit determinants that are specified
for the underlying query subjects. Specify the determinants as early as possible in the model,
typically on the data source query subject. In cases where you specify different determinants
for different granularity control, either create multiple instances of the data source query subject
or remove determinants from the data source query subject. Then create new determinants on
each model query subject that requires different granularity control.
Dimensions
Use dimensions if you use your model in Analysis Studio, enable drilling up and down in reports,
or access member functions in the studios. Only regular dimensions are created. During the
upgrade, sufficient metadata does not exist to create measure dimensions so you must create
them manually. You can then relate the dimensions to the measures by setting scope in the
model.
If you upgrade query subjects to dimensions, the names of the query items in your model are
changed. For example, a query item previously qualified as namespace.query subject.query item
now is qualified as namespace.dimension.hierarchy.level.query item. Because this name change
may make existing reports invalid, upgrade query subjects to dimensions only when you want
to leverage an existing model to build a new application that requires dimensional capability.
Dimensions
Hierarchies
Hierarchies
Dimensions
Keys
_businessKey role
_memberCaption role
Attributes
Uniquely Identified
When you define a unique determinant, you are indicating that the key contains enough information to identify a group within the data.
Group By
You should specify Group By when you define a non-unique determinant. This indicates to
IBM Cognos BI that, when the keys or attributes associated with that determinant are repeated
in the data, it should apply aggregate functions and grouping to avoid double-counting.
_businessKey role
This role represents the key for the level and can be assigned to only one attribute in a level.
Unique Level
A unique level indicates that the keys of the levels above are not necessary to identify the
members in this level.
_memberCaption role
To leverage member functions in the IBM Cognos studios, you must assign a _memberCaption
role to each level in a dimension. If there are no attributes for the level, the absence of a caption
is highlighted when you verify the model.
All captions must have the string data type. If there is no attribute of this type available, create
a calculation that is a string data type and assign the _memberCaption role to the new item.
This is primarily an issue for Analysis Studio.
Attributes
In general, include attributes in the dimension and associate them with the correct level. By
default, they are included with no role. You can create custom roles or assign attributes to
existing roles.
Multiple Hierarchies
A regular dimension may have multiple hierarchies; however, you can use only one hierarchy
at a time in a query. For example, you cannot use one hierarchy in the rows of a crosstab report
and another hierarchy from the same dimension in the columns. If you need both hierarchies
in the same report, you must create two dimensions, one for each hierarchy.
Selecting and repairing objects in the upgraded IBM Cognos ReportNet model
The repair process first evaluates all selected items. This evaluation automatically resolves issues
with new data types, and prompts you to repair dimension information in the model.
The following warnings may appear when you verify and repair an upgraded model:
Warning
Description
Needs reevaluation
Warning
Description
Join expression conflicts with the Sometimes the index and key information that is specified
determinant information defined for a query subject implies a level of granularity that does
in the query subject
not match the relationships that are specified on a query
subject.
None of the query items in this
When defining levels, ensure that a business key and caption
level have a caption role specified roles are specified. These roles are needed for member functions in the IBM Cognos studios and to assist in the memberoriented tree in Analysis Studio.
All captions must have the string data type. If there is no
attribute of this type available, create a calculation that is a
string data type and assign the member caption role to the
new item. This is primarily an issue for Analysis Studio.
One or more determinants that
describe the keys and attributes of
the query subject should be specified
Steps
1. Open each segment as a separate project, starting with the lowest level segment in the hierarchy.
2. Follow the steps to upgrade the model(p. 365).
Appendix A: Troubleshooting
You may encounter problems when working in Framework Manager. For other troubleshooting
topics, see the IBM Cognos Administration and Security Guide.
375
Appendix A: Troubleshooting
If you are not using a Web server, to use the dispatcher as the gateway, type the following:
http[s]://host:port/p2pd/servlet/dispatch
4. If required, change the host name portion of the Gateway URI from localhost to either the IP
address of the computer or the computer name.
5. From the File menu, click Save.
6. From the Actions menu, click Restart.
Appendix A: Troubleshooting
The reason is that the GRAPHIC and VARGRAPHIC data types are not supported.
When you define a type-in SQL query subject, an error appears because of the name assigned for
the attribute reference in the structured type.
To resolve this problem, you have two options:
assign a simple correlation name to the column in the original query subject, such as Select
e.emp_no, e.emp_address..street as "ABC" from emp e
use pass-through notation for the query subject by surrounding the column with double curly
brackets ({{ }})
QE-DEF-0259 Error
This error occurs if you use braces { } in the wrong position in an expression. IBM Cognos BI
expects anything between the braces { } to be at the same level as a function. If you have used braces
elsewhere in an expression, you will see the following error message:
QE-DEF-0259 There was a parsing error
You can also use braces to send unique syntax to the data source. For example, your database uses
a keyword for a function, but this keyword is not used in IBM Cognos BI.
IBM Cognos BI does not validate the syntax you enter between braces. The syntax is simply sent
to the data source.
The solution is to make sure that braces are not used in the wrong positions.
For example, you type the following in an expression:
[ss_ole_both].[authors_lith].[au_id] = [ss_ole_both].[authors_latin].[au_id]
{ collate Lithuanian_CI_AI}
Appendix A: Troubleshooting
Do not test the key figures dimension before you externalize it.
Close the model, open it again, and externalize the key figures dimension.
Steps
1. From the Project menu, click Verify Model.
2. Select the security view that references a level and click Repair.
Change the system default language on your computer to Japanese. You can set the system
default language in the Control Panel, under Regional and Language Options -> Advanced.
For more information on how to do this, refer to the Windows operating system help.
Appendix A: Troubleshooting
You can control the SQL syntax used for inner joins by configuring the setting for the SQL Join
Syntax governor. The SQL join syntax generated in all versions of IBM Cognos BI produces the
same result.
If you are using RDBMS materialization technology which can be implemented using either implicit
or explicit syntax, you must ensure that you select the same syntax setting for the SQL Join Syntax
governor in your model.
ensure that you have the required patch sets, which include the fix for bug#2874433
Because any manual edits to the ini settings are overwritten by the next installation, you must
manually replicate them on all machines where you installed IBM Cognos BI or Framework Manager.
You run regression tests and find differences in numbers. They are different only because of
the rounding off of decimal places.
You choose not display zeros in reports, but the zeros are displayed anyway because there are
decimal places (0.00000000000000426, for example) that are rounded off to zero in reports.
Round-off problems are not specific to IBM Cognos software. They can occur in any environment
where rounding off occurs.
Appendix A: Troubleshooting
Avoid storing data in floating point format whenever possible. This is especially true for currency
values, which should be stored as either fixed-point decimals or as integers with a scale value
such as 2.
For example, in a cube, the Revenue for Camping Equipment in 2004 is $20,471,328.88. If
revenue details are stored as floating point numbers, round-off errors might occur when revenue
is calculated.
The round up errors might have slight differences, depending on the order of calculation. If
revenue for Products is calculated first and revenue for Time is calculated second, you might
get a different round-off error than if Time is calculated first and Products is calculated second.
Total revenue might be calculated as the number above. Or there might be slight discrepancies,
for example, $20,471,328.8800001 as opposed to $20,471,328.88. The internal number might
be slightly different than what is displayed. The number might even be for different runs of the
same report, depending on the order that the OLAP engine uses for calculation.
In reports, avoid division whenever possible. When division is unavoidable, try to do it as late
as possible in the calculation process. For example, instead of Total([Revenue]/1000), use Total
([Revenue])/1000.
When doing comparisons, add a margin to allow for round-off. For example, you may want
[Profit %] to be a fractional value formatted as a percentage with no decimals. However, the
filter [Profit %]<>0 (or [Profit %] NOT BETWEEN 0 and 0) rejects zero values and may still
return values that appear to be 0% after formatting.
To avoid this, filter in one of these two ways:
Note that 0.005 is equivalent to 0.5%, which displays as either 0% or 1%, depending on
floating point precision losses.
In come cases, you may prefer control round-off errors by rounding values explicitly. For
example, instead of [Profit %], use round([Profit %],2).
Recalculate numbers every time instead of reusing calculations that might contain rounded off
decimals.
There might be additional considerations for Microsoft Analysis Services 2005/2008, especially
when comparing report results from different runs (as happens in Lifecycle Manager). Refer to
Microsoft documentation for more information.
SAP BW Support
SAP BW does not support all operators or summaries. This can be confusing if you have imported
SAP BW metadata and non-SAP BW metadata into the same model.
SAP BW does not support the following operators:
like
lookup
381
date-time
interval
interval month
interval day
interval hour
interval minute
interval second
interval year
moving
running
Cell values are date, number, or time. Attribute values are strings.
Calculation Components
You build calculations, or expressions, in the expression editor using the following components:
Operators
Operators specify what happens to the values on either side of the operator. Operators are similar
to functions, in that they manipulate data items and return a result.
(
Identifies the beginning of an expression.
User Guide 383
Syntax
( expression )
)
Identifies the end of an expression.
Syntax
( expression )
*
Multiplies two numeric values.
Syntax
value1 * value2
,
Separates expression components.
Syntax
expression ( parameter1, parameter2 )
/
Divides two numeric values.
Syntax
value1 / value2
||
Concatenates, or joins, strings.
Syntax
string1 || string2
+
Adds two numeric values.
Syntax
value1 + value2
Syntax
value1 - value2
or
- value
<
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are less than "value2".
Syntax
value1 < value2
<=
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are less than or equal to "value2".
Syntax
value1 <= value2
<>
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are not equal to "value2".
Syntax
value1 <> value2
=
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are equal to "value2".
Syntax
value1 = value2
>
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are greater than "value2".
Syntax
value1 > value2
->
Separates the components in a literal member expression.
Syntax
[namespace].[dimension].[hierarchy].[level]->[L1]
>=
Compares the values that are represented by "value1" against "value2" and retrieves the values
that are greater than or equal to "value2".
Syntax
value1 >= value2
and
Returns "true" if the conditions on both sides of the expression are true.
Syntax
argument1 and argument2
auto
Works with summary expressions to define the scope to be adjusted based on the grouping columns
in the query. The scope is context-dependent.
Syntax
aggregate_function ( expression AUTO )
between
Determines if a value falls in a given range.
Syntax
expression between value1 and value2
Example
[Revenue] between 200,000 and 300,000
Result: Returns the number of results with revenues between 200,000 and 300,000.
Revenue
Between
----
----
$332,986,338.06
false
$230,110,270.55
true
$107,099,659.94
false
case
Works with when, then, else, and end. Case identifies the beginning of a specific situation, in which
when, then, and else actions are defined.
Syntax
case expression { when expression then expression } [ else expression ] end
contains
Determines if "string1" contains "string2".
Syntax
string1 contains string2
currentMeasure
Keyword that can be used as the first argument of member summary functions. This function
appears in the Total Revenue by Country sample report in the GO Data Warehouse (query) package.
Syntax
aggregate_function ( currentMeasure within set expression )
default
Works with the lookup construct.
Syntax
lookup (....) in (....) default (....)
distinct
A keyword used in an aggregate expression to include only distinct occurrences of values. See also
the function unique.
Syntax
distinct dataItem
Example
count ( distinct [OrderDetailQuantity] )
Result: 1704
else
Works with the if or case constructs. If the if condition or the case expression are not true, then the
else expression is used. This function appears in the Top 10 Retailers for 2005 sample report in the
GO Data Warehouse (analysis) package.
Syntax
if ( condition ) then .... else ( expression ) , or case .... else ( expression )
end
end
Indicates the end of a case or when construct.
Syntax
case .... end
ends with
Determines if "string1" ends with "string2".
Syntax
string1 ends with string2
for
Works with summary expressions to define the scope of the aggregation in the query.
Syntax
aggregate_function ( expression for expression { , expression } )
for all
Works with summary expressions to define the scope to be all the specified grouping columns in
the query. See also the for clause.
Syntax
aggregate_function ( expression for ALL expression { , expression } )
for any
Works with summary expressions to define the scope to be adjusted based on a subset of the
grouping columns in the query. Equivalent to the for clause.
Syntax
aggregate_function ( expression for ANY expression { , expression } )
for report
Works with summary expressions to set the scope to be the whole query. See also the for clause.
This function appears in the Customer Returns and Satisfaction sample report in the GO Data
Warehouse (analysis) package.
Syntax
aggregate_function ( expression for report )
if
Works with the then and else constructs. If defines a condition; when the if condition is true, the
then expression is used. When the if condition is not true, the else expression is used. This function
appears in the Top 10 Retailers for 2005 sample report in the GO Data Warehouse (analysis)
package.
Syntax
if ( condition ) then ( expression ) else ( expression )
in
Determines if "expression1" exists in a given list of expressions.
Syntax
expression1 in ( expression_list )
in_range
Determines if "expression1" exists in a given list of constant values or ranges.
Syntax
expression1 in_range { constant : constant [ , constant : constant ] }
Example 1
[code] in_range { 5 }
Example 2
[code] in_range { 5: }
Example 3
[code] in_range { :5 }
Example 4
[code] in_range { 5:10 }
Example 5
[code] in_range { :5,10,20: }
is missing
Determines if "value" is undefined in the data.
Syntax
value is missing
is null
Determines if "value" is undefined in the data.
Syntax
value is null
is not missing
Determines if "value" is defined in the data.
Syntax
value is not missing
is not null
Determines if "value" is defined in the data.
Syntax
value is not null
like
Determines if "string1" matches the pattern of "string2".
Syntax
string1 LIKE string2
lookup
Finds and replaces data with a value you specify. It is preferable to use the case construct.
Syntax
lookup ( name ) in ( value1 --> value2 ) default ( expression )
Example
lookup ( [Country]) in ( 'Canada'--> ( [List Price] * 0.60), 'Australia'-->
( [List Price] * 0.80 ) ) default ( [List Price] )
not
Returns TRUE if "argument" is false or returns FALSE if "argument" is true.
Syntax
NOT argument
or
Returns TRUE if either of "argument1" or "argument2" are true.
Syntax
argument1 or argument2
prefilter
Performs a summary calculation before applying the summary filter.
Syntax
summary ([expression] prefilter)
rows
Counts the number of rows output by the query. Use with Count ().
Syntax
count ( ROWS )
starts with
Determines if "string1" starts with "string2".
Syntax
string1 starts with string2
then
Works with the if or case constructs. When the if condition or the when expression are true, the
then expression is used. This function appears in the Top 10 Retailers for 2005 sample report in
the GO Data Warehouse (analysis) package.
Syntax
if ( condition ) then ..., or case expression when expression then .... end
when
Works with the case construct. You can define conditions to occur when the when expression is
true.
Syntax
case [expression] when ... end
Summaries
This list contains predefined functions that return either a single summary value for a group of
related values or a different summary value for each instance of a group of related values.
aggregate
Returns a calculated value using the appropriate aggregation function, based on the aggregation
type of the expression. This function appears in the Budget vs. Actual sample report in the GO Data
Warehouse (analysis) package.
Syntax
aggregate ( expression [ auto ] )
aggregate ( expression for [ all|any ] expression { , expression } )
aggregate ( expression for report )
average
Returns the average value of selected data items. Distinct is an alternative expression that is compatible with earlier versions of the product.
Syntax
average ( [ distinct ] expression [ auto ] )
average ( [ distinct ] expression for [ all|any ] expression { , expression } )
average ( [ distinct ] expression for report )
Example
average ( Sales )
count
Returns the number of selected data items excluding null values. Distinct is an alternative expression
that is compatible with earlier versions of the product.
Syntax
count ( [ distinct ] expression [ auto ] )
count ( [ distinct ] expression for [ all|any ] expression { , expression } )
count ( [ distinct ] expression for report )
Example
count ( Sales )
maximum
Returns the maximum value of selected data items. Distinct is an alternative expression that is
compatible with earlier versions of the product.
Syntax
maximum ( [ distinct ] expression [ auto ] )
maximum ( [ distinct ] expression for [ all|any ] expression { , expression } )
maximum ( [ distinct ] expression for report )
Example
maximum ( Sales )
median
Returns the median value of selected data items.
Syntax
median ( expression [ auto ] )
median ( expression for [ all|any ] expression { , expression } )
median ( expression for report )
minimum
Returns the minimum value of selected data items. Distinct is an alternative expression that is
compatible with earlier versions of the product.
Syntax
minimum ( [ distinct ] expression [ auto ] )
minimum ( [ distinct ] expression for [ all|any ] expression { , expression } )
minimum ( [ distinct ] expression for report )
Example
minimum ( Sales )
moving-average
Returns a moving average by row for a specified set of values of over a specified number of rows.
The "<for-option>" defines the scope of the function. The "at" option defines the level of aggregation
and can be used only in the context of relational datasources.
Syntax
moving-average ( numeric_expression , numeric_expression [ at expression
{ , expression } ] [ <for-option> ] [ prefilter ] )
moving-average ( numeric_expression , numeric_expression [ <for-option> ]
[ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
moving-average ( Qty , 3 )
Result: For each row, returns the quantity and a moving average of the current row and the preceding
two rows.
Qty
Moving-Average (Qty, 3)
------
------------------------------------
200
200
700
450
400
433.3333
200
433.3333
200
266.6667
500
300.0000
moving-total
Returns a moving total by row for a specified set of values over a specified number of rows. The
"<for-option>" defines the scope of the function. The "at" option defines the level of aggregation
and can be used only in the context of relational datasources.
Syntax
moving-total ( numeric_expression , numeric_expression [ at expression
{ , expression } ] [ <for-option> ] [ prefilter ] )
moving-total ( numeric_expression , numeric_expression [ <for-option> ]
[ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
moving-total ( Qty , 3 )
Result: For each row, returns the quantity and a moving total of the current row and the preceding
two rows.
Qty
Moving-Total (Qty, 3)
------
--------------------------------
200
200
700
900
400
1300
200
1300
200
800
500
900
percentage
Returns the percent of the total value for selected data items. The "<for-option>" defines the scope
of the function. The "at" option defines the level of aggregation and can be used only in the context
of relational datasources. This function appears in the Percentage Calculation (by year) interactive
sample report.
Syntax
percentage ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
percentage ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
percentage ( Sales 98 )
Result: Returns the percentage of the total sales for 1998 that is attributed to each sales representative.
Sales Rep
Sales 98
---------- ---------
Percentage
-------------
Gibbons
60646
7.11%
Flertjan
62523
7.35%
Cornel
22396
2.63%
percentile
Returns a value, on a scale of one hundred, that indicates the percent of a distribution that is equal
to or below the selected data items. The "<for-option>" defines the scope of the function. The "at"
option defines the level of aggregation and can be used only in the context of relational datasources.
Syntax
percentile ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
percentile ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
percentile ( Sales 98 )
Result: For each row, returns the percentage of rows that are equal to or less than the quantity
value of that row.
Qty
Percentile (Qty)
------
-----------------
800
700
0.875
600
0.75
500
0.625
400
0.5
400
0.5
200
0.25
200
0.25
quantile
Returns the rank of a value within a range that you specify. It returns integers to represent any
range of ranks, such as 1 (highest) to 100 (lowest). The "<for-option>" defines the scope of the
function. The "at" option defines the level of aggregation and can be used only in the context of
relational datasources.
Syntax
quantile ( numeric_expression , numeric_expression [ at expression
{ , expression } ] [ <for-option> ] [ prefilter ] )
quantile ( numeric_expression , numeric_expression [ <for-option> ]
[ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
quantile ( Qty , 4 )
Result: Returns the quantity, the rank of the quantity value, and the quantity values broken down
into 4 quantile groups (quartiles).
Qty
------
---------
---------------
800
700
600
500
400
400
200
200
quartile
Returns the rank of a value, represented as integers from 1 (highest) to 4 (lowest), relative to a
group of values. The "<for-option>" defines the scope of the function. The "at" option defines the
level of aggregation and can be used only in the context of relational datasources.
Syntax
quartile ( numeric_expression [ at expression { , expression } ] [ <for-option> ]
[ prefilter ] )
quartile ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
quartile ( Qty )
Result: Returns the quantity and the quartile of the quantity value represented as integers from 1
(highest) to 4 (lowest).
Qty
Quartile (Qty)
------
---------------------
450
400
350
300
250
200
150
100
rank
Returns the rank value of selected data items. The sort order is optional; descending order (DESC)
is assumed by default. If two or more rows tie, then there is a gap in the sequence of ranked values
Syntax
rank ( expression [ ASC|DESC ] { , expression [ ASC|DESC ] } [ at expression
{ , expression } ] [ <for-option> ] [ prefilter ] )
rank ( [ distinct ] expression [ ASC|DESC ] { , expression [ ASC|DESC ] }
[ <for-option>] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
rank ( Sales 98 )
Result: For each row, returns the rank value of sales for 1998 that is attributed to each sales representative. Some numbers are skipped when a tie between rows occurs.
Sales Rep
Sales 98
Rank
---------
---------
------------
Gibbons
60000
Flertjan
50000
Cornel
50000
Smith
48000
running-average
Returns the running average by row (including the current row) for a set of values. The "<foroption>" defines the scope of the function. The "at" option defines the level of aggregation and
can be used only in the context of relational datasources.
Syntax
running-average ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
running-average ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-average ( Qty )
Result: For each row, returns the quantity and a running average of the current and the previous
rows.
Name
Qty
Avg
-------
------
------
-----------------------
Smith
Smith
Smith
5.33
Smith
Wong
Wong
running-count
Returns the running count by row (including the current row) for a set of values. The "<for-option>"
defines the scope of the function. The "at" option defines the level of aggregation and can be used
only in the context of relational datasources.
Syntax
running-count ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
running-count ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-count ( Qty )
Result: For each row, returns the quantity and a running count of the position of the current row.
Name
Qty
Count
-------
------
---------
------------------------
Smith
Smith
Smith
Smith
Wong
Wong
running-difference
Returns a running difference by row, calculated as the difference between the value for the current
row and the preceding row, (including the current row) for a set of values. The "<for-option>"
defines the scope of the function. The "at" option defines the level of aggregation and can be used
only in the context of relational datasources.
Syntax
running-difference ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
Example
running-difference ( Qty )
Result: For each row, returns the quantity and a running difference between the value for the current
row and the preceding row.
Name
Qty
-------
------
---------------------------
Smith
NULL
Smith
-4
Smith
Smith
-2
Wong
-1
Wong
running-maximum
Returns the running maximum by row (including the current row) for a set of values. The "<foroption>" defines the scope of the function. The "at" option defines the level of aggregation and
can be used only in the context of relational datasources.
Syntax
running-maximum ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
running-maximum ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-maximum ( Qty )
Result: For each row, returns the quantity and a running maximum of the current and previous
rows.
Name
Qty
Max
-------
------
------
-------------------------
Smith
Smith
Smith
Smith
Wong
Wong
running-minimum
Returns the running minimum by row (including the current row) for a set of values. The "<foroption>" defines the scope of the function. The "at" option defines the level of aggregation and
can be used only in the context of relational datasources.
Syntax
running-minimum ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
running-minimum ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-minimum ( Qty )
Result: For each row, returns the quantity and a running minimum of the current and previous
rows.
Name
Qty
Min
-------
-----
------
--------------------------
Smith
Smith
Smith
Smith
Wong
Wong
running-total
Returns a running total by row (including the current row) for a set of values. The "<for-option>"
defines the scope of the function. The "at" option defines the level of aggregation and can be used
only in the context of relational datasources.
Syntax
running-total ( numeric_expression [ at expression { , expression } ]
[ <for-option> ] [ prefilter ] )
running-total ( numeric_expression [ <for-option> ] [ prefilter ] )
<for-option> ::= for expression { , expression }|for report|auto
Example
running-total ( Qty )
Result: For each row, returns the quantity and a running total of the current and previous rows.
Name
Qty
Total
-------
------
--------
-------------------------
Smith
18
Smith
18
Smith
18
11
Smith
18
18
Wong
12
Wong
12
standard-deviation
Returns the standard deviation of selected data items.
Syntax
standard-deviation (
standard-deviation (
standard-deviation (
expression [ auto ] )
expression for [ all|any ] expression { , expression } )
expression for report )
Example
standard-deviation ( ProductCost )
Result: Returns a value indicating the deviation between product costs and the average product
cost.
standard-deviation-pop
Computes the population standard deviation and returns the square root of the population variance.
Syntax
standard-deviation-pop (
standard-deviation-pop (
{ , expression } )
standard-deviation-pop (
expression [ auto ] )
expression for [ all|any ] expression
expression for report )
Example
standard-deviation-pop ( ProductCost )
total
Returns the total value of selected data items. Distinct is an alternative expression that is compatible
with earlier versions of the product. This function appears in the Budget vs. Actual sample report
in the GO Data Warehouse (analysis) package.
Syntax
total ( [ distinct ] expression [ auto ] )
total ( [ distinct ] expression for [ all|any ] expression { , expression } )
total ( [ distinct ] expression for report )
Example
total ( Sales )
variance
Returns the variance of selected data items.
Syntax
variance (
variance (
variance (
expression [ auto ] )
expression for [ all|any ] expression { , expression } )
expression for report )
Example
variance ( Product Cost )
Result: Returns a value indicating how widely product costs vary from the average product cost.
variance-pop
Returns the population variance of a set of numbers after discarding the nulls in this set.
Syntax
variance-pop (
variance-pop (
variance-pop (
expression [ auto ] )
expression for [ all|any ] expression { , expression } )
expression for report )
Example
variance-pop ( Qty )
Result: For each row, returns the population variance of a set of numbers after discarding the nulls
in this set.
Member Summaries
This list contains predefined functions that return either a single summary value for a set of members
or a different summary value for each member of a set of members.
aggregate
Returns a calculated value using the appropriate aggregation function based on the aggregation
type of the expression.
Syntax
aggregate ( < currentMeasure|numeric_expression > within set set_expression )
aggregate ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
average
Returns the average value of the selected data items.
Syntax
average ( < currentMeasure|numeric_expression > within set set_expression )
average ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
Example
average ( Sales )
count
Returns the number of selected data items excluding null values.
Syntax
count ( < currentMeasure|numeric_expression > within set set_expression )
count ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
Example
count ( Sales )
maximum
Returns the maximum value of selected data items.
Syntax
maximum ( < currentMeasure|numeric_expression > within set set_expression )
maximum ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
Example
maximum ( Sales )
median
Returns the median value of selected data items.
Syntax
median ( < currentMeasure|numeric_expression > within set set_expression )
median ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
minimum
Returns the minimum value of selected data items.
Syntax
minimum ( < currentMeasure|numeric_expression > within set set_expression )
minimum ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
Example
minimum ( Sales )
percentage
Returns the percent of the total value for the selected data items.
Syntax
percentage ( numeric_expression [ tuple member_expression { , member_
expression } ] within set set_expression )
Example
percentage ( [gosales].[sales measures].[quantity] tuple [gosales].[Staff].[].
[department] -> [West] within set children ( [gosales].[Staff].[].[Staff] ) )
percentile
Returns a value, on a scale from 0 to 100, that indicates the percent of a distribution that is equal
to or below the selected data items.
Syntax
percentile ( numeric_expression [ tuple member_expression { , member_
expression } ] within set set_expression )
quantile
Returns the rank of a value for the specified range. It returns integers to represent any range of
ranks, such as 1 (highest) to 100 (lowest).
Syntax
quantile ( numeric_expression , numeric_expression [ tuple member_expression
{ , member_expression } ] within set set_expression )
quartile
Returns the rank of a value, represented as integers from 1 (highest) to 4 (lowest), relative to a
group of values.
Syntax
quartile ( numeric_expression [ tuple member_expression { , member_expression } ]
within set set_expression )
rank
Returns the rank value of the selected data items. The type of ranking returned (Olympic, dense,
or serial) is data source dependent. The sort order is optional; DESC is assumed by default.
Syntax
rank ( numeric_expression [ ASC|DESC ] [ tuple member_expression { , member_
expression } ] within set set_expression )
Example
rank ( [gosales].[sales measures].[quantity] tuple [gosales].[Staff].[].
[department] -> [West] within set children ( [gosales].[Staff].[].[Staff] ) )
standard-deviation
Returns the standard deviation of the selected data items.
Syntax
standard-deviation ( < currentMeasure|numeric_expression > within set
set_expression )
standard-deviation ( < currentMeasure|numeric_expression > within <
detail|aggregate > expression )
standard-deviation-pop
Returns the standard deviation population of the selected data items.
Syntax
standard-deviation-pop ( < currentMeasure|numeric_expression > within set
set_expression )
standard-deviation-pop ( < currentMeasure|numeric_expression > within <
detail|aggregate > expression )
total
Returns the total value of the selected data items.
Syntax
total ( < currentMeasure|numeric_expression > within set set_expression )
total ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
variance
Returns the variance of the selected data items.
Syntax
variance ( < currentMeasure|numeric_expression > within set set_expression )
variance ( < currentMeasure|numeric_expression > within < detail|aggregate >
expression )
variance-pop
Returns the variance population of the selected data items.
Syntax
variance-pop ( < currentMeasure|numeric_expression > within set set_expression )
variance-pop ( < currentMeasure|numeric_expression > within < detail|aggregate
> expression )
Constants
A constant is a fixed value that you can use in an expression.
date
Inserts the current system date.
date-time
Inserts the current system date and time.
interval
Inserts a zero interval: 000 00:00:00.000.
interval year
Inserts a zero year interval: 0 year.
interval month
Inserts a zero month interval: 0 month.
interval day
Inserts a zero day interval: 0 day.
interval hour
Inserts a zero hour interval: 0 hour.
interval minute
Inserts a zero minute interval: 0 minute.
interval second
Inserts a zero second interval: 0 second.
null
Inserts "null" if the expression conditions are not met.
number
Inserts the number 0, which can be replaced with a new numeric value.
string
Inserts an empty string as two single quotation marks between which you can type a string.
time
Inserts the current system time.
Constructs
This list contains constructs and templates that can be used to create an expression. Templates
combine multiple functions into a group. For example, the search case template includes the case,
when, else, and end functions.
if then else
This construct is the template for an if...then...else statement. This construct appears in the Top 10
Retailers for 2005 sample report in the GO Data Warehouse (analysis) package.
Syntax
IF ([Country] = 'Canada') THEN ([List Price] * 0.60) ELSE ([List Price])
in_range
This is the template for an in_range expression.
Syntax
[code] IN_RANGE { :30 , 40, 50, 999: }
Example 1
[code] IN_RANGE { 5 }
Example 2
[code] IN_RANGE { 5: }
Example 3
[code] IN_RANGE { :5 }
Example 4
[code] IN_RANGE { 5:10 }
Example 5
[code] IN_RANGE { :5,10,20: }
search case
This construct is the template for a search case, including the case, when, else, and end functions.
Syntax
CASE WHEN [Country] = 'Canada' THEN ([List Price] * 0.60) WHEN [CountryCode] >
100 THEN [List Price] * 0.80
ELSE [List Price] END
simple case
This construct is the template for a simple case, including the case, when, else, and end functions.
Syntax
CASE [Country] WHEN 'Canada' THEN ([List Price] * 0.60) WHEN 'Australia' THEN
[List Price] * 0.80
ELSE [List Price] END
_add_days
Returns the date or datetime, depending on the format of "date_expression", that results from
adding "integer_expression" days to "date_expression".
Syntax
_add_days ( date_expression, integer_expression )
Example 1
_add_days ( 2002-04-30 , 1 )
Result: 2002-05-01
Example 2
_add_days ( 2002-04-30 12:10:10.000, 1 )
Example 3
_add_days ( 2002-04-30 00:00:00.000, 1/24 )
Note that the second argument is not a whole number. This is supported by some
database technologies and increments the time portion.
_add_months
Returns the date or datetime, depending on the format of "date_expression", that results from the
addition of "integer_expression" months to "date_expression".
Syntax
_add_months ( date_expression, integer_expression )
Example 1
_add_months ( 2002-04-30 , 1 )
Result: 2002-05-30
Example 2
_add_months ( 2002-04-30 12:10:10.000, 1 )
_add_years
Returns the date or datetime, depending on the format of "date_expression", that results from the
addition of "integer_expression" years to "date_expression".
Syntax
_add_years ( date_expression, integer_expression )
Example 1
_add_years ( 2002-04-30 , 1 )
Result: 2003-04-30
Example 2
_add_years ( 2002-04-30 12:10:10.000 , 1 )
_age
Returns a number that is obtained from subtracting "date_expression" from today's date. The
returned value has the form YYYYMMDD, where YYYY represents the number of years, MM
represents the number of months, and DD represents the number of days.
Syntax
_age ( date_expression )
Example
_age ( 1990-04-30 ) (if today's date is 2003-02-05)
_day_of_week
Returns the day of week (1 to 7), where 1 is the first day of the week as indicated by the second
parameter (1 to 7, 1 being Monday and 7 being Sunday). Note that in ISO 8601 standard, a week
begins with Monday being day 1.
Syntax
_day_of_week ( date_expression, integer )
Example
_day_of_week ( 2003-01-01 , 1 )
Result: 3
_day_of_year
Returns the day of year (1 to 366) in "date_ expression". Also known as Julian day.
Syntax
_day_of_year ( date_expression )
Example
_day_of_year ( 2003-03-01 )
Result: 61
_days_between
Returns a positive or negative number representing the number of days between "date_expression1"
and "date_expression2". If "date_expression1" < "date_expression2", then the result will be a
negative number.
Syntax
_days_between ( date_expression1 , date_expression2 )
Example
_days_between ( 2002-04-30 , 2002-06-21 )
Result: -52
_days_to_end_of_month
Returns a number representing the number of days remaining in the month represented by
"date_expression".
Syntax
_days_to_end_of_month ( date_expression )
Example
_days_to_end_of_month ( 2002-04-20 14:30:22.123 )
Result: 10
_first_of_month
Returns a date or datetime, depending on the argument, by converting "date_expression" to a date
with the same year and month but with the day set to 1.
Syntax
_first_of_month ( date_expression )
Example 1
_first_of_month ( 2002-04-20 )
Result: 2002-04-01
Example 2
_first_of_month ( 2002-04-20 12:10:10.000 )
_last_of_month
Returns a date or datetime, depending on the argument, that is the last day of the month represented
by "date_expression".
Syntax
_last_of_month ( date_expression )
Example 1
_last_of_month ( 2002-01-14 )
Result: 2002-01-31
Example 2
_last_of_month ( 2002-01-14 12:10:10.000 )
_make_timestamp
Returns a timestamp constructed from "integer_expression1" (the year), "integer_expression2"
(the month), and "integer_expression3" (the day). The time portion defaults to 00:00:00.000 .
Syntax
_make_timestamp ( integer_expression1, integer_expression2, integer_
expression3 )
Example
_make_timestamp ( 2002 , 01 , 14 )
_months_between
Returns a positive or negative integer number representing the number of months between
"date_expression1" and "date_expression2". If "date_expression1" is earlier than "date_expression2", then a negative number is returned.
Syntax
_months_between ( date_expression1, date_expression2 )
Example
_months_between ( 2002-04-03 , 2002-01-30 )
Result: 2
_week_of_year
Returns the number of the week of the year of "date_expression" according to the ISO 8601 standard. Week 1 of the year is the first week of the year to contain a Thursday, which is equivalent to
the first week containing January 4th. A week starts on Monday (day 1) and ends on Sunday (day
7).
Syntax
_week_of_year ( date_expression )
Example
_week_of_year ( 2003-01-01 )
Result: 1
_years_between
Returns a positive or negative integer number representing the number of years between
"date_expression1" and "date_expression2". If "date_expression1" < "date_expression2" then a
negative value is returned.
Syntax
_years_between ( date_expression1, date_expression2 )
Example
_years_between ( 2003-01-30 , 2001-04-03 )
Result: 1
_ymdint_between
Returns a number representing the difference between "date_expression1" and "date_expression2".
The returned value has the form YYYYMMDD, where YYYY represents the number of years, MM
represents the number of months, and DD represents the number of days.
Syntax
_ymdint_between ( date_expression1 , date_expression2 )
Example
_ymdint_between ( 1990-04-30 , 2003-02-05 )
Block Functions
This list contains functions used to access members of a set, usually in the context of Analysis Studio.
_firstFromSet
Returns the first members found in the set up to "numeric_expression_maximum" + "numeric_
expression_overflow". If "numeric_expression_maximum" + "numeric_expression_overflow" is
exceeded, then only the maximum number of members are returned. For a set that has only a few
members more than the specified numeric_expression_maximum, the numeric_expression_overflow
allows the small set of extra members to be included. If the set has more members than the overflow
allows, then only the numeric_expression_maximum members will be returned.
Syntax
_firstFromSet ( set_expression , numeric_expression_maximum , numeric_expression_
overflow )
Example 1
_firstFromSet ( [great_outdoors_company].[Products].[Products].[Product
line] , 2 , 8 )
Result: Returns the five members in the Product line set. The first two members are returned within
the maximum and the following three members are returned as the overflow.
Camping Equipment
Golf Equipment
Mountaineering Equipment
Outdoor Protection
Personal Accessories
Example 2
_firstFromSet ( [great_outdoors_company].[Products].[Products].[Product
line] , 2 , 2 )
_remainderSet
Returns the set containing "member_expression" when the size of "set_expression" is greater than
"numeric_expression"; i.e., a new member will be generated if the number of members in
"set_expression" is larger than the specified "numeric_expression".
Syntax
_remainderSet ( member_expression,
set_expression , numeric_expression )
Example
_remainderSet ( member ( aggregate ( currentMeasure within set [great_outdoors_
company].[Products].[Products].[Product line] ) , 'Product Aggregate' , 'Product
Aggregate' , [great_outdoors_company].[Products].[Products] ) , [great_outdoors_
company].[Products].[Products].[Product line] , 1 )
Macro Functions
This list contains functions that can be used within a macro. A macro may contain one or more
macro functions. A macro is delimited by a number sign (#) at the beginning and at the end.
Everything between the number signs is treated as a macro expression and is executed at run time.
For macro functions that accept expressions of datatype timestamp with time zone as arguments,
the accepted format is 'yyyy-mm-dd hh:mm:ss[.ff]+hh:mm' where fractional seconds are optional
and can be represented by 1 to 9 digits. In lieu of a space separating the date portion to the time
portion, the character 'T' is also accepted. Also, in lieu of the time zone '+hh:mm', the character
'Z' is accepted and will be processed internally as '+00:00'. The macro functions that return
expressions of datatype timestamp with time zone return 9 digits by default for their fractional
seconds. The macro function timestampMask () can be used to trim the output if required.
+
Concatenates two strings.
Syntax
value1 + value2
Example
# '{ ' + $runLocale + ' }' #
Result: {en-us}
_add_days
Returns the timestamp with time zone (as a string) that results from adding "integer_expression"
number of days to "string_expression", where "string_expression" represents a timestamp with
time zone.
Syntax
_add_days ( string_expression , integer_expression )
Example 1
# _add_days ( '2005-11-01 12:00:00.000-05:00' , -1 ) #
Example 2
# _add_days ( $current_timestamp , 1 ) #
Example 3
# timestampMask ( _add_days ( $current_timestamp , 1 ) , 'yyyy-mm-dd' ) #
Result: 2005-11-02
_add_months
Returns the timestamp with time zone (as a string) that results from adding "integer_expression"
number of months to "string_expression", where "string_expression" represents a timestamp with
time zone.
Syntax
_add_months ( string_expression , integer_expression )
Example 1
# _add_months ( '2005-11-01 12:00:00.000-05:00' , -1 ) #
Example 2
# _add_months ( $current_timestamp , 1 ) #
Example 3
# timestampMask ( _add_months ( $current_timestamp , 1 ) , 'yyyy-mm-dd' ) #
Result: 2005-12-01
_add_years
Returns the timestamp with time zone (as a string) that results from adding "integer_expression"
number of years to "string_expression", where "string_expression" represents a timestamp with
time zone.
Syntax
_add_years ( string_expression , integer_expression )
Example 1
# _add_years ( '2005-11-01 12:00:00.000-05:00' , -1 ) #
Example 2
# _add_years ( $current_timestamp , 1 ) #
Example 3
# timestampMask ( _add_years ( $current_timestamp , 1 ) , 'yyyy-mm-dd' ) #
Result: 2006-11-01
array
Constructs an array out of the list of parameters.
Syntax
array ( string_expression|array_expression { , string_expression|array_
expression } )
Example
# csv ( array ( 'a1' , array ( 'x1' , 'x2' ) , 'a2' ) ) #
csv
Constructs a string from the elements of the array where the values are separated by commas.
Optionally, the separator and quote strings can be specified. The default separator is a comma ( , )
and the default quote character is a single quote ( ' ).
Syntax
csv ( array_expression [ , separator_string [ , quote_string ] ] )
Example
# csv ( array ( 'a1' , 'a2' ) ) #
dq
Surrounds "string_expression" with double quotes.
Syntax
dq ( string_expression )
Example
# dq ( 'zero' ) #
Result: "zero"
getConfigurationEntry
Get an entry from the IBM Cognos configuration file. The force_decode_flag is optional and
must be one of: 'true' , '1', 1 , 'false', '0', 0. The default is 'true'. When true, the value of the configuration entry will be decrypted into plain text if it is encrypted.
Syntax
getConfigurationEntry ( entry_string , force_decode_flag )
Example
# getConfigurationEntry ( 'serverLocale'
) #
Result: en
grep
Searches for and returns elements of an array that match the pattern specified in "pattern_string".
Syntax
grep ( pattern_string , array_expression )
Example
# csv ( grep ( 's' , array ( 'as', 'an', 'arts' ) ) ) #
_first_of_month
Returns a timestamp with time zone (as a string) by converting the day value in "string_expression"
to 1, where "string_expression" is a timestamp with time zone.
Syntax
_first_of_month ( string_expression )
Example 1
# _first_of_month ( '2005-11-11 12:00:00.000-05:00' ) #
Example 2
# timestampMask ( _first_of_month ( '2005-11-11 12:00:00.000-05:
00' ) , 'yyyymmdd' ) #
Result: 20051101
_last_of_month
Returns a timestamp with time zone (as a string) that is the last day of the month represented by
"string_expression", where "string_expression" is a timestamp with time zone.
Syntax
_last_of_month ( string_expression )
Example 1
# _last_of_month ( '2005-11-11 12:00:00.000-05:00' ) #
Example 2
# timestampMask ( _last_of_month ( '2005-11-11 12:00:00.000-05:00' ) , 'yyyymm-dd' ) #
Result: 2005-11-30
join
Joins the elements of an array using "separator_string".
Syntax
join ( separator_string , array_expression )
Example
# sq ( join ( ' | | ' , array ( 'as', 'an', 'arts' ) ) ) #
prompt
Prompts the user for a single value. Only "prompt_name" is required. The datatype defaults to
"string" when it is not specified. The prompt is optional when "defaultText" is specified. "Text",
when specified, will precede the value. "QueryItem" can be specified to take advantage of the
prompt information properties of "queryItem". "Trailing_text", when specified, will be appended
to the value.
Syntax
prompt ( prompt_name , datatype , defaultText , text , queryItem , trailing_
text )
Example 1
select . . . where COUNTRY_MULTILINGUAL.COUNTRY_CODE
CountryCode' , 'integer' , '10' ) #
Example 2
[gosales].[COUNTRY].[COUNTRY] = # prompt
( 'countryPrompt' , 'string' , '''Canada''' ) #
Notes
The "defaultText" parameter must be specified such that it is literally valid in the context of
the macro since no formatting takes place on this value. The default string '''Canada''' in
Example 2 is specified as a string using single quotes, in which the embedded single quotes are
doubled up, thus 3 quotes. This results in the string being properly displayed within single
quotes in the expression. As a general rule for the string datatype, "defaultText" should always
be specified like this, except in the context of a stored procedure parameter. For "defaultText"
of types 'date' or 'datetime', a special format should be used in the context of SQL. Examples
of these formats are 'DATE ''2001-12-25''' and 'DATETIME ''2001-12-25 12:00:00'''. In all
other contexts, use the date/datetime without the keyword and escaped single quotes (e.g.,
'2001-12-25').
promptmany
Prompts the user for one or more values. Only "prompt_name" is required. The datatype defaults
to string when it is not specified. The prompt is optional when "defaultText" is specified. "Text",
when specified, will precede the list of values. "QueryItem" can be specified to take advantage of
the prompt information properties of "queryItem". "Trailing_text", when specified, will be appended
to the list of values.
Syntax
promptmany ( prompt_name , datatype , defaultText , text , queryItem , trailing_
text )
Example 1
select . . . where COUNTRY_MULTILINGUAL.COUNTRY in ( # promptmany
( 'CountryName' ) # )
Example 2
select . . . from gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_
MULTILINGUAL , gosales.gosales.dbo.COUNTRY XX where COUNTRY_MULTILINGUAL.COUNTRY_
CODE = XX.COUNTRY_CODE # promptmany ( 'Selected CountryCodes' , 'integer' , '
' , ' and COUNTRY_MULTILINGUAL.COUNTRY_CODE in ( ' , '' , ' ) ' ) #
sb
Surrounds "string_expression" with square brackets.
Syntax
sb ( string_expression )
Example
# sb ( 'abc' ) #
Result: [abc]
sq
Surrounds "string_expression" with single quotes.
Syntax
sq ( string_expression )
Example
# sq ( 'zero' ) #
Result: 'zero'
sort
Sorts the elements of the array in alphabetical order. Duplicates are retained.
Syntax
sort ( array_expression )
Example
# csv ( sort ( array ( 's3', 'a', 'x' ) ) ) #
split
Splits a string or string elements of the array into separate elements.
Syntax
split ( pattern_string, string_expression|array_expression )
Example 1
# csv ( split ( '::', 'ab=c::de=f::gh=i' ) ) #
Example 2
# csv ( split ( '=' , split ( '::', 'ab=c::de=f::gh=i' ) ) ) #
substitute
Searches for a pattern in a string or in the string elements of an array and substitutes the first
occurrence of "pattern_string" with "replacement_string".
Syntax
substitute ( pattern_string, replacement_string, string_expression|array_
expression )
Example 1
#sq ( substitute ( '^cn=', '***', 'cn=help' ) )#
Result: '***help'
Example 2
# csv ( substitute ( '^cn=', '***', array ( 'cn=help' , 'acn=5' ) ) ) #
Example 3
# csv ( substitute ( 'cn=', '', array ( 'cn=help' , 'acn=5' ) ) ) #
timestampMask
Returns "string_expression1", representing a timestamp with time zone, trimmed to the format
specified in "string_expression2". The format in "string_expression2" must be one of the following:
'yyyy', 'mm', 'dd', 'yyyy-mm', 'yyyymm', 'yyyy-mm-dd', 'yyyymmdd', 'yyyy-mm-dd hh:mm:ss',
'yyyy-mm-dd hh:mm:ss+hh:mm', 'yyyy-mm-dd hh:mm:ss.ff3', 'yyyy-mm-dd hh:mm:ss.ff3+hh:mm',
'yyyy-mm-ddThh:mm:ss', 'yyyy-mm-ddThh:mm:ss+hh:mm', 'yyyy-mm-ddThh:mm:ss.ff3+hh:mm',
or 'yyyy-mm-ddThh:mm:ss.ff3+hh:mm'. The macro functions that return a string representation
Syntax
timestampMask ( string_expression1 , string_expression2 )
Example 1
# timestampMask ( $current_timestamp , 'yyyy-dd-mm' ) #
Result: 2005-11-01
Example 2
# timestampMask ( '2005-11-01 12:00:00.000-05:00' , 'yyyy-mm-dd
hh:mm:ss+hh:mm' ) #
Example 3
# timestampMask ( '2005-11-01 12:00:00.123456789-05:00' , 'yyyy-mm-ddThh:mm:
ss+hh:mm.ff3+hh:mm' ) #
Result: 2005-11-01T12:00:00.123-05:00
toLocal
Returns the string representing a timestamp with time zone resulting from adjusting
"string_expression" to the time zone of the operating system. Note that the macro function timestampMask () can be used to trim the output.
Syntax
toLocal ( string_expression )
Example 1
# toLocal ( '2005-11-01 17:00:00.000-00:00' ) # where OS local time zone is
-05:00
Example 2
# timestampMask ( toLocal ( '2005-11-01 17:00:00.000-00:00' ) , 'yyyy-mm-dd
hh:mm:ss+hh:mm' ) # where OS local time zone is -05:00
Example 3
# toLocal ( '2005-11-01 13:30:00.000-03:30' ) # where OS local time zone is
-05:00
toUTC
Returns the string representing a timestamp with time zone resulting from adjusting
"string_expression" to the zero-point reference UTC time zone, also known as GMT time. Note
that the macro function timestampMask () can be used to trim the output.
User Guide 421
Syntax
toUTC ( string_expression )
Example 1
# toUTC ( '2005-11-01 12:00:00.000-05:00' ) #
Example 2
# timestampMask( toUTC ( '2005-11-01 12:00:00.000-05:00' ) , 'yyyy-mm-dd hh:mm:
ss.ff3+hh:mm' ) #
Example 3
# toUTC ( $current_timestamp ) #
unique
Removes duplicate entries from the array. The order of the elements is retained.
Syntax
unique ( array_expression )
Example
# csv ( unique ( array ( 's3', 'a', 's3', 'x' ) ) ) #
urlencode
URL-encodes the passed argument. This function is useful when specifying XML connection strings.
Syntax
urlencode ( prompt ( 'userValue' ) )
Example
urlencode ( prompt ( 'some_val' ) )
Result: %27testValue%27
CSVIdentityName
Uses the identity information of the current authenticated user to look up values in the specified
parameter map. Each individual piece of the user's identity (account name, group names, role names)
is used as a key into the map. The unique list of values that is retrieved from the parameter map is
then returned as a string, where each value is surrounded by single quotes and where multiple values
are separated by commas.
Syntax
CSVIdentityName ( %parameter_map_name [ , separator_string ] )
Example
# CSVIdentityName ( %security_clearance_level_map ) #
CSVIdentityNameList
Returns the pieces of the user's identity (account name, group names, role names) as a list of strings.
The unique list of values is returned as a string, where each value is surrounded by single quotes
and where multiple values are separated by commas.
Syntax
CSVIdentityNameList ( [ separator_string ] )
Example
# CSVIdentityNameList ( ) #
CAMPassport
Returns the Cognos Access Manager passport.
Syntax
CAMPassport ( )
Example
# CAMPassport ( ) #
Result: 111:98812d62-4fd4-037b-4354-26414cf7ebef:3677162321
CAMIDList
Returns the pieces of the user's Cognos Access Manager ID (CAMID), such as account name,
group names, or role names, as a list of values separated by commas.
Syntax
CAMIDList ( [ separator_string ] )
Example
#CAMIDList ( ) #
CAMIDListForType
Returns an array of the user's Cognos Access Manager IDs (CAMIDs) based on the identity type
(account, group, or role). CAMIDListForType can be used with the macro functions csv or join.
Syntax
CAMIDListForType ( identity type )
Example
[qs].[userRole] in ( # csv ( CAMIDListForType ( 'role' ) ) # )
Common Functions
abs
Returns the absolute value of "numeric_expression". Negative values are returned as positive values.
Syntax
abs ( numeric_expression )
Example 1
abs ( 15 )
Result: 15
Example 2
abs ( -15 )
Result: 15
cast
Converts "expression" to a specified data type. Some data types allow for a length and precision
to be specified. Make sure that the target is of the appropriate type and size. The following can be
used for "datatype_specification": character, varchar, char, numeric, decimal, integer, smallint,
real, float, date, time, timestamp, time with time zone, timestamp with time zone, and interval.
When type casting to an interval type, one of the following interval qualifiers must be specified:
year, month, or year to month for the year-to-month interval datatype; day, hour, minute, second,
day to hour, day to minute, day to second, hour to minute, hour to second, or minute to second
for the day-to-second interval datatype. Notes: When you convert a value of type timestamp to
type date, the time portion of the timestamp value is ignored. When you convert a value of type
timestamp to type time, the date portion of the timestamp is ignored. When you convert a value of
type date to type timestamp, the time components of the timestamp are set to zero. When you
convert a value of type time to type timestamp, the date component is set to the current system
date. It is invalid to convert one interval datatype to the other (for instance because the number of
days in a month is variable). Note that you can specify the number of digits for the leading qualifier
only, i.e. YEAR(4) TO MONTH, DAY(5). Errors will be reported if the target type and size are
not compatible with the source type and size.
Syntax
cast ( expression , datatype_specification )
Example 1
cast ( '123' , integer )
Result: 123
Example 2
cast ( 12345 , varchar ( 10 ) )
ceil
Returns the smallest integer that is greater than or equal to "numeric_expression".
Syntax
ceil ( numeric_expression )
ceiling
Returns the smallest integer that is greater than or equal to "numeric_expression".
Syntax
ceiling ( numeric_expression )
Example 1
ceiling ( 4.22 )
Result: 5
Example 2
ceiling ( -1.23 )
Result: -1
char_length
Returns the number of logical characters in "string_expression". The number of logical characters
can be distinct from the number of bytes in some East Asian locales.
Syntax
char_length ( string_expression )
Example
char_length ( 'Canada' )
Result: 6
character_length
Returns the number of characters in "string_expression".
Syntax
character_length ( string_expression )
Example
character_length ( 'Canada' )
Result: 6
coalesce
Returns the first non-null argument (or null if all arguments are null). Requires two or more arguments in "expression_list".
Syntax
coalesce ( expression_list )
Example
coalesce ( [Unit price], [Unit sale price] )
Result: Returns the unit price, or the unit sale price if the unit price is null.
current_date
Returns a date value representing the current date of the computer that the database software runs
on.
Syntax
current_date
Example
current_date
Result: 2003-03-04
current_time
Returns a time with time zone value, representing the current time of the computer that runs the
database software if the database supports this function. Otherwise, it represents the current time
of the computer that runs IBM Cognos BI software.
Syntax
current_time
Example
current_time
Result: 16:33:11+05:00
current_timestamp
Returns a datetime with time zone value, representing the current time of the computer that runs
the database software if the database supports this function. Otherwise, it represents the current
time of the computer that runs IBM Cognos BI software.
Syntax
current_timestamp
Example
current_timestamp
exp
Returns 'e' raised to the power of "numeric_expression". The constant 'e' is the base of the natural
logarithm.
Syntax
exp ( numeric_expression )
Example
exp ( 2 )
Result: 7.389056
extract
Returns an integer representing the value of datepart (year, month, day, hour, minute, second) in
"datetime_expression".
Syntax
extract ( datepart , datetime_expression )
Example 1
extract ( year , 2003-03-03 16:40:15.535 )
Result: 2003
Example 2
extract ( hour , 2003-03-03 16:40:15.535 )
Result: 16
floor
Returns the largest integer that is less than or equal to "numeric_expression".
Syntax
floor ( numeric_expression )
Example 1
floor ( 3.22 )
Result: 3
Example 2
floor ( -1.23 )
Result: -2
ln
Returns the natural logarithm of "numeric_expression".
Syntax
ln ( numeric_expression )
Example
ln ( 4 )
Result: 1.38629
localtime
Returns a time value, representing the current time of the computer that runs the database software.
Syntax
localtime
Example
localtime
Result: 16:33:11
localtimestamp
Returns a datetime value, representing the current timestamp of the computer that runs the database
software.
Syntax
localtimestamp
Example
localtimestamp
lower
Returns "string_expression" with all uppercase characters shifted to lowercase.
Syntax
lower ( string_expression )
Example
lower ( 'ABCDEF' )
Result: abcdef
mod
Returns the remainder (modulus) of "integer_expression1" divided by "integer_expression2".
"Integer_expression2" must not be zero or an exception condition is raised.
Syntax
mod ( integer_expression1, integer_expression2 )
Example
mod ( 20 , 3 )
Result: 2
nullif
Returns null if "expression1" equals "expression2", otherwise returns "expression1".
Syntax
nullif ( expression1, expression2 )
octet_length
Returns the number of bytes in "string_expression".
Syntax
octet_length ( string_expression )
Example 1
octet_length ( 'ABCDEF' )
Result: 6
Example 2
octet_length ( '' )
Result: 0
position
Returns the integer value representing the starting position of "string_expression1" in "string_
expression2" or 0 when the "string_expression1" is not found.
Syntax
position ( string_expression1 , string_expression2 )
Example 1
position ( 'C' , 'ABCDEF' )
Result: 3
Example 2
position ( 'H' , 'ABCDEF' )
Result: 0
power
Returns "numeric_expression1" raised to the power "numeric_expression2". If "numeric_expression1" is negative, then "numeric_expression2" must result in an integer value.
Syntax
power ( numeric_expression1 , numeric_expression2 )
Example
power ( 3 , 2 )
Result: 9
_round
Returns "numeric_expression" rounded to "integer_expression" places to the right of the decimal
point. Notes: "integer_expression" must be a non-negative integer. Rounding takes place before
data formatting is applied.
Syntax
_round ( numeric_expression , integer_expression )
Example
_round ( 1220.42369, 2 )
Result: 1220.42
sqrt
Returns the square root of "numeric_expression". "Numeric_expression" must be non-negative.
Syntax
sqrt ( numeric_expression )
Example
sqrt ( 9 )
Result: 3
substring
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters or to the end of "string_expression" if "integer_expression2" is
omitted. The first character in "string_expression" is at position 1.
Syntax
substring ( string_expression , integer_expression1 [ , integer_expression2 ] )
Example
substring ( 'abcdefg' , 3 , 2 )
Result: cd
trim
Returns "string_expression" trimmed of leading and trailing blanks or trimmed of a certain character specified in "match_character_expression". "Both" is implicit when the first argument is not
stated and blank is implicit when the second argument is not stated.
Syntax
trim ( [ [ trailing|leading|both ] [ match_character_expression ] , ] string_
expression )
Example 1
trim ( trailing 'A' , 'ABCDEFA' )
Result: ABCDEF
430 IBM Cognos Framework Manager
Example 2
trim ( both , ' ABCDEF ' )
Result: ABCDEF
upper
Returns "string_expression" with all lowercase characters converted to uppercase.
Syntax
upper ( string_expression )
Example
upper ( 'abcdef' )
Result: ABCDEF
Dimensional Functions
ancestor
Returns the ancestor of "member" at "level" or at "integer" number of levels above "member".
Note: The result is not guaranteed to be consistent when there is more than one such ancestor.
Syntax
ancestor ( member, level|integer )
Example 1
ancestor ( [TrailChef Water Bag] , 1 )
Example 2
ancestor ( [TrailChef Water Bag] , 2 )
Example 3
ancestor ( [TrailChef Water Bag] , [great_outdoors_company].[Products].
[Products].[Product type] )
ancestors
Returns all the ancestors of "member" at "level" or "index" distance above the member. (Most
data sources support only one ancestor at a specified level. If the data source supports more than
one ancestor, the result is a member set.)
Syntax
ancestors ( member , level|index )
Example 1
ancestors ( [TrailChef Water Bag] , 1 )
Example 2
ancestors ( [TrailChef Water Bag] , 2 )
Example 3
ancestors ( [TrailChef Water Bag] , [great_outdoors_company].[Products].
[Products].[Product type] )
bottomCount
Sorts a set according to the value of "numeric_expression" evaluated at each of the members of
"set_expression" and returns the bottom "index_expression" members.
Syntax
bottomCount ( set_expression , index_expression , numeric_expression )
Example
bottomCount ( [great_outdoors_company].[Products].[Products].[Product
line] , 2 , [Revenue] )
Result: Returns the bottom two members of the set sorted by revenue.
Product line
Revenue
-------
-------
Outdoor Protection
$3,171,114.92
Mountaineering Equipment
$20,891,350.60
bottomPercent
Sorts "numeric_expression2", evaluated at the corresponding members of "set_expression", and
picks up the bottommost elements whose cumulative total is equal to or less than "numeric_
expression1" percent of the total.
Syntax
bottomPercent ( set_expression , numeric_expression1 , numeric_expression2 )
Example
bottomPercent ( set ( [Camping Equipment] , [Golf Equipment] , [Mountaineering
Equipment] ) , 40 , [2006] )
Result: For the set of Camping Equipment, Golf Equipment, and Mountaineering Equipment,
returns the members whose percentage total are less than or equal to 40% for 2006.
bottomSum
Sorts "numeric_expression2", evaluated at the corresponding member of "set_expression", and
picks up the bottommost elements whose cumulative total is equal to or less than "numeric_
expression1".
Syntax
bottomSum ( set_expression , numeric_expression1 , numeric_expression2 )
Example
bottomSum ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) , 6000000 , tuple ( [2006] , [great_outdoors_company].[Measures].[Gross
profit] ) )
caption
Returns the caption values of "level", "member", or "set_expression". The caption is the string
display name for an element and does not necessarily match the unique identifier used to generate
the business key or member unique name (MUN) for the element. The caption is not necessarily
unique; for example, the caption for a month may return the month name without further year
details to make the value unique.
Syntax
caption ( level|member|set_expression )
Example 1
caption ( [TrailChef Water Bag] )
Example 2
caption ( [great_outdoors_company].[Products].[Products].[Product line] )
children
Returns the set of children of a specified member.
Syntax
children ( member )
Example
children ( [Camping Equipment] )
closingPeriod
Returns the last sibling member among the descendants of a member at "level". This function is
typically used with a time dimension.
Syntax
closingPeriod ( level [ , member ] )
Example 1
closingPeriod ( [great_outdoors_company].[Years].[Years].[Month] )
Result: 2006/Dec
Example 2
closingPeriod ( [great_outdoors_company].[Years].[Years].[Year] )
Result: 2006
Example 3
closingPeriod ( [great_outdoors_company].[Years].[Years].[Month] , [2006 Q 4] )
Result: 2006/Dec
cousin
Returns the child member of "member2" with the same relative position as "member1" to its parent.
This function appears in the Revenue by GO Subsidiary 2005 sample report in the GO Data
Warehouse (analysis) package.
Syntax
cousin ( member1 , member2 )
Example 1
cousin ( [Irons] , [Camping Equipment] )
Example 2
cousin ( [Putters] , [Camping Equipment] )
completeTuple
Identifies a cell location (intersection) based on the specified members, each of which must be from
a different dimension. However, completeTuple () implicitly includes the default member from all
dimensions not otherwise specified in the arguments, rather than the current member. CompleteTuple
will use the default measure rather than the currentMeasure in the query if the measure is not
defined in the completetuple function. This function appears in the Planned Headcount sample
report in the GO Data Warehouse (analysis) package.
Syntax
completeTuple ( member { , member } )
Example 1
completeTuple ( [Mountaineering Equipment] , [Fax] )
Result: The completeTuple does not pick up the currentMember by default as the tuple function
does. The values in the first column are identical across each year because the default member of
the Years dimension, the root member, is used rather than the current member. Likewise, the first
column displays Revenue rather than Quantity Sold because the Revenue measure is the default
from the Measures dimension. CompleteTuple will use the default measure rather than the currentMeasure in the query if the measure is not defined in the completetuple function.
Quantity Sold
---------------
--------------
2004
$1,220,329.38
2005
$1,220,329.38
2006
$1,220,329.38
Example 2
completeTuple ( [Mountaineering Equipment] , [Fax] , [Quantity
sold] , currentMember ( [great_outdoors_company].[Years].[Years] ) )
Result: The completeTuple function uses the currentMember of the Years dimension and the
Quantity sold measure.
Quantity Sold
---------------
--------------
2004
2005
8,746
2006
7,860
currentMember
Returns the current member of the hierarchy during an iteration. If "hierarchy" is not present in
the context in which the expression is being evaluated, its default member is assumed. This function
appears in the Rolling and Moving Averages interactive sample report.
Syntax
currentMember ( hierarchy )
defaultMember
Returns the default member of "hierarchy".
Syntax
defaultMember ( hierarchy )
Example 1
defaultMember ( [great_outdoors_company].[Products].[Products] )
Result: Products
Example 2
defaultMember ( [great_outdoors_company].[Years].[Years] )
Result: Year
Example 3
defaultMember ( hierarchy ( [great_outdoors_company].[Measures].[Quantity
sold] ) )
Result: Revenue
descendants
Returns the set of descendants of "member" or "set_expression" at "level" (qualified name) or
"distance" (integer 0..n) from the root. Multiple options may be specified (separated by a space)
to determine which members are returned. self: Only the members at the specified level are included
in the final set (this is the default behaviour in the absence of any options). before: If there are any
intermediate levels between the member's level and the one specified, members from those levels
are included. If the level specified is the same as the member upon which the function is applied,
the member is included in the final set. beforewithmember: If there are any intermediate levels
between the member's level and the one specified, members from those levels are included. The
member upon which the function is applied is also included in the final set. after: If other levels
exist after the specified level, members from those levels are included in the final set. This function
appears in the Sales Commissions for Central Europe sample report in the GO Data Warehouse
(analysis) package.
Syntax
descendants ( member|set_expression , level|distance [ , { self|before|
beforewithmember|after } ] )
Example 1
descendants ( [great_outdoors_company].[Products].[Products].[Products] , [great_
outdoors_company].[Products].[Products].[Product type] )
Result: Returns the set of descendants of the Products set at the Product type level. Note: [great_
outdoors_company].[Products].[Products].[Products] is the root member of the Products hierarchy.
Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches
Example 2
descendants ( [great_outdoors_company].[Products].[Products].[Products] , 1 )
Result: Returns the set of descendants of the Products set at the first level.
436 IBM Cognos Framework Manager
Example 3
descendants ( [great_outdoors_company].[Products].[Products].
[Products] , 3 , before )
Result: Returns the descendants of the Products set before the third level.
Camping Equipment
Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches
Example 4
descendants ( [great_outdoors_company].[Products].[Products].
[Products] , 2 , self before )
Result: Returns the set of descendants of the Products set before and including the second level.
Camping Equipment
Cooking Gear
Sleeping Bags
Packs
Tents
...
Eyewear
Knives
Watches
except
Returns the members of "set_expression1" that are not also in "set_expression2". Duplicates are
retained only if the optional keyword all is supplied as the third argument.
Syntax
except ( set_expression1 , set_expression2 [ , all ] )
Example
except ( set ( [Camping Equipment] , [Mountaineering Equipment] ) , set
( [Camping Equipment] , [Golf Equipment] ) )
filter
Returns the set resulting from filtering a specified set based on the Boolean condition. Each member
is included in the result if and only if the corresponding value of "Boolean_expression" is true.
Syntax
filter ( set_expression , Boolean_expression )
Example
filter ( [Product line] , [Gross margin] > .30 )
firstChild
Returns the first child of "member".
Syntax
firstChild ( member )
Example 1
firstChild ( [By Product Lines] )
Example 2
firstChild ( [Camping Equipment] )
firstSibling
Returns the first child of the parent of "member".
Syntax
firstSibling ( member )
Example 1
firstSibling ( [Outdoor Protection] )
Example 2
firstSibling ( [Camping Equipment] )
_format
Associates a format with the expression. The format_keyword can be PERCENTAGE_0, PERCENTAGE_1, or PERCENTAGE_2. PERCENTAGE_1 returns a percentage with one digit to the right
of the decimal point, PERCENTAGE_2 returns a percentage with two digits to the right of the
decimal point, and PERCENTAGE_3 returns a percentage value out of one with three digits to the
right of the decimal point (for example, 0.965).
Syntax
_format ( expression , format_keyword
Example
_format ( [Unit Sale Price] / [Unit Price] , PERCENTAGE_2 )
Result: 75.12%
emptySet
Returns an empty member set for "hierarchy". This is most often used as a placeholder during
development or with dynamic report design (either with the IBM Cognos Software Development
Kit or via report design). By creating a data item that contains the emptyset function, it is possible
to build complex expressions that can later be revised by redefining the emptyset data item.
Syntax
emptySet ( hierarchy )
Example
except ( [great_outdoors_company].[Products].[Products].[Product line] , emptyset
( [great_outdoors_company].[Products].[Products] ) )
Result: Returns the Product line set and an empty set for the Products set.
Camping Equipment
Golf Equipment
Mountaineering Equipment
Outdoor Protection
Personal Accessories
generate
Evaluates "set_expression2" for each member of "set_expression1" and joins the resulting sets by
union. The result retains duplicates only when the optional keyword "all" is supplied as the third
argument.
Syntax
generate ( set_expression1 , set_expression2 [ , all ] )
Example
generate ( [Product line] , topCount ( descendants ( currentMember ( [great_
outdoors_company].[Products].[Products] ) , [great_outdoors_company].[Products].
[Products].[Product name] ) , 2 , [Revenue] ) )
Result: Returns the top two products by revenue for each product line.
head
Returns the first "index_expression" elements of "set_expression". The default for
"index_expression" is 1.
Syntax
head ( set_expression [ , index_expression ] )
Example 1
head ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) )
Example 2
head ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) , 2 )
hierarchize
Orders the members of "set_expression" in a hierarchy. Members in a level are sorted in their natural order. This is the default ordering of the members along a dimension when no other sort conditions are specified.
Syntax
hierarchize ( set_expression )
Example
hierarchize ( set ( [Golf Equipment] , [Mountaineering Equipment] , [Camping
Equipment] ) )
hierarchy
Returns the hierarchy that contains "level", "member", or "set_expression".
Syntax
hierarchy ( level|member|set_expression )
Example 1
hierarchy ( [Cooking Gear] )
Result: Returns every member in the hierarchy that contains Cooking Gear.
Products
Camping Equipment
Cooking Gear
TrailChef Water Bag
TrailChef Canteen
...
Mountain Man Extreme
Mountain Man Deluxe
Example 2
hierarchy ( [great_outdoors_company].[Products].[Products].[Product line] )
Result: Returns every member in the hierarchy that contains the Product line.
Products
Camping Equipment
Cooking Gear
TrailChef Water Bag
TrailChef Canteen
...
Mountain Man Extreme
Mountain Man Deluxe
item
Returns a member from the "index" location within "set_expression". The index into the set is
zero based.
Syntax
item ( set_expression , index )
Example
item ( children ( [Camping Equipment] ) , 2 )
intersect
Returns the intersection of "set_expression1" and "set_expression2". The result retains duplicates
only when the optional keyword "all" is supplied as the third argument.
Syntax
intersect ( set_expression1 , set_expression2 [ , all ] )
Example
intersect ( set ( [Camping Equipment] , [Mountaineering Equipment] ) , set
( [Camping Equipment] , [Outdoor Protection] , ) , all )
lag
Returns the sibling member that is "index_expression" number of positions prior to "member".
Syntax
lag ( member , index_expression )
Example 1
lag ( [Tents] , 1 )
Example 2
lag ( [Tents] , -2 )
Result: Packs
lastChild
Returns the last child of a specified member.
Syntax
lastChild ( member )
Example 1
lastChild ( Cooking Gear )
Example 2
lastChild ( [By Product Line] )
lastPeriods
Returns the set of members from the same level that ends with "member". The number of members
returned is the absolute value of "integer_expression". If "integer_expression" is negative, members
following and including the specified member are returned. Typically used with a time dimension.
This function appears in the Rolling and Moving Averages interactive sample report.
Syntax
lastPeriods ( integer_expression , member )
Example 1
lastPeriods ( 2 , [2006 Q 4] )
Result: Returns the last two members from the level that ends with 2006 Q 4.
2006 Q 3
2006 Q 4
Example 2
lastPeriods ( -3 , [2006 Q 4] )
Result: Returns the last three members from the level that starts with 2006 Q 4.
2006 Q 4
2007 Q 1
2007 Q 2
lastSibling
Returns the last child of the parent of a specified member.
Syntax
lastSibling ( member )
Example
lastSibling ( [Camping Equipment] )
lead
Returns the sibling member that is "index_expression" number of positions after "member". If
"index_expression" is negative, returns the sibling member that is "index_expression" number of
positions before "member".
Syntax
lead ( member , index_expression )
Example 1
lead ( [Outdoor Protection] , 1 )
Example 2
lead ( [Outdoor Protection] , -2 )
level
Returns the level of "member".
Syntax
level ( member )
Example
level ( [Golf Equipment] )
levels
Returns the level in "hierarchy" whose distance from the root is specified by "index".
Syntax
levels ( hierarchy , index )
Example 1
levels ( [great_outdoors_company].[Products].[Products] , 2 )
Result: Returns the members two levels from the root Products hierarchy.
Cooking Gear
Sleeping Bags
Packs
Tents
...
Irons
Putters
Woods
Golf Accessories
Example 2
levels ( [great_outdoors_company].[Products].[Products] , 1 )
Result: Returns the members one level from the root Products hierarchy.
Camping Equipment
Mountaineering Equipment
Personal Accessories
Outdoor Protection
Golf Equipment
linkMember
Returns the corresponding member in "level" or "hierarchy" (of the same dimension). For levelbased hierarchies, a level must be specified as the second argument, and for parent-child hierarchies,
a hierarchy must be specified. An exception is thrown when the second parameter does not resolve
Syntax
linkMember ( member , level|hierarchy )
members
Returns the set of members in "hierarchy" or "level". In the case of a hierarchy, the order of the
members in the result is not guaranteed. If a predictable order is required, an explicit ordering
function (such as hierarchize) must be used.
Syntax
members ( hierarchy|level )
Example 1
members ( [great_outdoors_company].[Years].[Years] )
Example 2
members ( [great_outdoors_company].[Products].[Products].[Product line] )
nextMember
Returns the next member in the "member" level.
Syntax
nextMember ( member )
Example
nextMember ( [Outdoor Protection] )
openingPeriod
Returns the first sibling member among the descendants of a member at "level". This function is
typically used with a time dimension.
Syntax
openingPeriod ( level [ , member ] )
Example 1
openingPeriod ( [great_outdoors_company].[Years].[Years].[Month] )
Result: 2004/Jan
Example 2
openingPeriod ( [great_outdoors_company].[Years].[Years].[Year] )
Result: 2004
444 IBM Cognos Framework Manager
Example 3
openingPeriod ( [great_outdoors_company].[Years].[Years].[Month] , [2006 Q 4] )
Result: 2006/Oct
order
Arranges the members of "set_expression" according to their "value_expression" and the third
parameter. ASC and DESC arrange members in ascending or descending order, respectively,
according to their position in the set hierarchy. Then the children of each member are arranged
according to "value_expression". BASC and BDESC arrange members in the set without regard to
the hierarchy. In the absence of an explicit specification, ASC is the default.
Syntax
order ( set_expression , value_expression [ , ASC|DESC|BASC|BDESC ] )
Example 1
order ( members ( [Great Outdoors Company].[Product].[Product].[Product
type] ) , [Quantity sold] , BASC )
Result: Returns the quantity sold for each product type in no particular order.
Product Line
Quantity
-------------
-------------
Woods
13,924
Irons
14,244
Safety
22,332
...
...
Sunscreen
215,432
Insect Repellents
270,074
Lanterns
345,096
Example 2
order ( members ( [Great Outdoors Company].[Product].[Product].[Product
type] ) , [Quantity sold] , ASC )
Result: Returns the quantity sold for each product type in ascending order.
Product Line
Quantity
-------------
-------------
Woods
13,924
Irons
14,244
Putters
23,244
...
...
Tents
130,664
Cooking Gear
198,676
Lanterns
345,096
ordinal
Returns the zero-based ordinal value (distance from the root level) of "level".
Syntax
ordinal ( level )
Example 1
ordinal ( [great_outdoors_company].[Products].[Products].[Product line] )
Result: 1
Example 2
ordinal ( [great_outdoors_company].[Products].[Products].[Product type] )
Result: 2
parallelPeriod
Returns a member from a prior period in the same relative position as "member". This function is
similar to the cousin function, but is more closely related to time series. It takes the ancestor of
"member" at "level" (called "ancestor") and the sibling of "ancestor" that lags by "integer_
expression" positions, and returns the parallel period of "member" among the descendants of that
sibling. When unspecified, "integer_expression" defaults to 1 and "member" defaults to the current
member.
Syntax
parallelPeriod ( level [ , integer_expression [ , member ] ] )
Example 1
parallelPeriod ( [great_outdoors_company].[Years].[Years].[Quarter] , -1 ,
[2006/Aug] )
Result: 2006/Nov
Example 2
parallelPeriod ( [great_outdoors_company].[Years].[Years].[Quarter] , 1 , [2006/
Aug] )
Example 3
parallelPeriod ( [great_outdoors_company].[Years].[Years].[Year] , 2 , [2006/
Aug] )
Result: 2004/Aug
parent
Returns the member that is the parent of "member" or "measure".
Syntax
parent ( member|measure )
Example
parent ( [Cooking Gear] )
periodsToDate
Returns a set of sibling members from the same level as "member", as constrained by "level". It
locates the ancestor of "member" at "level" and returns that ancestor's descendants at the same
level as "member" (up to and including "member"). Typically used with a time dimension. This
function appears in the Rolling and Moving Averages interactive sample report.
Syntax
periodsToDate ( level , member )
Example
periodsToDate ( [great_outdoors_company].[Years].[Years].[Year] , [2004/Mar] )
prevMember
Returns the member that immediately precedes "member" in the same level. This function appears
in the Sales Growth Year Over Year sample report in the GO Data Warehouse (analysis) package.
Syntax
prevMember ( member )
Example 1
prevMember ( [Outdoor Protection] )
Example 2
prevMember ( [2005] )
Result: 2004
member
Defines a member based on "value_expression" in "hierarchy". "String1" identifies the member
created by this function. It must be unique in the query and different from any other member in
the same hierarchy. "String2" is the caption of the member; if it is absent, the caption is empty. To
ensure predictable results, it is recommended that you supply the "hierarchy". Note: All calculations
used as grouping items whose sibling items are other calculations or member sets should be
explicitly assigned to a hierarchy using this function. The results are not predictable otherwise. The
only exception is where the calculation involves only members of the same hierarchy as the siblings.
In this case, the calculation is assumed to belong to that hierarchy.
Syntax
member ( value_expression [ , string1 [ , string2 [ , hierarchy ] ] ] )
Example
member ( total ( currentMeasure within set filter ( [great_outdoors_company].
[Products].[Products].[Product name] , caption ( [great_outdoors_company].
[Products].[Products].[Product name] ) starts with 'B' ) ) , 'BProducts' , 'B
Products' , [great_outdoors_company].[Products].[Products] )
Result: Returns the quantity sold and revenue for all products that start with the letter B.
nestedSet
Returns the set of members of "set_expression2" evaluated in the context of the current member
of "set_expression1".
Syntax
nestedSet ( set_expression1 , set_expression2 )
Example
nestedSet ( members ( [Product line] ) , topCount ( descendants ( currentMember
( [great_outdoors_company].[Products].[Products] ) , [great_outdoors_company].
[Products].[Products].[Product name] ) , 2 , [Revenue] ) )
Result: Returns the top two products by revenue for each product line.
set
Returns the list of members defined in the expression. The members must belong to the same hierarchy.
Syntax
set ( member { , member } )
Example
set ( [Golf Equipment] , [Irons] , [TrailChef Cup] )
siblings
Returns the children of the parent of the specified member.
Syntax
siblings ( member )
Example
siblings ( [Golf Equipment] )
tail
Returns the last "index_expression" elements of "set expression". The default for "index_expression"
is 1.
Syntax
tail ( set_expression [ , index_expression ] )
Example 1
tail (members ( [great_outdoors_company].[Products].[Products].[Product
line] ) )
Example 2
tail ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) , 2 )
Result: Returns the last two members of the Product line set.
Outdoor Protection
Personal Accessories
topCount
Sorts a set according to the values of "numeric_expression" evaluated at each of the members of
"set_expression" and returns the top "index_expression" members.
Syntax
topCount ( set_expression , index_expression , numeric_expression )
Example
topCount ( [great_outdoors_company].[Products].[Products].[Product line] , 2 ,
[Revenue] )
Result: Returns the top two revenues for the Product line set.
Product line
Revenue
-------
-------
Camping Equipment
$89,713,990.92
Personal Accessories
$31,894,465.86
topPercent
Sorts "numeric_expression2", evaluated at the corresponding members of "set_expression", and
picks up the topmost elements whose cumulative total is at least "numeric_expression1" percent
of the total.
Syntax
topPercent ( set_expression , numeric_expression1 , numeric_expression2 )
Example
topPercent ( set ( [Camping Equipment] , [Golf Equipment] , [Mountaineering
Equipment] ) , 40 , [2006] )
Result: For the set of Camping Equipment, Golf Equipment, and Mountaineering Equipment,
returns the members whose percentage totals are greater than or equal to 40% for 2006.
topSum
Sorts "numeric_expression2", evaluated at the corresponding members of "set_expression", and
picks up the topmost elements whose cumulative total is at least "numeric_expression1".
Syntax
topSum ( set_expression , numeric_expression1 , numeric_expression2 )
Example
topSum ( children ( [Products] ) , 16000000 , tuple ( [2006] , [great_outdoors_
company].[Measures].[Gross profit] ) )
tuple
Identifies a cell location (intersection) based on the specified members, each of which must be from
a different dimension. This function implicitly includes the current member from all dimensions
that are not otherwise specified in the arguments. The current member of any dimension not specified
in the evaluating context is assumed to be the default member of that dimension. The value of this
cell can be obtained with the "value" function.
Syntax
tuple (
member { , member } )
Example
tuple ( [Mountaineering Equipment] , [Fax] )
union
Returns data for "set_expression1" and "set_expression2". The result retains duplicates only when
the optional keyword "all" is supplied as the third argument.
Syntax
union ( set_expression1 , set_expression2 [ , all ] )
Example 1
union ( set ( [Camping Equipment] , [Golf Equipment] ) , set ( [Golf
Equipment] , [Mountaineering Equipment] ) )
Result: Returns data for both sets as one new set, showing the Golf Equipment column only once.
Example 2
union ( set ( [Camping Equipment] , [Golf Equipment] ) , set ( [Golf
Equipment] , [Mountaineering Equipment] ) , all )
Result: Returns data for both sets as one new set, showing the Golf Equipment column twice.
roleValue
Returns the value of the attribute that is associated with the role whose name is specified by "string"
within the specified context. "Member" or "set_expression" is optional only in a number of limited
circumstances, where it can be derived from another context. Applications can be made portable
across different data sources and models by accessing attributes by role rather than by query item
ID. For dimensionally-modeled relational (DMR) data sources, assignment of roles is the modeler's
responsibility. Intrinsic roles that are defined for members of all data source types include: '_businessKey', '_memberCaption', '_memberDescription', '_memberUniqueName'. Additional roles can
be defined in Framework Manager for each level in a hierarchy. For example, a Product type level
may have an attribute column called "Type Shipping Container", and the Product level may have
a "Product Shipping Container" attribute. Each of these could be assigned a custom role in
Framework Manager called "Container". The property could then be referenced independently of
the actual column name by using the roleValue function.
Syntax
roleValue ( string [ , member|set_expression ] )
Example 1
roleValue ( '_memberCaption' , [Sales].[Product].[Product].[Product line] ->
[all].[1] )
Example 2
roleValue ( '_businessKey' , [great_outdoors_company].[Years].[Years].[Year] )
Result: Returns the value of the attribute that is associated with the business key role.
("2004-01-01","2004-12-31")
("2005-01-01","2005-12-31")
("2006-01-01","2006-12-31")
Example 3
roleValue ( '_memberUniqueName' , [great_outdoors_company].[Years].[Years].
[Year] )
Result: Returns the value of the attribute that is associated with the MUN role.
[great_outdoors_company].[Years].[Years].[Year] ->:[PC].[Years (Root)].[2004010120041231]
[great_outdoors_company].[Years].[Years].[Year] ->:[PC].[Years (Root)].[2005010120051231]
[great_outdoors_company].[Years].[Years].[Year] ->:[PC].[Years (Root)].[2006010120061231]
rootMember
Returns the root member of a single-root hierarchy. This function appears in the Promotion Success
sample report in the GO Data Warehouse (analysis) package.
Syntax
rootMember ( hierarchy )
rootMembers
Returns the root members of a hierarchy.
Syntax
rootMembers ( hierarchy )
Example
rootMembers ( [great_outdoors_company].[Years].[Years] )
Result: By Time
subset
Returns a subset of members in "set_expression" starting at "index_expression1" from the beginning.
If the count "index_expression2" is specified, that many members are returned (if available). Otherwise, all remaining members are returned.
Syntax
subset ( set_expression, index_expression1 [ , index_expression2 ] )
Example 1
subset ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) , 2 )
Result: Returns the members of the Product line set starting at the second member.
Mountaineering Equipment
Outdoor Protection
Personal Accessories
Example 2
subset ( members ( [great_outdoors_company].[Products].[Products].[Product
line] ) , 2 , 2 )
Result: Returns two members of the Product line set starting at the second member.
unique
Removes all duplicates from "set_expression". The remaining members retain their original order.
Syntax
unique ( set_expression )
value
Returns the value of the cell identified by "tuple". Note that the default member of the Measures
dimension is the Default Measure.
Syntax
value ( tuple )
Example 1
value ( tuple ( [great_outdoors_company].[Years].[Years].[Year] ->:[PC].[Years
(Root)].[20040101-20041231] , [great_outdoors_company].[Measures].[Revenue] ) )
Result: $34,750,563.50
Example 2
value ( tuple ( [2004] , [Camping Equipment] , [Revenue] ) )
Result: $20,471,328.88
DB2
ascii
Returns the ASCII code value of the leftmost character of the argument as an integer.
Syntax
ascii ( string_expression )
Example
ascii ( a )
ceiling
Returns the smallest integer greater than or equal to "numeric_expression".
Syntax
ceiling ( numeric_expression )
Example
ceiling ( 0.75 )
char
Returns a string representation of a date/time value or a decimal number.
Syntax
char ( expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
Example
chr ( 65 )
Result: Returns a, the character for the ASCII code value of 65.
concat
Returns a string that is the result of concatenating "string_expression1" with "string_expression2".
Syntax
concat ( string_expression1, string_expression2 )
Example
concat ( [Sales target (query)].[Sales staff].[First name], [Sales target
(query)].[Sales staff].[Last name] )
Result: Returns the first name and last name; e.g., Bob Smith.
date
Returns a date from a single input value. "Expression" can be a string or integer representation of
a date.
Syntax
date ( expression )
Example
date ( '1998-01-08' )
day
Returns the day of the month (1-31) from "date_expression". "Date_expression" can be a date
value or a string representation of a date.
Syntax
day ( date_expression )
Example
day ( '1998-01-08' )
Result: Returns 8.
dayname
Returns a character string containing the data source-specific name of the day (for example, Sunday
through Saturday or Sun. through Sat. for a data source that uses English, or Sonntag through
Samstag for a data source that uses German) for the day portion of "date_expression".
"Date_expression" can be a date value or a string representation of a date.
Syntax
dayname ( date_expression )
Example
dayname ( '1998-01-08' )
dayofweek
Returns the day of the week in "date_expression" as an integer in the range 1 to 7, where 1 represents
Sunday. "date_expression" can be a date value or a string representation of a date.
Syntax
dayofweek ( date_expression )
Example
dayofweek ( '1998-01-08' )
Result: Returns 5.
dayofweek_iso
Returns the day of the week in "date_expression" as an integer in the range 1 to 7, where 1 represents
Monday. "date_expression" can be a date value or a string representation of a date.
Syntax
dayofweek_iso ( date_expression )
Example
dayofweek_iso ( '1998-01-08' )
Result: Returns 4.
dayofyear
Returns the day of the year in "date_expression" as an integer in the range 1 to 366.
"Date_expression" can be a date value or a string representation of a date.
Syntax
dayofyear ( date_expression )
Example
dayofyear ( current_date )
Result: Returns the day of the year for the current date; e.g., if it was January 28, the expression
would return 28.
days
Returns an integer representation of a date. "Expression" can be a date value or a string representation of a date.
Syntax
days ( expression )
dec
Returns the decimal representation of "string_expression1" with precision "numeric_expression1",
scale "numeric_expression2", and decimal character "string_expression2". "String_expression1"
must be formatted as an SQL Integer or Decimal constant.
Syntax
dec ( string_expression1 [ , numeric_expression1 [ , numeric_expression2
[ , string_expression2 ] ] ] )
decimal
Returns the decimal representation of "string_expression1" with precision "numeric_expression1",
scale "numeric_expression2" and decimal character "string_expression2". "String_expression1"
must be formatted as an SQL Integer or Decimal constant.
Syntax
decimal ( string_expression1 [ , numeric_expression1 [ , numeric_expression2
[ , string_expression2 ] ] ] )
difference
Returns an integer value representing the difference between the values returned by the data sourcespecific soundex function for "string_expression1" and "string_expression2". The value returned
ranges from 0 to 4, with 4 indicating the best match. Note that 4 does not mean that the strings
are equal.
Syntax
difference ( string_expression1 , string_expression2 )
Example 1
difference ([Sales target (query)].[Sales staff].[First name],[Sales (query)].
[Retailers].[Contact first name])
Result: 0
Example 2
difference ([Sales target (query)].[Sales staff].[First name],[Sales target
(query)].[Sales staff].[First name])
digits
Returns the character string representation of a non-floating point number.
Syntax
digits ( numeric_expression )
double
Returns the floating-point representation of an expression. "Expression" can either be a numeric
or string expression.
Syntax
double ( expression )
event_mon_state
Returns the operational state of a particular state monitor.
Syntax
event_mon_state ( string_expression )
float
Returns the floating-point representation of a number.
Syntax
float ( numeric_expression )
hex
Returns the hexadecimal representation of a value.
Syntax
hex ( expression )
hour
Returns the hour, an integer from 0 (midnight) to 23 (11:00 pm), from "time_expression".
"Time_expression" can be a time value or a string representation of a time.
Syntax
hour ( time_expression )
Example
hour ( 01:22:45 )
Result: Returns 1.
insert
Returns a string where "integer_expression2" characters have been deleted from "string_expression1"
beginning at "integer_expression1" and where "string_expression2" has been inserted into "string_
expression1" at its start. The first character in the string is at position 1.
Syntax
insert ( string_expression1, integer_expression1, integer_expression2, string_
expression2 )
integer
Returns the integer representation of an expression. "Expression" can be a numeric value or a string
representation of a number.
Syntax
integer ( expression )
Example
integer ( 84.95 )
Result: 85
int
Returns the integer representation of an expression. "Expression" can be a numeric value or a string
representation of a number.
Syntax
int ( expression )
Example
int ( 84.95 )
Result: 85
julian_day
Returns an integer value representing the number of days from January 1, 4712 BC (the start of
the Julian date calendar) to the date value specified in "expression". "Expression" can be a date
value or a string representation of a date.
Syntax
julian_day ( expression )
Example
julian_day ( '2009-06-29' )
Result: 2455012.22130739595741034
lcase
Returns "string_expression" with all uppercase characters shifted to lowercase.
Syntax
lcase ( string_expression )
Example
lcase ( [Sales (query)].[Sales staff].[Last name] )
left
Returns the leftmost "integer_expression" characters of "string_expression".
Syntax
left ( string_expression, integer_expression )
Example
left ( [Sales (query)].[Sales staff].[Last name] , 3 )
length
Returns the length of the operand in bytes. Exception: double byte string types return the length in
characters.
Syntax
length ( expression )
Example
length ( [Sales (query)].[Sales staff].[Record start date] )
locate
Returns the starting position of the first occurrence of "string_expression1" within "string_
expression2". The search starts at position start "integer_expression" of "string_expression2". The
first character in a string is at position 1. If "string_expression1" is not found, zero is returned.
Syntax
locate ( string_expression1, string_expression2 [ , integer_expression ] )
Example
locate ( A, [Sales (query)].[Sales staff].[Last name] , 2 )
Result: Returns the position of the character A in the last names starting at the second character of
the last name.
long_varchar
Returns a long string.
Syntax
long_varchar ( string_expression )
ltrim
Returns "string_expression" with leading spaces removed.
Syntax
ltrim ( string_expression )
Example
ltrim ( [Sales (query)].[Sales staff].[Last name] )
microsecond
Returns the microsecond (time-unit) part of a value. "Expression" can be a timestamp or a string
representation of a timestamp.
Syntax
microsecond ( expression )
Example
microsecond ( 01:45:34.056 )
midnight_seconds
Returns an integer value in the range 0 to 86400 representing the number of seconds between
midnight and time value specified in the argument. "Expression" can be a time value, a timestamp
or a string representation of a time.
Syntax
midnight_seconds ( expression )
Example
midnight_seconds ( 01:45:34.056 )
minute
Returns the minute (an integer from 0-59) from "time_expression". "Time_expression" can be a
time value, a timestamp, or a string representation of a time.
Syntax
minute ( time_expression )
Example
minute ( 01:45:34.056 )
month
Returns the month (an integer from 1-12) from "date_expression".
Syntax
month ( date_expression )
Example
month ( 2005-11-01 )
monthname
Returns a character string containing the data source-specific name of the month (for example,
January through December or Jan. through Dec. for an English data source, or Januar through
Dezember for a German data source) for the month portion of "date_expression".
Syntax
monthname ( date_expression )
Example
monthname ( 2005-11-01 )
Result: November
quarter
Returns the quarter in "date_expression" as a number in the range 1 to 4, where 1 represents January
1 through March 31.
Syntax
quarter ( date_expression )
Example
quarter ( 2005-11-01 )
Result: Returns 4.
radians
Returns the number of radians converted from "numeric_expression" degrees.
Syntax
radians ( numeric_expression )
repeat
Returns a string consisting of "string_expression" repeated "integer_expression" times.
Syntax
repeat ( string_expression, integer_expression )
Example
repeat ( XYZ, 3 )
replace
Replaces all occurrences of "string_expression2" in "string_expression1" with "string_expression3".
Syntax
replace ( string_expression1, string_expression2, string_expression3 )
Example
replace ( [Sales (query)].[Sales staff].[Position code], A, a )
Result: Returns position codes with all occurrences of "A" replaced by "a".
right
Returns the rightmost "integer_expression" characters of "string_expression".
Syntax
right ( string_expression, integer_expression )
Example
right ( [Sales (query)].[Sales staff].[Position code], 3 )
round
Returns "numeric_expression" rounded to "integer_expression" places to the right of the decimal
point. If "integer_expression" is negative, "numeric_expression" is rounded to the nearest absolute
value "integer_expression" places to the left of the decimal point. Rounding takes place before data
formatting is applied.
Syntax
round ( numeric_expression, integer_expression )
Example
round ( 3.14159265, 3 )
rtrim
Returns "string_expression" with trailing spaces removed.
Syntax
rtrim ( string_expression )
Example
rtrim ( [Sales (query)].[Sales staff].[Last name] )
second
Returns the second (an integer from 0-59) from "time_expression".
Syntax
second ( time_expression )
Example
second ( 01:45:34.056 )
sign
Returns an indicator of the sign of "numeric_expression": +1 if "numeric_expression" is positive,
0 if zero, or -1 if negative.
Syntax
sign ( numeric_expression )
Example
sign ( [Revenue] )
smallint
Returns the small integer representation of a number.
Syntax
smallint ( expression )
soundex
Returns a 4 character string code obtained by systematically abbreviating words and names in
"string_expression" according to phonetics. Can be used to determine if two strings sound the
same. For example, does sound-of ('SMITH') = sound-of ('SMYTH').
Syntax
soundex ( string_expression )
space
Returns a string consisting of "integer_expression" spaces.
Syntax
space ( integer_expression )
Example
space ( 5 )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters. The first character in "string_expression" is at position 1.
Syntax
substr ( string_expression , integer_expression1 [ , integer_expression2 ] )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
table_name
Returns an unqualified name of a table or view based on the object name in "string_expression1"
and the schema name given in "string_expression2". It is used to resolve aliases.
Syntax
table_name ( string_expression1 [ , string_expression2 ] )
table_schema
Returns the schema name portion of the two-part table or view name based on the object name in
"string_expression1" and the schema name in "string_expression2". It is used to resolve aliases.
Syntax
table_schema ( string_expression1 [ , string_expression2 ] )
time
Returns a time from a value.
Syntax
time ( expression )
timestamp
Returns a timestamp from a value or a pair of values. "Expression1" must represent a date value,
and "expression2" must represent a time value.
Syntax
timestamp ( expression1 [ , expression2 ] )
Example
timestamp ( 11 November 2005 , 12:00:00.000000 )
timestamp_iso
Returns a datetime in the ISO format (yyyy-mm-dd hh:mm:ss.nnnnnn) converted from the IBM
format (yyyy-mm-dd-hh.mm.ss.nnnnnn). If "expression" is a time, it inserts the value of the CURRENT DATE for the date elements and zero for the fractional time element.
464 IBM Cognos Framework Manager
Syntax
timestamp_iso ( expression )
Example
timestamp_iso ( 11 November 2005 , 12:00:00.000000 )
timestampdiff
Returns an estimated number of intervals of type "expression1" based on the difference between
two timestamps. "Expression2" is the result of subtracting two timestamp types and converting
the result to CHAR. Valid values of "expression1" are: 1 Fractions of a second; 2 Seconds; 4
Minutes; 8 Hours; 16 Days; 32 Weeks; 64 Months; 128 Quarters; 256 Years.
Syntax
timestampdiff ( expression1, expression2 )
to_char
Returns the string representation of a timestamp with the format of "string_expression".
Syntax
to_char ( timestamp_expression , string_expression )
translate
Returns "string_expression1" in which characters from "string_expression3" are translated to the
equivalent characters in "string_expression2". "String_expression4" is a single character that is
used to pad "string_expression2" if it is shorter than "string_expression3". If only "string_expression1" is present, then this function translates it to uppercase characters.
Syntax
translate ( string_expression1 [ , string_expression2, string_expression3
[ , string_expression4 ] ] )
Example 1
translate ( 'abcdefg' )
Example 2
translate ( 'mnlop' , n, m , - )
trunc
Returns "numeric_expression1" truncated to "numeric_expression2" places to the right of the
decimal point. If "numeric_expression2" is negative, "numeric_expression1" is truncated to the
absolute value of "numeric_expression2" places to the left of the decimal point.
Syntax
trunc ( numeric_expression1, numeric_expression2 )
Example
trunc ( 3.14159265, 3 )
truncate
Returns "numeric_expression1" truncated to "numeric_expression2" places to the right of the
decimal point. If "numeric_expression2" is negative, "numeric_expression1" is truncated to the
absolute value of "numeric_expression2" places to the left of the decimal point.
Syntax
truncate ( numeric_expression1, numeric_expression2 )
Example
truncate ( 3141.59265, -3 )
Result: Returns 3.
ucase
Returns "string_expression" with all lowercase characters shifted to uppercase.
Syntax
ucase ( string_expression )
Example
ucase ( XY896Zbced789 )
value
Returns the first non-null argument (or null if all arguments are null). The Value function takes
two or more arguments.
Syntax
value ( expression_list )
Example
value ( [Unit cost], [Unit price], [Unit sale price] )
varchar
Returns a VARCHAR representation of expression, with length numeric_expression.
Syntax
varchar ( expression [ , numeric_expression ] )
week
Returns the week of the year in "date_expression" as an integer value in the range 1 to 53.
Syntax
week ( date_expression )
Example
week ( 11 November 2005 )
year
Returns the year from "date_expression".
Syntax
year ( date_expression )
Example
year ( 11 November 2005 )
DB2 Math
log
Returns the natural logarithm of "numeric_expression".
Syntax
log ( numeric_expression )
log10
Returns the base ten logarithm of "numeric_expression".
Syntax
log10 ( numeric_expression )
rand
Generates a random number using "integer_expression" as a seed value.
Syntax
rand ( integer_expression )
DB2 Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atanh
Returns the hyperbolic arctangent of "numeric_expression" where "numeric_expression" is an
angle expressed in radians.
Syntax
atanh ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 , numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cosh
Returns the hyperbolic cosine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
cosh ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns "numeric_expression" radians converted to degrees.
Syntax
degrees ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
sinh
Returns the hyperbolic sine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
sinh ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
tanh
Returns the hyperbolic tangent of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
tanh ( numeric_expression )
Informix
cardinality
Returns the number of elements in a collection column (SET, MULTISET, LIST).
Syntax
cardinality ( string_expression )
char_length
Returns the number of logical characters in "string_expression". The number of logical characters
can be distinct from the number of bytes in some East Asian locales.
Syntax
char_length ( string_expression )
concat
Returns a string that is the result of concatenating, or joining, "string_expression1" to "string_
expression2".
Syntax
concat ( string_expression1 , string_expression2 )
Example
concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales
staff].[Last name] )
Result: Returns the first name and last name; e.g., Bob Smith.
date
Returns the date value of "string_expression", "date_expression", or "integer_expression".
Syntax
date ( string_expression|date_expression|integer_expression )
day
Returns an integer that represents the day of the month (1-31).
Syntax
day ( date_expression )
extend
Adjusts the precision of a datetime or date expression. The expression cannot be a quoted string
representation of a date value. If you do not specify first and last qualifiers, the default qualifiers
are year to fraction (3). If the expression contains fields that are not specified by the qualifiers, the
unwanted fields are discarded. If the first qualifier specifies a larger (more significant) field than
what exists in the expression, the new fields are filled in with values returned by the current function.
If the last qualifier specifies a smaller (less significant) field than what exists in the expression, the
new fields are filled in with constant values. A missing month or day field is filled in with 1, and
missing hour to fraction fields are filled in with 0.
Syntax
extend ( date_expression , ' { ' year to second ' } ' )
Example
extend ( some_date_column , { year to second } )
hex
Returns the hexadecimal encoding of "integer_expression".
Syntax
hex ( integer_expression )
initcap
Returns "string_expression" with the first letter of each word in uppercase and all other letters in
lowercase. A word begins after any character other than a letter. Thus, in addition to a blank space,
symbols such as commas, periods, and colons can introduce a new word.
Syntax
initcap ( string_expression )
length
Returns the number of bytes in "string_expression", not including any trailing blank spaces. For
byte or text "string_expression", length returns the full number of bytes, including any trailing
blank spaces.
Syntax
length ( string_expression )
lpad
Returns "string_expression1" left-padded by "string_expression2" to the total number of characters
specified by "integer_expression". The sequence of "string_expression2" occurs as many times as
necessary to make the return string the length specified by "integer_expression".
Syntax
lpad ( string_expression1 , integer_expression , string_expression2 )
mdy
Returns a type date value with three expressions that evaluate to integers that represent the month
(integer_expression1), day (integer_expression2), and year (integer_expression3).
Syntax
mdy ( integer_expression1 , integer_expression2 , integer_expression3 )
month
Returns an integer corresponding to the month portion of "date_expression".
Syntax
month ( date_expression )
nvl
Returns the value of "expression1" if "expression1" is not NULL. If "expression1" is NULL, then
returns the value of "expression2".
Syntax
nvl ( expression1 , expression2 )
Example
nvl ( [Unit sale price] , [Unit price] )
Result: Returns the unit sale price, or returns the unit price if the unit sale price is NULL.
octet_length
Returns the number of bytes in "string_expression", including any trailing spaces.
Syntax
octet_length ( string_expression )
replace
Returns "string_expression1" in which every occurrence of "string_expression2" is replaced by
"string_expression3". If you omit the "string_expression3" option, every occurrence of "string_
expression2" is omitted from the return string.
Syntax
replace ( string_expression1 , string_expression2 [ , string_expression3 ] )
Example
replace ( [Sales (query)].[Products].[Product line code] , - )
Result: Returns all product line codes without the character "-"
round
Returns the rounded value of "numeric_expression". If you omit "integer_expression", the value
is rounded to zero digits or to the units place. The digit range of 32 (+ and -) refers to the entire
decimal value. Rounding takes place before data formatting is applied.
Syntax
round ( numeric_expression [ , integer_expression ] )
Example
round (125, -1)
Result: 130
rpad
Returns "string_expression1" right-padded by "string_expression2" to the total number of characters
specified by "integer_expression". The sequence of "string_expression2" occurs as many times as
necessary to make the return string the length specified by "integer_expression".
Syntax
rpad ( string_expression1 , integer_expression , string_expression2 )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters. The first character in "string_expression" is at position 1. If you
omit "integer_expression2", returns the substring of "string_expression" that starts at position
"integer_expression1" and ends at the end of "string_expression".
Syntax
substr ( string_expression , integer_expression1 [ , integer_expression2 ] )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
to_char
Returns the character string "date_expression" with the specified "string_expression" formatting.
You can use this function only with built-in data types.
Syntax
to_char ( date_expression , string_expression )
to_date
Returns "string_expression1" as a date according to the date format you specify in "string_
expression2". If "string_expression1" is NULL, then a NULL value is returned.
Syntax
to_date ( string_expression1 , string_expression2 )
trunc
Returns the truncated value of "numeric_expression". If you omit "integer_expression", then
"numeric_expression" is truncated to zero digits or to the units place. The digit limitation of 32
(+ and -) refers to the entire decimal value.
Syntax
trunc ( numeric_expression [ , integer_expression ] )
weekday
Returns an integer that represents the day of the week of "date_expression". Zero (0) represents
Sunday, one (1) represents Monday, and so on.
Syntax
weekday ( date_expression )
year
Returns a four-digit integer that represents the year of "date_expression".
Syntax
year ( date_expression )
Informix Math
log10
Returns the logarithm of "numeric_expression" to base 10.
Syntax
log10 ( numeric_expression )
logn
Returns the natural logarithm of "numeric_expression".
Syntax
logn ( numeric_expression )
root
Returns the root value of "numeric_expression1". Requires at least one numeric argument (the
radians argument). If only "numeric_expression1" is supplied, 2 is used as a default value for
"numeric_expression2". Zero cannot be used as the value of "numeric_expression2".
Syntax
root ( numeric_expression1 [ , numeric_expression2 ] )
Informix Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression1".
Syntax
atan2 ( numeric_expression1 , numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
MS Access
ascii
Returns the ascii code value of the leftmost character of "string_expression".
Syntax
ascii ( string_expression )
ceiling
Returns the smallest integer greater than or equal to "numeric_expression".
User Guide 475
Syntax
ceiling ( numeric_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
concat
Returns a string that is the result of concatenating, or joining, "string_expression1" to "string_
expression2".
Syntax
concat ( string_expression1 , string_expression2 )
Example
concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales
staff].[Last name] )
Result: Returns the first name and last name; e.g., Bob Smith.
curdate
Returns a date value representing the current date of the computer that the database software runs
on.
Syntax
curdate ()
curtime
Returns a time value representing the current time of the computer that the database software runs
on.
Syntax
curtime ()
dayname
Returns a character string containing the data source-specific name of the day (for example, Sunday
through Saturday or Sun. through Sat. for an English data source, or Sonntag through Samstag for
a German data source) for the day portion of "date_expression".
Syntax
dayname ( date_expression )
dayofmonth
Returns the day of the month (1-31) from "date_expression". Returns the days field (a signed
integer) from "interval_expression".
Syntax
dayofmonth ( date_expression|interval_expression )
dayofweek
Returns the day of the week in "date_expression" as an integer (1-7), where 1 represents Monday.
Syntax
dayofweek ( date_expression )
dayofyear
Returns the day of the year in "date_expression" as an integer (1-366).
Syntax
dayofyear ( date_expression )
hour
Returns the hour from "time_expression" as an integer from 0 (midnight) to 23 (11:00 pm).
Syntax
hour ( time_expression )
instr
Searches "string_expression1" for the first occurrence of "string_expression2" and returns an
integer specifying the position of "string_expression2". "Integer_expression1" sets the starting
position for the search. If "integer_expression1" is omitted, the search begins at the first character
position of "string_expression1". "Integer_expression2" specifies the type of string comparison.
"Integer_expression1" is required if "integer_expression2" is specified.
Syntax
instr ( [ integer_expression1 , ] string_expression1 , string_expression2
[ , integer_expression2 ] )
lcase
Returns "string_expression" with all uppercase characters converted to lowercase.
Syntax
lcase ( string_expression )
left
Returns the leftmost "integer_expression" characters of "string_expression".
Syntax
left ( string_expression , integer_expression )
Example
left ( [Sales (query)].[Sales staff].[Last name] , 3 )
length
Returns the number of characters in "string_expression", excluding trailing blanks and the string
termination character.
Syntax
length ( string_expression )
locate
Returns the starting position of the first occurrence of "string_expression1" within "string_
expression2". The search starts at position "integer_expression" of "string_expression2". The first
character in a string is at position 1. If "string_expression1" is not found, then zero is returned.
Syntax
locate ( string_expression1 , string_expression2 [ , integer_expression ] )
ltrim
Returns "string_expression" with leading spaces removed.
Syntax
ltrim ( string_expression )
minute
Returns the minute (an integer from 0-59) from "time_expression".
Syntax
minute ( time_expression )
month
Returns the month (an integer from 1-12) from "date_expression".
Syntax
month ( date_expression )
monthname
Returns a character string containing the data source-specific name of the month (for example,
January through December or Jan. through Dec. for an English data source, or Januar through
Dezember for a German data source) for the month portion of "date_expression".
Syntax
monthname ( date_expression )
Example
monthname ( 2005-11-01 )
Result: November
now
Returns a datetime value representing the current date and time of the computer that the database
software runs on.
Syntax
now ()
position
Returns the starting position of "string_expression1" in "string_expression2". The first character
in a string is at position 1.
Syntax
position ( string_expression1 , string_expression2 )
quarter
Returns the quarter in "date_expression" as a number (1-4), where 1 represents January 1 through
March 31.
Syntax
quarter ( date_expression )
right
Returns the rightmost "integer_expression" characters of "string_expression".
Syntax
right ( string_expression , integer_expression )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places right of
the decimal point. If "integer_expression" is negative, "numeric_expression" is rounded to the
nearest absolute value "integer_expression" places to the left of the decimal point. Rounding takes
place before data formatting is applied.
Syntax
round ( numeric_expression , integer_expression )
Example
round (125, -1)
Result: 130
rtrim
Returns "string_expression" with trailing spaces removed.
Syntax
rtrim ( string_expression )
Example
rtrim ( [Sales (query)].[Sales staff].[Last name] )
Result: Returns last names with any spaces at the end of the name removed.
sign
Returns an indicator of the sign of "numeric_expression", +1 if positive, 0 if zero, or -1 if negative.
Syntax
sign ( numeric_expression )
space
Returns a string consisting of "integer_expression" spaces.
Syntax
space ( integer_expression )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters. The first character in "string_expression" is at position 1.
Syntax
substr ( string_expression , integer_expression1 , integer_expression2 )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
substring
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters. The first character in "string_expression" is at position 1.
Syntax
substring ( string_expression , integer_expression1 , integer_expression2 )
Example
substring ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
truncate
Returns "string_expression" with trailing spaces removed.
Syntax
truncate ( string_expression )
ucase
Returns "string_expression" with all lowercase characters converted to uppercase.
Syntax
ucase ( string_expression )
week
Returns the week of the year in "date_expression" as an integer value (1-53), where 1 represents
the first week of the year.
Syntax
week ( date_expression )
year
Returns the year from "date_expression".
Syntax
year ( date_expression )
MS Access Cast
cast_decimal
Returns the value of "expression" cast as a decimal.
Syntax
cast_decimal ( expression )
cast_float
Returns the value of "expression" cast as a float.
Syntax
cast_float ( expression )
cast_integer
Returns the value of "expression" cast as an integer.
Syntax
cast_integer ( expression )
Example
cast_integer ( 84.95 )
cast_numeric
Returns "string_expression" cast as a numeric value.
Syntax
cast_numeric ( string_expression )
cast_real
Returns the value of "expression" cast as a real value.
Syntax
cast_real ( expression )
cast_smallint
Returns "expression" cast as a small integer.
Syntax
cast_smallint ( expression )
cast_varchar
Returns the value of "expression" cast as a variable character field.
Syntax
cast_varchar ( expression )
MS Access Math
log
Returns the natural logarithm of "numeric_expression".
Syntax
log ( numeric_expression )
rand
Generates a random number using "integer_expression" as a seed value.
Syntax
rand ( integer_expression )
MS Access Trigonometry
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Netezza
ascii
Returns a number representing the ASCII code value of the leftmost character of "string_expression";
for example, ascii ( 'A' ) is 65.
Syntax
ascii ( string_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
decode
Compares "expr" to each search value one by one. If "expr" is equal to a search, then it returns
the corresponding result. If no match is found, it returns "default". If "default" is omitted, it returns
null.
Syntax
decode ( expr , search , result [ , search , result]... [ , default] )
initcap
Returns "string_expression", with the first letter of each word in uppercase, all other letters in
lowercase. Words are delimited by white space or characters that are not alphanumeric.
Syntax
initcap ( string_expression )
instr
Searches "string_expression1" starting at position "integer_expression1" for the "integer_expression2" occurrence of "string_expression2". If "integer_expression1" is negative then the search is
backwards from the end of "string_expression1". Returns an integer indicating the position of
"string_expression2".
Syntax
instr ( string_expression1 , string_expression2 [ , integer_expression1 [ ,
integer_expression2 ] ] )
lpad
Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_
expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion
of "string_expression1" is returned.
Syntax
lpad ( string_expression1 , integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
months_between
Returns the number of months from "date_expression1" to "date_expression2". If "date_expression1" is later than "date_expression2" then the result will be a positive number. The days and
time portions of the difference are ignored, i.e., the months are not rounded, except if
"date_expression1" and "date_expression2" are the last days of a month.
Syntax
months_between ( date_expression1 , date_expression2 )
next_day
Returns the datetime of the first weekday named by "string_expression" that is later than "datetime_
expression". The return value has the same hours, minutes, and seconds as "datetime_expression".
Syntax
next_day ( datetime_expression , string_expression )
nvl
Returns "expression" if not null, otherwise returns "constant". Valid for "numeric_expression",
"string_expression", "date_expression", and "time_expression".
Syntax
nvl ( expression , constant )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places right of
the decimal point. If "integer_expression" is negative, "numeric_expression" is rounded to the
nearest absolute value "integer_expression" places to the left of the decimal point; for example,
round (125, -1) rounds to 130.
Syntax
round ( numeric_expression [ , integer_expression ] )
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces
are used.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1". The first
character in "string_expression" is at position 1. "Integer_expression2" can be used to select fewer
characters; by default it selects characters to the end of the string.
Syntax
substr ( string_expression , integer_expression1 [ , integer_expression2 ] )
{current_db}
Syntax
{current_db}
{current_user}
Syntax
{current_user}
{session_user}
Syntax
{session_user}
to_char
Returns the string representation of "expression" with the format of "string_expression".
"Expression" can be either a date value or a numeric value.
Syntax
to_char ( expression [ , string_expression ] )
to_date
Converts "string_expression1" to a datetime value as specified by the format "string_expression2".
Syntax
to_date ( string_expression1 , string_expression2 )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
Syntax
to_number ( string_expression1 , string_expression2 )
translate
Returns "string_expression1", with all occurrences of each character in "string_expression2"
replaced by its corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
date_trunc
Truncates "date_expression1" to a value as specified by the format "string_expression1".
Syntax
date_trunc ( string_expression1 , date_expression1 )
trunc
Truncates digits from "numeric_expression1" using "numeric_expression2" as the precision.
Syntax
trunc ( numeric_expression1 [ , numeric_expression2 ] )
version
Returns the "string_expression1" value of the database version.
Syntax
version ()
Netezza Math
log
Returns the logarithm of "numeric_expression2" to the base "numeric_expression1".
Syntax
log ( numeric_expression1 , numeric_expression2 )
Netezza Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 , numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
degrees
Returns the degrees where "numeric_expression" is an angle expressed in radians.
Syntax
degrees ( numeric_expression )
radians
Returns the radians where "numeric_expression" is an angle expressed in degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Netezza Fuzzy
le_dst
Returns a value indicating how different the two input strings are, calculated according to the
Levenshtein edit distance algorithm.
Syntax
le_dst ( string_expression1 , string_expression2 )
dle_dst
Returns a value indicating how different the two input strings are, calculated according to the
Damerau-Levenshtein distance algorithm
Syntax
dle_dst ( string_expression1 , string_expression2 )
Netezza Phonetic
nysiis
Returns a Soundex representation of "string_expression" using the New York State Identification
and Intelligence System (NYSIIS) variation of Soundex.
Syntax
nysiis ( string_expression )
dbl_mp
Returns a composite 32-bit value of "string_expression".
Syntax
dbl_mp ( string_expression )
pri_mp
Returns the 4 character primary metaphone string from "numeric_expression" returned by dbl_mp.
Syntax
pri_mp ( numeric_expression )
sec_mp
Returns the 4 character secondary metaphone string from "numeric_expression" returned by
dbl_mp.
Syntax
sec_mp ( numeric_expression )
score_mp
Returns a score for how closely "numeric_expression" and "numeric_expression2" match.
Syntax
score_mp ( numeric_expression , numeric_expression2 , numeric_expression3 ,
numeric_expression4 , numeric_expression5 , numeric_expression6 )
Oracle
add_months
Returns the datetime resulting from adding "integer_expression" months to "date_expression".
Syntax
add_months ( date_expression , integer_expression )
ascii
Returns a number representing the ASCII code value of the leftmost character of "string_expression".
Syntax
ascii ( string_expression )
Example
ascii ( 'A' )
ceil
Returns the smallest integer greater than or equal to "numeric_expression".
Syntax
ceil ( numeric_expression )
char_length
Returns the number of logical characters in "string_expression". The number of logical characters
can be distinct from the number of bytes in some East Asian locales.
Syntax
char_length ( string_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
concat
Returns a string that is the result of concatenating, or joining, "string_expression1" to "string_
expression2".
Syntax
concat ( string_expression1 , string_expression2 )
Example
concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales
staff].[Last name] )
Result: Returns the first name and last name; e.g., Bob Smith.
decode
Compares "expression" to each search value one by one. If "expression" is equal to a search, then
it returns the corresponding result. If no match is found, it returns "default", or if "default" is
omitted, it returns null.
Syntax
decode ( expression , search , result [ , search , result ]... [ , default ] )
dump
Returns internal representation of "expression" with the format of "numeric_expression1" starting
from position "numeric_expression2" for "numeric_expression3" characters.
Syntax
dump ( expression [ , numeric_expression1 [ , numeric_expression2 [ , numeric_
expression3 ] ] ] )
greatest
Returns the greatest value in "expression_list".
Syntax
greatest ( expression_list )
initcap
Returns "string_expression" with the first letter of each word in uppercase and all other letters in
lowercase. Words are delimited by white space or characters that are not alphanumeric.
Syntax
initcap ( string_expression )
instr
Searches "string_expression1" starting at position "integer_expression1" for the "integer_expression2" occurrence of "string_expression2". If "integer_expression1" is negative, then the search
occurs backwards from the end of "string_expression1". Returns an integer indicating the position
of "string_expression2".
Syntax
instr ( string_expression1, string_expression2 [ , integer_expression1
[ , integer_expression2 ] ] )
instrb
Searches "string_expression1" starting at position "integer_expression1" for the "integer_expression2" occurrence of "string_expression2". If "integer_expression1" is negative, then the search
User Guide 491
Syntax
instrb ( string_expression1, string_expression2 [ , integer_expression1
[ , integer_expression2 ] ] )
least
Returns the least value in "expression_list".
Syntax
least ( expression_list )
length
Returns the number of characters in "string_expression".
Syntax
length ( string_expression )
lengthb
Returns the number of bytes in "string_expression".
Syntax
lengthb ( string_expression )
lpad
Returns "string_expression1" left-padded to the length defined by "integer_expression" with
occurrences of "string_expression2". If "string_expression1" is longer than "integer_expression",
the appropriate portion of "string_expression1" is returned.
Syntax
lpad ( string_expression1, integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1" with leading characters removed up to the first character not in
"string_expression2".
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
Example
ltrim ( 'xyxXxyAB' , 'xy' )
Result: XxyAB
months_between
Returns the number of months from "date_expression1" to "date_expression2". If "date_expression1" is later than "date_expression2" then the result will be a positive number. The days and
time portion of the difference are ignored, so the months are not rounded unless "date_expression1"
and "date_expression2" are the last days of a month.
Syntax
months_between ( date_expression1 , date_expression2 )
new_time
Returns the datetime in "new_timezone" for "datetime_expression" in "old_timezone".
"Old_timezone" and "new_timezone" can be one of 'AST', 'ADT', 'BST', 'BDT', 'CST', 'CDT',
'EST', 'EDT', 'HST', 'HDT', 'MST', 'MDT', 'NST', 'PST', 'PDT', 'YST', or 'YDT'.
Syntax
new_time ( datetime_expression , old_timezone , new_timezone )
next_day
Returns the datetime of the first weekday named by "string_expression" that is later than "datetime_
expression". The return value has the same format as "datetime_expression".
Syntax
next_day ( datetime_expression , string_expression )
nls_initcap
Returns "string_expression1" with the first letter of each word in uppercase and all other letters
in lowercase. A word begins after any character other than a letter. Thus, in addition to a blank
space, symbols such as commas, periods, and colons can introduce a new word. "String_expression2"
specifies the sorting sequence.
Syntax
nls_initcap ( string_expression1 [ , string_expression2 ] )
nls_lower
Returns "string_expression1" with all letters in lowercase. "String_expression2" specifies the sorting
sequence.
Syntax
nls_lower ( string_expression1 [ , string_expression2 ] )
nls_upper
Returns "string_expression1" with all letters in uppercase. "String_expression2" specifies the
sorting sequence.
Syntax
nls_upper ( string_expression1 [ , string_expression2 ] )
nvl
Returns "expression" unless it is null. If "expression" is null, returns "constant". Valid for "numeric_
expression", "string_expression", "date_expression", and "time_expression".
Syntax
nvl ( expression , constant )
Example
nvl ( [Unit sale price] , [Unit price] )
Result: Returns the unit sale price, or returns the unit price if the unit sale price is NULL.
replace
Replaces all occurrences of "string_expression2" in "string_expression1" with "string_expression3".
If "string_expression3" is not specified, then it removes all occurrences of "string_expression2".
Syntax
replace ( string_expression1 , string_expression2 [ , string_expression3 ] )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places right of
the decimal point. If "integer_expression" is negative, "numeric_expression" is rounded to the
nearest absolute value "integer_expression" places to the left of the decimal point. Rounding takes
place before data formatting is applied.
Syntax
round ( numeric_expression [ , integer_expression ] )
Example
round ( 125 , -1 )
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then occurrences
of "string_expression2" are replaced with spaces.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1" with the final characters removed after the last character not in
"string_expression2". If "string_expression2" is not specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
Example
rtrim ( 'ABxXxyx' , 'xy' )
sign
Returns an indicator of the sign of "numeric_expression", +1 if positive, 0 if zero, or -1 if negative.
Syntax
sign ( numeric_expression )
soundex
Returns a character string containing the phonetic representation of "string_expression".
Syntax
soundex ( string_expression )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters or to the end of "string_expression" if "integer_expression2" is
omitted. The first character in "string_expression" is at position 1.
Syntax
substr ( string_expression , integer_expression1 [ , integer_expression2 ] )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
substrb
Returns the substring of "string_expression" that starts at position "numeric_expression1" and
ends after "numeric_expression2" bytes. The first byte in "string_expression" is at position 1. If
you omit "numeric_expression2", returns the substring of "string_expression" that starts at position
"numeric_expression1" and ends at the end of "string_expression".
Syntax
substrb ( string_expression , numeric_expression1 [ , numeric_expression2 ] )
Example
substrb ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
{sysdate}
Returns a datetime value representing the current date and time of the computer that the database
software runs on.
Syntax
{ sysdate }
to_char
Returns the string representation of "expression" with the format of "string_expression".
"Expression" can be either a date value or a numeric value.
Syntax
to_char ( expression [ , string_expression ] )
to_date
Converts "string_expression1" to a datetime value as specified by the format "string_expression2".
"String_expression3" specifies the format elements, such as language.
Syntax
to_date ( string_expression1 [ , string_expression2 [ , string_expression3 ] ] )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
"String_expression3" specifies the format elements, such as currency information.
Syntax
to_number ( string_expression1 , string_expression2 , string_expression3 )
translate
Returns "string_expression1" with all occurrences of each character in "string_expression2" replaced
by the corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
trunc
Truncates "date_expression" using the format specified by "string_expression". For example, if
"string_expression" is 'year', then "date_expression" is truncated to the first day of the year.
Syntax
trunc ( date_expression , string_expression )
Example
trunc ( 2003-08-22 , 'year' )
trunc
Truncates digits from "numeric_expression1" using "numeric_expression2" as the precision.
Syntax
trunc ( numeric_expression1 , numeric_expression2 )
{user}
Returns the username of the current Oracle user.
Syntax
{ user }
vsize
Returns the number of bytes in the internal representation of "expression". "Expression" must be
a string expression.
Syntax
vsize ( expression )
Oracle Math
log
Returns the logarithm of "numeric_expression2" to the base "numeric_expression1".
Syntax
log ( numeric_expression1 , numeric_expression2 )
Oracle Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 ,numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cosh
Returns the hyperbolic cosine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
cosh ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
sinh
Returns the hyperbolic sine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
sinh ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
tanh
Returns the hyperbolic tangent of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
tanh ( numeric_expression )
Red Brick
ceil
Returns the smallest integer greater than or equal to "numeric_expression" or "string_expression".
Note that "string_expression" must represent a valid numeric value.
Syntax
ceil ( numeric_expression|string_expression )
concat
Returns a string that is the result of concatenating, or joining, "string_expression1" to "string_
expression2".
Syntax
concat ( string_expression1 , string_expression2 )
Example
concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales
staff].[Last name] )
Result: Returns the first name and last name; e.g., Bob Smith.
{current_user}
Returns the database username (authorization ID) of the current user.
Syntax
{ current_user }
date
Returns a date value. "Expression" can be either characters or a timestamp.
Syntax
date ( expression )
dateadd
Adds "interval" to "datetime_expression" and returns a result that is the same datetime data type
as "datetime_expression". "Datepart" refers to the year, month, day, hour, minute, second.
"Interval" must be an integer and "datetime_expression" can be a date, time, or timestamp.
Syntax
dateadd ( { datepart } , interval, datetime_expression )
datediff
Determines the difference between two datetime expressions and returns an integer result in
"datepart" units. "Datepart" refers to a year, month, day, hour, minute, or second. "Datetime_
expression1" and "datetime_expression2" can be dates, times, or timestamps.
Syntax
datediff ( { datepart } , datetime_expression1, datetime_expression2 )
datename
Extracts "datepart" of "datetime_expression" and returns its value as a character string. "Datepart"
refers to a year, month, day, hour, minute, or second. "Datetime_expression" can be a date, a time,
or a timestamp.
Syntax
datename ( { datepart } , datetime_expression )
dec
Converts "expression" to a decimal value with the data type decimal (precision, scale). The default
value of precision is 9. The default value of scale is 0.
Syntax
dec ( expression , [ precision , scale ] )
decimal
Converts "expression" to a decimal value with the data type decimal (precision, scale). The default
value of precision is 9. The default value of scale is 0.
Syntax
decimal ( expression , [ precision , scale ] )
decode
Compares and converts "expression" to another value. If "expression" matches "target", it is
replaced, otherwise it is replaced by "default" or null if no default is specified. The expressions can
be any data type as long as they are all the same data type.
Syntax
decode ( expression , target , replacement [ ,default ] )
float
Converts "numeric_expression" into a double-precision floating-point value.
Syntax
float ( numeric_expression )
ifnull
Tests "expression" for missing values and replaces each one with "substitute". If "expression" is
null, "substitute" is returned, otherwise it returns the value of "expression". The expressions can
be any data type as long as they are all the same data type.
Syntax
ifnull ( expression, substitute )
int
Converts "numeric_expression" into an integer value and returns an integer value. If "numeric_
expression" is null, it returns null.
Syntax
int ( numeric_expression )
integer
Converts "numeric_expression" into an integer value and returns an integer value. If "numeric_
expression" is null, it returns null.
Syntax
integer ( numeric_expression )
Example
integer ( 84.95 )
Result: 85
length
Returns an integer result specifying the number of characters in "string_expression". If
"string_expression" is null, it returns null.
Syntax
length ( string_expression )
lengthb
Returns an integer result specifying the number of bytes in "string_expression". If "string_expression"
is null, it returns null.
Syntax
lengthb ( string_expression )
ltrim
Removes leading blanks from "string_expression". If "string_expression" is null, it returns null.
Syntax
ltrim ( string_expression )
nullif
Returns null if both "expression1" and "expression2" have the same value. If they have different
values, the value of "expression1" is returned. "Expression1" and "expression2" can be any data
type as long as they are the same data type.
Syntax
nullif ( expression1 , expression2 )
positionb
Returns an integer that is relative to the beginning byte position of "string_expression1" in "string_
expression2". If "string_expression1" is not located, the result is 0. If "string_expression1" is of
zero length, the result is 1. If "string_expression1" is null, an error message is returned. If "string_
expression2" is null, the result is 0.
Syntax
positionb ( string_expression1, string_expression2 )
real
Returns a real value. If "numeric_expression" is null, it returns null.
Syntax
real ( numeric_expression )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places to the
right of the decimal point. If "integer_expression" is negative, "numeric_expression" is rounded
to the nearest absolute value "integer_expression" places to the left of the decimal point. Rounding
takes place before data formatting is applied.
Syntax
round ( numeric_expression , integer_expression )
Example
round (125, -1)
Result: 130
rtrim
Removes trailing blanks from "string_expression". If "string_expression" is null, it returns null.
Syntax
rtrim ( string_expression )
Example
rtrim ( [Sales (query)].[Sales staff].[Last name] )
Result: Returns last names with any spaces at the end of the name removed.
sign
Determines the sign of "numeric_expression", and returns 1 for a positive value, 1 for a negative
value, and 0 for zero.
Syntax
sign ( numeric_expression )
string
Converts "expression" to a character string. "Expression" can be either numeric or datetime.
Syntax
string ( expression [ , length [ , scale ] ] )
substr
Returns a substring of "string_expression" that begins at position "start_integer" and continues
for "length_integer" characters. If "length_integer" is not specified, a substring from "start_integer"
to the end of "string_expression" is returned.
Syntax
substr ( string_expression , start_integer , length_integer )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
substrb
Returns a substring of "string_expression" that begins at position "start_integer" and continues
for "length_integer" bytes. If "length_integer" is not specified, a substring from "start_integer" to
the end of "string_expression" is returned.
Syntax
substrb ( string_expression , start_integer , length_integer )
time
Creates a time value from "expression", which can be a character string or a time-stamp data type
expression.
Syntax
time ( expression )
timestamp
Creates a time-stamp value from "timestamp_expression", which is a character string.
Syntax
timestamp ( timestamp_expression )
timestamp
Creates a time-stamp value from "time_expression" and "date_expression". If either
"time_expression" or "date_expression" is null, the resulting time-stamp expression is also null.
Syntax
timestamp ( date_expression , time_expression )
to_char
Converts "source_date" to the character string specified by "format_string". "Source_date" can
be a date, time, or timestamp data type.
Syntax
to_char ( source_date, format_string )
SQL Server
ascii
Returns a number representing the ascii code value of the leftmost character of "string_expression".
Syntax
ascii ( string_expression )
Example
ascii ( 'A' )
Result: 65
char
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
char ( integer_expression )
Example
char ( 65 )
Result: A
charindex
Searches "string_expression2" for the first occurrence of "string_expression1" and returns an
integer. "Start_location" is the character position to start searching for "string_expression1" in
"string_expression2". If "start_location" is not specified, is a negative number, or is zero, the search
starts at the beginning of "string_expression2".
Syntax
charindex ( string_expression1 , string_expression2 [ , start_location ]
{current_user}
Returns the name of the current user.
Syntax
{ current_user }
datalength
Returns the length in bytes of "string_expression".
Syntax
datalength ( string_expression )
dateadd
Returns the date resulting from the addition of "integer_expression" units (indicated by "datepart"
(day, month, year)) to "date_expression".
Syntax
dateadd ( { datepart } , integer_expression , date_expression )
datediff
Returns the number of "datepart" (day, month, year) units between "date_expression1" and
"date_expression2".
Syntax
datediff ( {datepart} , date_expression1 , date_expression2 )
Example
datediff ( {yy} , 1984-01-01 , 1997-01-01 )
Result: 13
datename
Returns "datepart" from "date_expression", which can be a datetime, smalldatetime, date, or time
value as an ASCII string. Note that "datepart" must be a keyword representing a datepart or its
abbreviation recognized by Microsoft SQL Server and must be enclosed in curly brackets.
Syntax
datename ( ' { ' datepart ' } ' , date_expression )
Example
datename ( {mm} , 2000-01-01 )
Result: January
datepart
Returns part of "date_expression" (for example, the month) as an integer. "date_expression" can
be a datetime, smalldatetime, date, or time value. Note that "datepart" must be a keyword repre-
Syntax
datepart ( ' { ' datepart ' } ' , date_expression )
Example
datepart ( {wk} , 2000-01-01 )
day
Returns the day portion of "date_expression". Same as extract (day from date_expression).
Syntax
day ( date_expression )
difference
Returns an integer value representing the difference between the values returned by the data sourcespecific soundex function for "string_expression1" and "string_expression2". The value returned
ranges from 0 to 4, with 4 indicating the best match. Note that 4 does not mean that the strings
are equal.
Syntax
difference ( string_expression1 , string_expression2 )
Example 1
difference ([Sales target (query)].[Sales Staff].[First name],[Sales (query)].
[Retailers].[Contact first name])
Result: 0
Example 2
difference ([Sales target (query)].[Sales Staff].[First name],[Sales target
(query)].[Sales Staff].[First name])
Result: 4
getdate
Returns a datetime value representing the current date and time of the computer that the database
software runs on.
Syntax
getdate ()
left
Returns the leftmost "integer_expression" characters of "string_expression".
Syntax
left ( string_expression , integer_expression )
Example
left ( [Sales (query)].[Sales staff].[Last name] , 3 )
ltrim
Returns "string_expression" with leading spaces removed.
Syntax
ltrim ( string_expression )
month
Returns the month portion of "date_expression". Same as extract (month from date_expression).
Syntax
month ( date_expression )
patindex
Returns an integer that represents the starting position of the first occurrence of "string_expression1"
in the "string_expression2". Returns 0 if "string_expression1" is not found. The % wildcard
character must precede and follow "string_expression1", except when searching for first or last
characters.
Syntax
patindex ( string_expression1 , string_expression2 )
Example
patindex ( '%po%', 'Report' )
Result: 3
replace
Replaces all occurrences of "string_expression2" in "string_expression1" with "string_expression3".
Syntax
replace ( string_expression1 , string_expression2 , string_expression3 )
replicate
Returns a string consisting of "string_expression" repeated "integer_expression" times.
Syntax
replicate ( string_expression , integer_expression )
reverse
Returns "string_expression" in reverse order.
User Guide 507
Syntax
reverse ( string_expression )
right
Returns the rightmost "integer_expression" characters of "string_expression".
Syntax
right ( string_expression , integer_expression )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places to the
right of the decimal point. Rounding takes place before data formatting is applied.
Syntax
round ( numeric_expression , integer_expression )
Example
round (125, -1)
Result: 130
rtrim
Returns "string_expression" with trailing spaces removed.
Syntax
rtrim ( string_expression )
Example
rtrim ( [Sales (query)].[Sales staff].[Last name] )
Result: Returns last names with any spaces at the end of the name removed.
sign
Returns an indicator of the sign "numeric_expression": +1 if "numeric_expression" is positive, 0
if zero or -1 if negative.
Syntax
sign ( numeric_expression )
soundex
Returns a four character string representing the sound of the words in "string_expression".
Syntax
soundex ( string_expression )
space
Returns a string consisting of "integer_expression" spaces.
Syntax
space ( integer_expression )
str
Returns a string representation of "numeric_expression" where "integer_expression1" is the length
of the string returned and "integer_expression2" is the number of decimal digits.
Syntax
str ( numeric_expression [ , integer_expression1 [ , integer_expression2 ] ] )
stuff
Returns a string where "integer_expression2" characters have been deleted from "string_expression1"
beginning at "integer_expression1", and where "string_expression2" has been inserted into "string_
expression1" at its start. The first character in a string is at position 1.
Syntax
stuff ( string_expression1 , integer_expression1 , integer_expression2 , string_
expression2 )
year
Returns the year portion of "date_expression". Same as extract (year from date_expression).
Syntax
year ( date_expression )
Syntax
log ( numeric_expression )
log10
Returns the base ten logarithm of "numeric_expression".
Syntax
log10 ( numeric_expression )
pi
Returns the constant value of pi as a floating point value.
Syntax
pi ()
rand
Generates a random number using "integer_expression" as the seed value.
User Guide 509
Syntax
rand ( integer_expression )
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atn2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression1".
Syntax
atn2 ( numeric_expression1, numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns "numeric_expression" radians converted to degrees.
Syntax
degrees ( numeric_expression )
radians
Returns the number of radians converted from "numeric_expression" degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Teradata
account
Returns the account string for the current user.
Syntax
{account}
add_months
Returns the date or the datetime resulting from adding "integer_expression" months to
"date_expression" or "datetime_expression".
Syntax
add_months ( date_expression|datetime_expression , integer_expression )
bytes
Returns the number of bytes contained in "byte_expression". "Byte_expression" is restricted to
BYTE or VARBYTE.
Syntax
bytes ( byte_expression )
case_n
Evaluates "condition_expression_list" and returns the position of the first true condition, provided
that no prior condition in the list evaluates to unknown. The keywords must be enclosed in curly
brackets. No case is an optional condition that evaluates to true if every expression in the list evaluates to false. No case or unknown is an optional condition that evaluates to true if every expression
in the list evaluates to false, or if an expression evaluates to unknown and all prior conditions in
the list evaluate to false. Unknown is an optional condition that evaluates to true if an expression
evaluates to unknown and all prior conditions in the list evaluate to false.
Syntax
case_n ( condition_expression_list [ , NO CASE|UNKNOWN|NO CASE OR UNKNOWN
[ , UNKNOWN ] ] )
char2hexint
Returns the hexadecimal representation for "string_expression".
Syntax
char2hexint ( string_expression )
characters
Returns an integer value representing the number of logical characters or bytes contained in "string_
expression".
Syntax
characters ( string_expression )
database
Returns the name of the default database for the current user.
Syntax
{database}
date
Returns the current date.
Syntax
{date}
format
Returns the declared format for "expression" as a variable character string of up to 30 characters.
Syntax
format ( expression )
index
Returns the starting position of "string_expression2" in "string_expression1".
Syntax
index ( string_expression1 , string_expression2 )
log
Computes the base 10 logarithm of "numeric_expression". "Numeric_expression" must be a nonzero, positive, numeric expression.
Syntax
log ( numeric_expression )
nullif
Returns null if "scalar_expression1" and "scalar_expression2" are equal. Otherwise, it returns
"scalar_expression1". "Scalar_expression1" and "scalar_expression2" can be any data type.
Syntax
nullif ( scalar_expression1 , scalar_expression2 )
nullifzero
If "numeric_expression" is zero, converts it to null to avoid division by zero.
Syntax
nullifzero ( numeric_expression )
profile
Returns the current profile for the session or null if none.
Syntax
{profile}
random
Returns a random integer number for each row of the results table. "Lower_bound" and
"upper_bound" are integer constants. The limits for "lower_bound" and "upper_bound" range
from -2147483648 to 2147483647 inclusive. "Upper_bound" must be greater than or equal to
"lower_bound".
Syntax
random ( lower_bound , upper_bound )
role
Returns the current role for the session or null if none.
Syntax
{role}
session
Returns the number of the session for the current user.
Syntax
{session}
soundex
Returns a character string that represents the Soundex code for "string_expression".
Syntax
soundex ( string_expression )
substr
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters. The first character in "string_expression" is at position 1. If
"integer_expression2" is omitted, returns the substring of "string_expression" that starts at position
"integer_expression1" and ends at the end of "string_expression".
Syntax
substr ( string_expression , integer_expression1 [ , integer_expression2 ] )
Example
substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
time
Returns the current time based on a 24-hour day.
Syntax
{time}
type
Returns the data type defined for "expression".
Syntax
type ( expression )
user
Returns the user name of the current user.
Syntax
{user}
vargraphic
Returns a character string that represents the vargraphic code for "string_expression".
Syntax
vargraphic ( string_expression )
zeroifnull
Converts data from null to 0 to avoid errors created by a null value. If "numeric_expression" is
not null, returns the value of "numeric_expression". If "numeric_expression" is a character string,
it is converted to a numeric value of float data type. If "numeric_expression" is null or zero, it
returns zero.
Syntax
zeroifnull ( numeric_expression )
Teradata Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression". "Numeric_expression" must be between -1 and 1, inclusive.
Syntax
acos ( numeric_expression )
acosh
Returns the inverse hyperbolic cosine of "numeric_expression" where "numeric_expression" can
be any real number equal to or greater than 1.
Syntax
acosh ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression". "Numeric_expression" must be between -1 and 1, inclusive.
Syntax
asin ( numeric_expression )
asinh
Returns the inverse hyperbolic sine of "numeric_expression" where "numeric_expression" can be
any real number.
Syntax
asinh ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians where the arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The returned angle will be between - and radians, excluding
.
Syntax
atan2 ( numeric_expression1, numeric_expression2 )
atanh
Returns the inverse hyperbolic tangent of "numeric_expression" where "numeric_expression" can
be any real number between 1 and -1, excluding 1 and -1.
Syntax
atanh ( numeric_expression )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cosh
Returns the hyperbolic cosine of "numeric_expression" where "numeric_expression" can be any
real number.
Syntax
cosh ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
sinh
Returns the hyperbolic sine of "numeric_expression" where "numeric_expression" can be any real
number.
Syntax
sinh ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
tanh
Returns the hyperbolic tangent of "numeric_expression" where "numeric_expression" can be any
real number.
Syntax
tanh ( numeric_expression )
SAP BW
SAP BW Trigonometry
arccos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
arccos ( numeric_expression )
arcsin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
arcsin ( numeric_expression )
arctan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
arctan ( numeric_expression )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
coshyp
Returns the hyperbolic cosine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
coshyp ( numeric_expression )
sinhyp
Returns the hyperbolic sine of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
sinhyp ( numeric_expression )
tanhyp
Returns the hyperbolic tangent of "numeric_expression" where "numeric_expression" is an angle
expressed in radians.
Syntax
tanhyp ( numeric_expression )
SAP BW Math
log10
Returns the base ten logarithm of "numeric_expression".
Syntax
log10 ( numeric_expression )
Sybase
ascii
Returns a number representing the ascii code value of the leftmost character of "string_expression".
Syntax
ascii ( string_expression )
Example
ascii ( 'A' )
Result: 65
char
Converts "integer_expression" to a character value. Char is usually used as the inverse of ascii
where "integer_expression" must be between 0 and 255. If the resulting value is the first byte of a
multibyte character, the character may be undefined.
Syntax
char ( integer_expression )
charindex
Returns an integer that represents the starting position of "string_expression1" within "string_
expression2". If "string_expression1" is not found, zero is returned. If "string_expression1" contains
wildcard characters, charindex treats them as literals.
Syntax
charindex ( string_expression1 , string_expression2 )
datalength
Returns the length in bytes of "string_expression".
Syntax
datalength ( string_expression )
dateadd
Returns the date resulting from adding "integer_expression" units indicated by datepart (day,
month, year) to "date_expression". Note that "datepart" must be enclosed in curly brackets.
Syntax
dateadd ( ' { ' datepart ' } ' , integer_expression , date_expression )
Example
dateadd ( {dd} , 16 , 1997-06-16 )
datediff
Returns the number of units indicated by "datepart" (day, month, year) between "date_expression1"
and "date_expression2". Note that "datepart" must be enclosed in curly brackets.
Syntax
datediff ( ' { ' datepart ' } ' , date_expression1 , date_expression2 )
Example
datediff ( {yy} , 1984-01-01 , 1997-01-01 )
Result: 13
datename
Returns "datepart" of "date_expression" as an ASCII string. "Date_expression" can be a datetime,
smalldatetime, date, or time value. Note that "datepart" must be enclosed in curly brackets.
Syntax
datename ( ' { ' datepart ' } ' , date_expression )
Example
datename ( {mm} , 1999-05-01 )
Result: May
datepart
Returns "datepart" of "date_expression" as an integer. "Date_expression" can be a datetime,
smalldatetime, date, or time value. Note that the datepart argument must be enclosed in curly
brackets.
Syntax
datepart ( ' { ' datepart ' } ' , date_expression )
Example
datepart ( {mm} , 1999-05-01 )
Result: 5
day
Returns the day of the month (1-31) from "date_expression".
Syntax
day ( date_expression )
difference
Returns an integer value representing the difference between the values returned by the data sourcespecific soundex function for "string_expression1" and "string_expression2". The value that is
Syntax
difference ( string_expression1 , string_expression2 )
Example 1
difference ([Sales target (query)].[Sales staff].[First name],[Sales (query)].
[Retailers].[Contact first name])
Result: 0
Example 2
difference ([Sales target (query)].[Sales staff].[First name],[Sales target
(query)].[Sales staff].[First name])
Result: 4
getdate
Returns current system date and time.
Syntax
getdate ()
left
Returns the leftmost "integer_expression" characters of "string_expression".
Syntax
left ( string_expression , integer_expression )
Example
left ( [Sales (query)].[Sales staff].[Last name] , 3 )
ltrim
Returns "string_expression" with any leading spaces removed.
Syntax
ltrim ( string_expression )
month
Returns the month number (1-12) from "date_expression".
Syntax
month ( date_expression )
patindex
Returns an integer representing the starting position of the first occurrence of "string_expression1"
in "string_expression2" or returns 0 if "string_expression1" is not found. By default, patindex
returns the offset in characters. The offset can be returned in bytes by setting the return type to
bytes. The % wildcard character must precede and follow the pattern in "string_expression1",
except when searching for first or last characters.
Syntax
patindex ( string_expression1 , string_expression2 [ using {bytes|chars|
characters} ] )
rand
Returns a random float value between 0 and 1, using the optional "integer_expression" as a seed
value.
Syntax
rand ( integer_expression )
replicate
Returns a string with the same datatype as "string_expression", containing the same expression
repeated "integer_expression" times or as many times as will fit into a 225-byte space, whichever
is less.
Syntax
replicate ( string_expression , integer_expression )
reverse
Returns the reverse of "string_expression".
Syntax
reverse ( string_expression )
right
Returns the rightmost "integer_expression" characters of "string_expression".
Syntax
right ( string_expression , integer_expression )
round
Returns "numeric_expression" rounded to the nearest value "integer_expression" places to the
right of the decimal point. Rounding takes place before data formatting is applied.
Syntax
round ( numeric_expression, integer_expression )
Example
round (125, -1)
rtrim
Returns "string_expression" with trailing spaces removed.
Syntax
rtrim ( string_expression )
Example
rtrim ( [Sales (query)].[Sales staff].[Last name] )
Result: Returns last names with any spaces at the end of the name removed.
soundex
Returns a four-character soundex code for character strings that are composed of a contiguous
sequence of valid single- or double-byte Roman letter.
Syntax
soundex ( string_expression )
space
Returns a string with "integer_expression" single-byte spacing.
Syntax
space ( integer_expression )
str
Returns a string representation of "numeric_expression". "Integer_expression1" is the length of
the returned string and has a default setting of 10. "Integer_expression2" is the number of decimal
digits and has a default setting of 0. Both are optional values.
Syntax
str ( numeric_expression [ , integer_expression1 [ , integer_expression2 ] ] )
stuff
Deletes "integer_expression2" characters from "string_expression1" starting at "integer_expression1", and inserts "string_expression2" into "string_expression1" at that position. To delete
characters without inserting other characters, "string_expression2" should be null and not " ",
which indicates a single space.
Syntax
stuff ( string_expression1 , integer_expression1 , integer_expression2 , string_
expression2 )
substring
Returns the substring of "string_expression" that starts at position "integer_expression1". "Integer_
expression2" specifies the number of characters in the substring.
Syntax
substring ( string_expression , integer_expression1 , integer_expression2 )
Example
substring ( [Sales (query)].[Sales staff].[Position code], 3 , 5 )
to_unichar
Returns a unichar expression with the value "integer_expression". If "integer_expression" is in the
range 0xD800..0xDFFF, the operation is aborted. If the "integer_expression" is in the range
0..0xFFFF, a single Unicode value is returned. If "integer_expression" is in the range
0x10000..0x10FFFF, a surrogate pair is returned.
Syntax
to_unichar ( integer_expression )
uhighsurr
Returns 1 if the Unicode value at "integer_expression" is the high half of a surrogate pair (which
should appear first in the pair). Otherwise, it returns 0. This function allows you to write explicit
code for surrogate handling. Particularly, if a substring starts on a Unicode character where
uhighsurr () is true, extract a substring of at least 2 Unicode values, as substr() does not extract just
1. Substr () does not extract half of a surrogate pair.
Syntax
uhighsurr ( string_expression , integer_expression )
ulowsurr
Returns 1 if the Unicode value at "integer_expression" is the low half of a surrogate pair (which
should appear second in the pair). Otherwise, it returns 0. This function allows you to explicitly
code around the adjustments performed by substr (), stuff (), and right (). Particularly, if a substring
ends on a Unicode value where ulowsurr () is true, extract a substring of 1 less characters (or 1
more), since substr () does not extract a string that contains an unmatched surrogate pair.
Syntax
ulowsurr ( string_expression , integer_expression )
uscalar
Returns the Unicode scalar value for the first Unicode character in "string_expression". If the first
character is not the high-order half of a surrogate pair, then the value is in the range 0..0xFFFF. If
the first character is the high-order half of a surrogate pair, a second value must be a low-order
half, and the return value is in the range 0x10000..0x10FFFF. If this function is called on a Unicode
character expression containing an unmatched surrogate half, the operation is aborted.
Syntax
uscalar ( string_expression )
year
Returns the year from date_expression.
Syntax
year ( date_expression )
Sybase Math
log
Returns the natural logarithm of "numeric_expression".
Syntax
log ( numeric_expression )
log10
Returns the base ten logarithm of "numeric_expression".
Syntax
log10 ( numeric_expression )
pi
Returns the constant value of pi as a floating point value.
Syntax
pi ()
sign
Returns an indicator denoting the sign of "numeric_expression": +1 if "numeric_expression" is
positive, 0 if "numeric_expression" is zero, or -1 if "numeric_expression" is negative.
Syntax
sign ( numeric_expression )
Sybase Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
atn2
Returns the angle, in radians, whose tangent is "numeric_expression1" / "numeric_expression2".
Syntax
atn2 ( numeric_expression1, numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns "numeric_expression" radians converted to degrees.
Syntax
degrees ( numeric_expression )
radians
Returns the degree equivalent of "numeric_expression". Results are of the same type as "numeric_
expression". For numeric or decimal expressions, the results have an internal precision of 77 and
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
Postgres
Postgres String
overlay
Returns the "string_expression1" replacing "string_expression2" from character position
numeric_expression.
Syntax
overlay ( string_expression1 , string_expression2 , numeric_expression1 [ ,
numeric_expression2 ] )
btrim
Returns string_expression1 after removing the longest string of characters in "string_expression2".
Syntax
btrim ( string_expression1 [ , string_expression2 ] )
initcap
Returns "string_expression", with the first letter of each word in uppercase and all other letters in
lowercase. Words are delimited by white space or characters that are not alphanumeric.
Syntax
initcap ( string_expression )
lpad
Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_
expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion
of "string_expression1" is returned.
Syntax
lpad ( string_expression1 , integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
md5
Returns the MD5 hash of "string_expression1".
Syntax
md5 ( string_expression1 )
to_hex
Returns the hexadecimal string representation of "numeric_expression1".
Syntax
to_hex ( numeric_expression1 )
repeat
Returns the "string_expression" repeated "numeric_expression1" times.
Syntax
repeat ( string_expression , numeric_expression1 )
replace
Returns "string_expression" with "string_expression2" replaced with "string_expression3".
Syntax
replace ( string_expression , string_expression2 , string_expression3)
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces
are used.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
split_part
Returns "numeric_expression" field having split "string_expression1" on "string_expression2".
Syntax
split_part ( string_expression1 , string_expression2 , numeric_expression )
ascii
Returns a number representing the ASCII code value of the leftmost character of "string_expression";
for example, ascii ( 'A' ) is 65.
Syntax
ascii ( string_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
{current_catalog}
Syntax
{current_catalog}
{current_db}
Syntax
{current_db}
{current_schema}
Syntax
{current_schema}
{current_user}
Syntax
{current_user}
{session_user}
Syntax
{session_user}
Syntax
to_char ( expression , string_expression )
to_date
Converts "string_expression1" to a date value as specified by the format "string_expression2".
Syntax
to_date ( string_expression1 , string_expression2 )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
Syntax
to_number ( string_expression1 , string_expression2 )
to_timestamp
Converts "string_expression1" to a timestamp value as specified by the format "string_expression2".
Syntax
to_timestamp ( string_expression1 , string_expression2 )
translate
Returns "string_expression1", with each occurrence of each character in "string_expression2"
replaced by its corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
date_trunc
Returns the timestamp to the specified precision.
Syntax
date_trunc ( string_expression , timestamp_expression )
version
Returns the string value of the database version.
Syntax
version ()
Postgres Math
log
Returns the base 10 logarithm of "numeric_expression1" or logarithm to the base "numeric_
expression2".
Syntax
log ( numeric_expression1 [ , numeric_expression2 ] )
ln
Returns the natural logarithm of "numeric_expression1".
Syntax
ln ( numeric_expression )
cbrt
Returns the cube root of "numeric_expression1".
Syntax
cbrt ( numeric_expression )
div
Returns the integer quotient of "numeric_expression1" divided by "numeric_expression2".
Syntax
div ( numeric_expression1 , numeric_expression2 )
pi
Returns the constant of pi.
Syntax
pi ()
Postgres Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 , numeric_expression2 )
cos
Returns the cosine of "numeric_expression", where "numeric_expression" is an angle expressed
in radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression", where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns the degrees where "numeric_expression" is an angle expressed in radians.
Syntax
degrees ( numeric_expression )
radians
Returns the radians where "numeric_expression" is an angle expressed in degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression", where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression", where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Vertica
Vertica String
overlay
Returns the "string_expression1", replacing "string_expression2" from character position
numeric_expression.
Syntax
overlay ( string_expression1 , string_expression2 , numeric_expression1 [ ,
numeric_expression2 ] )
btrim
Returns string_expression1 after removing the longest string of characters in string_expression2.
Syntax
btrim ( string_expression1 [ , string_expression2 ] )
initcap
Returns "string_expression", with the first letter of each word in uppercase and all other letters in
lowercase. Words are delimited by white space or characters that are not alphanumeric.
Syntax
initcap ( string_expression )
lpad
Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_
expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion
of "string_expression1" is returned.
Syntax
lpad ( string_expression1 , integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
to_hex
Returns the hexadecimal string representation of "numeric_exp1".
Syntax
to_hex ( numeric_expression1 )
repeat
Returns the "string_expression" repeated "numeric_expression1" times.
Syntax
repeat ( string_expression , numeric_expression1 )
replace
Returns "string_expression" having replaced "string_expression2" with "string_expression3".
Syntax
replace ( string_expression , string_expression2 , string_expression3 )
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces
are used.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
ascii
Returns a number representing the ASCII code value of the leftmost character of "string_expression";
for example, ascii ( 'A' ) is 65.
Syntax
ascii ( string_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
current_database
Returns the name of the current database.
Syntax
current_database ()
current_schema
Returns the name of the current schema
Syntax
current_schema ()
{current_user}
Syntax
{current_user}
{session_user}
Syntax
{session_user}
Syntax
to_char ( expression , string_expression
to_date
Converts "string_expression1" to a date value as specified by the format "string_expression2".
Syntax
to_date ( string_expression1 , string_expression2 )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
Syntax
to_number ( string_expression1, string_expression2 )
to_timestamp
Converts "string_expression1" to a timestamp value as specified by the format "string_expression2".
Syntax
to_timestamp ( string_expression1, string_expression2 )
translate
Returns "string_expression1", with each occurrence of each character in "string_expression2"
replaced by its corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
date_trunc
Returns the timestamp to the specified precision.
Syntax
date_trunc ( string_expression , timestamp_expression)
version
Returns the string value of the database version.
Syntax
version ()
Vertica Math
log
Returns the base 10 logarithm of "numeric_expression1" or logarithm to the base "numeric_
expression2".
Syntax
log ( numeric_expression1 [ , numeric_expression2 ] )
ln
Returns the natural logarithm of "numeric_expression1".
Syntax
ln ( numeric_expression )
cbrt
Returns the cube root of "numeric_expression1".
Syntax
cbrt ( numeric_expression )
pi
Returns the constant of pi.
Syntax
pi ()
Vertica Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 , numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns the degrees where "numeric_expression" is an angle expressed in radians.
Syntax
degrees ( numeric_expression )
radians
Returns the radians where "numeric_expression" is an angle expressed in degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_exp" where "numeric_expression" is an angle expressed in radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Paraccel
Paraccel String
overlay
Returns the "string_expression1", replacing "string_expression2" from character position
numeric_expression.
Syntax
overlay ( string_expression1 , string_expression2 , numeric_expression1 [ ,
numeric_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
replace
Returns "string_expression", having replaced "string_expression2" with "string_expression3".
Syntax
replace ( string_expression , string_expression2 , string_expression3 )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
current_database
Returns the name of the current database.
Syntax
current_database ()
current_schema
Returns the name of the current schema
Syntax
current_schema ()
{current_user}
Syntax
{current_user}
{session_user}
Syntax
{session_user}
Syntax
to_char ( expression , string_expression )
to_date
Converts "string_expression1" to a date value as specified by the format "string_expression2".
Syntax
to_date ( string_expression1 , string_expression2 )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
Syntax
to_number ( string_expression1 , string_expression2 )
translate
Returns "string_expression1", with each occurrence of each character in "string_expression2"
replaced by its corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
version
Returns the string value of the database version.
Syntax
version ()
Paraccel Math
cbrt
Returns the cube root of "numeric_expression1".
Syntax
cbrt ( numeric_expression )
pi
Returns the constant of pi.
Syntax
pi ()
MySQL
MySQL String
lpad
Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_
expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion
of "string_expression1" is returned.
Syntax
lpad ( string_expression1 , integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
hex
Returns the hexadecimal string representation of "numeric_expression1".
Syntax
hex ( numeric_expression1 )
repeat
Returns the "string_expression" repeated "numeric_expression1" times.
Syntax
repeat ( string_expression , numeric_expression1 )
replace
Returns "string_expression" having replaced "string_expression2" with "string_expression3".
Syntax
replace ( string_expression , string_expression2 , string_expression3 )
reverse
Returns "string_expression" reversed.
Syntax
reverse ( string_expression )
right
Returns the rightmost "numeric_expression" characters from "string_expression1".
Syntax
right ( string_expression1 , numeric_expression )
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces
are used.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
soundex
Returns a soundex string of "string_expression1".
Syntax
soundex ( string_expression1 )
ascii
Returns a number representing the ASCII code value of the leftmost character of "string_expression";
for example, ascii ( 'A' ) is 65.
Syntax
ascii ( string_expression )
database
Returns the current database name
Syntax
database ()
schema
Returns the current schema name
Syntax
schema ()
session_user
Return the user name returned by the client
Syntax
session_user ()
system_user
Return the user name returned by the client
Syntax
system_user ()
version
Returns the string value of the database version.
Syntax
version ()
MySQL Math
log
Returns the base 10 logarithm of "numeric_expression1" or logarithm to the base "numeric_
expression2".
Syntax
log ( numeric_expression )
ln
Returns the natural logarithm of "numeric_expression1".
Syntax
ln ( numeric_expression )
pi
Returns the constant of pi.
Syntax
pi ()
MySQL Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 ,numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns the degrees where "numeric_expression" is an angle expressed in radians.
Syntax
degrees ( numeric_expression )
radians
Returns the radians where "numeric_expression" is an angle expressed in degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Greenplum
Greenplum String
overlay
Returns the "string_expression1" replacing "string_expression2" from character position "numeric_
expression".
Syntax
overlay ( string_expression1 , string_expression2 , numeric_expression1 [ ,
numeric_expression2 ] )
btrim
Returns "string_expression1" after removing the longest string of characters in "string_expression2".
Syntax
btrim ( string_expression1 [ , string_expression2 ] )
initcap
Returns "string_expression" with the first letter of each word in uppercase and all other letters in
lowercase. Words are delimited by white space or characters that are not alphanumeric.
Syntax
initcap ( string_expression )
lpad
Returns "string_expression1" padded to length "integer_expression" with occurrences of "string_
expression2". If "string_expression1" is longer than "integer_expression", the appropriate portion
of "string_expression1" is returned.
Syntax
lpad ( string_expression1 , integer_expression [ , string_expression2 ] )
ltrim
Returns "string_expression1", with leading characters removed up to the first character not in
"string_expression2"; for example, ltrim ( 'xyxXxyAB' , 'xy' ) returns XxyAB.
Syntax
ltrim ( string_expression1 [ , string_expression2 ] )
md5
Returns the MD5 hash of "string_expression1".
Syntax
md5 ( string_expression1 )
to_hex
Returns the hexadecimal string representation of "numeric_expression1".
Syntax
to_hex ( numeric_expression1 )
repeat
Returns the "string_expression" repeated "numeric_expression1" times.
Syntax
repeat ( string_expression , numeric_expression1 )
replace
Returns "string_expression" having replaced "string_expression2" with "string_expression3".
Syntax
replace ( string_expression , string_expression2 , string_expression3)
rpad
Returns "string_expression1" right-padded to length "integer_expression" with occurrences of
"string_expression2". If "string_expression1" is longer than "integer_expression", the appropriate
portion of "string_expression1" is returned. If "string_expression2" is not specified, then spaces
are used.
Syntax
rpad ( string_expression1 , integer_expression [ , string_expression2 ] )
rtrim
Returns "string_expression1", with final characters removed after the last character not in "string_
expression2"; for example, rtrim ( 'ABxXxyx' , 'xy' ) returns ABxX. If "string_expression2" is not
specified, the final space characters are removed.
Syntax
rtrim ( string_expression1 [ , string_expression2 ] )
split_part
Returns "numeric_expression" field having split "string_expression1" on "string_expression2".
Syntax
split_part ( string_expression1 , string_expression2 , numeric_expression )
ascii
Returns a number representing the ascii code value of the leftmost character of "string_expression";
for example, ascii ( 'A' ) is 65.
Syntax
ascii ( string_expression )
chr
Returns the character that has the ASCII code value specified by "integer_expression". "Integer_
expression" should be between 0 and 255.
Syntax
chr ( integer_expression )
current_database
Returns the name of the current database.
Syntax
current_database ()
current_schema
Returns the name of the current schema.
Syntax
current_schema ()
{current_user}
Syntax
{current_user}
{session_user}
Syntax
{session_user}
Syntax
to_char ( expression , string_expression )
to_date
Converts "string_expression1" to a date value as specified by the format "string_expression2".
Syntax
to_date ( string_expression1 , string_expression2 )
to_number
Converts "string_expression1" to a numeric value as specified by the format "string_expression2".
Syntax
to_number ( string_expression1 , string_expression2 )
to_timestamp
Converts "string_expression1" to a timestamp value as specified by the format "string_expression2".
Syntax
to_timestamp ( string_expression1 , string_expression2 )
translate
Returns "string_expression1" with each occurrence of each character in "string_expression2"
replaced by its corresponding character in "string_expression3".
Syntax
translate ( string_expression1 , string_expression2 , string_expression3 )
date_trunc
Returns the timestamp to the specified precision.
Syntax
date_trunc ( string_expression , timestamp_expression)
version
Returns the string value of the database version.
548 IBM Cognos Framework Manager
Syntax
version ()
Greenplum Math
log
Returns the base 10 logarithm of "numeric_expression1" or logarithm to the base "numeric_
expression2".
Syntax
log ( numeric_expression1 [ , numeric_expression2 ] )
ln
Returns the natural logarithm of "numeric_expression1".
Syntax
ln ( numeric_expression )
cbrt
Returns the cube root of "numeric_expression1".
Syntax
cbrt ( numeric_expression )
pi
Returns the constant of pi.
Syntax
pi ()
Greenplum Trigonometry
acos
Returns the arccosine of "numeric_expression" in radians. The arccosine is the angle whose cosine
is "numeric_expression".
Syntax
acos ( numeric_expression )
asin
Returns the arcsine of "numeric_expression" in radians. The arcsine is the angle whose sine is
"numeric_expression".
Syntax
asin ( numeric_expression )
atan
Returns the arctangent of "numeric_expression" in radians. The arctangent is the angle whose
tangent is "numeric_expression".
Syntax
atan ( numeric_expression )
atan2
Returns the arctangent of the x and y coordinates specified by "numeric_expression1" and "numeric_
expression2", respectively, in radians. The arctangent is the angle whose tangent is "numeric_
expression2" / "numeric_expression1".
Syntax
atan2 ( numeric_expression1 ,numeric_expression2 )
cos
Returns the cosine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
cos ( numeric_expression )
cot
Returns the cotangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
cot ( numeric_expression )
degrees
Returns the degrees where "numeric_expression" is an angle expressed in radians.
Syntax
degrees ( numeric_expression )
radians
Returns the radians where "numeric_expression" is an angle expressed in degrees.
Syntax
radians ( numeric_expression )
sin
Returns the sine of "numeric_expression" where "numeric_expression" is an angle expressed in
radians.
Syntax
sin ( numeric_expression )
tan
Returns the tangent of "numeric_expression" where "numeric_expression" is an angle expressed
in radians.
Syntax
tan ( numeric_expression )
Report Functions
_add_days
Returns the datetime resulting from adding "integer_expression" days to "timestamp_expression".
Syntax
_add_days ( timestamp_expression , integer_expression )
Example
_add_days ( 2007-01-14 00:00:00.000 , 3 )
_add_months
Returns the datetime resulting from adding "integer_expression" months to "timestamp_expression".
Syntax
_add_months ( timestamp_expression , integer_expression )
_add_years
Returns the datetime resulting from adding "integer_expression" years to "timestamp_expression".
Syntax
_add_years ( timestamp_expression , integer_expression )
_age
Returns a number by subtracting "timestamp_expression" from today's date.
Syntax
_age ( timestamp_expression )
Example
_age ([Query1].[Date]), where [Query1].[Date] is March 2, 2004, and today is
July 8, 2009
Result: 50,406, where 5 is the number of years, 04 is the number of months, and 06 is the number
of days.
_day_of_week
Returns the day of the week (between 1 and 7) for "timestamp_expression" where "integer_
expression" indicates which day of that week is day 1. To determine "integer_expression", choose
the day of the week and count from Monday; for example, if you choose Wednesday, "integer_
expression" would be 3 because Wednesday is the third day from Monday.
Syntax
_day_of_week ( timestamp_expression , integer_expression )
Example
_day_of_week ( 2009-01-01 , 7 ), where 7 means that Sunday is the first day of
the week.
Result: 5
_day_of_year
Returns the ordinal for the day of the year in "timestamp_ expression" (1 to 366). Also known as
Julian day.
Syntax
_day_of_year ( timestamp_expression )
_days_between
Returns a positive or negative number representing the number of days between "timestamp_
expression1" and "timestamp_expression2". If "timestamp_expression1" < "timestamp_expression2", the result will be a negative number.
Syntax
_days_between ( timestamp_expression1 , timestamp_expression2 )
_days_to_end_of_month
Returns a number representing the number of days remaining in the month represented by "timestamp_expression".
Syntax
_days_to_end_of_month ( timestamp_expression )
_first_of_month
Returns a datetime that is the first day of the month represented by "timestamp_expression".
Syntax
_first_of_month ( timestamp_expression )
Example 1
_first_of_month ( 2009-05-04 00:00:00.000 )
Example 2
_first_of_month (current_date)
Result: Returns Jul 1, 2009 if the current date is July 30, 2009.
_last_of_month
Returns a datetime that is the last day of the month represented by "timestamp_expression".
Syntax
_last_of_month ( timestamp_expression )
_make_timestamp
Returns a timestamp constructed from "integer_expression1" (the year), "integer_expression2"
(the month), and "integer_expression3" (the day). The time portion defaults to 00:00:00.000 .
Syntax
_make_timestamp ( integer_expression1 , integer_expression2 , integer_
expression3 )
_months_between
Returns a positive or negative number representing the number of months between "timestamp_
expression1" and "timestamp_expression2". If "timestamp_expression1" < "timestamp_expression2", the result will be a negative number.
Syntax
_months_between ( timestamp_expression1 , timestamp_expression2 )
_week_of_year
Returns the week number (1-53) of the year for "timestamp_expression". According to the ISO
8601, week 1 of the year is the first week to contain a Thursday, which is equivalent to the first
week containing January 4th. A week starts on a Monday (day 1) and ends on a Sunday (day 7).
Syntax
_week_of_year ( timestamp_expression )
_years_between
Returns a positive or negative integer representing the number of years between "timestamp_
expression1" and "timestamp_expression2". If "timestamp_expression1" < "timestamp_expression2", a negative value is returned.
Syntax
_years_between ( timestamp_expression1 , timestamp_expression2 )
_ymdint_between
Returns a number representing the difference between "timestamp_expression1" and "timestamp_
expression2". This value has the form YYMMDD, where YY represents the number of years, MM
represents the number of months, and DD represents the number of days.
Syntax
_ymdint_between ( timestamp_expression1 , timestamp_expression2 )
Example
_ymdint_between ( [Query1].[Date (close date)] , [Query1].[Date (ship date)] ),
where [Query1].[Date (close date)] is February 20, 2004, and [Query1].[Date
(ship date)] is January 19, 2004.
Result: 101, where 1 is the number of months and 01 is the number of days.
abs
Returns the absolute value of "numeric_expression". If "numeric_expression" is negative, a positive
value is returned.
Syntax
abs ( numeric_expression )
AsOfDate
Returns the date value of the AsOfDate expression, if it is defined. Otherwise, AsOfDate returns
the report execution date.
Syntax
AsOfDate ()
AsOfTime
Returns the time value of the AsOfTime expression, if it is defined. Otherwise, AsOfTime returns
the report execution time.
Syntax
AsOfTime ()
BurstKey
Returns the burst key.
Syntax
BurstKey ()
BurstRecipients
Returns the distribution list of burst recipients.
Syntax
BurstRecipients ()
ceiling
Returns the smallest integer that is greater than or equal to "numeric_expression".
Syntax
ceiling ( numeric_expression )
CellValue
Returns the value of the current crosstab cell.
Syntax
CellValue ()
character_length
Returns the number of characters in "string_expression".
Syntax
character_length ( string_expression )
ColumnNumber
Returns the current column number.
Syntax
ColumnNumber ()
CubeCreatedOn
Returns the date and time when the cube was created. "Dimension" specifies from which cube to
retrieve the metadata. If the dimension source is an IBM Cognos PowerCube (.mdc), the function
returns a blank string because the initial creation date of a PowerCube is not maintained.
Syntax
CubeCreatedOn ( dimension )
CubeCurrentPeriod
Returns the current period for the cube. "Dimension" specifies from which cube to retrieve the
metadata.
Syntax
CubeCurrentPeriod ( dimension )
CubeDataUpdatedOn
Returns the date time that data in the cube was last updated. "Dimension" specifies from which
cube to retrieve the metadata.
Syntax
CubeDataUpdatedOn ( dimension )
CubeDefaultMeasure
Returns the name of the default measure for the cube. "Dimension" specifies from which cube to
retrieve the metadata.
Syntax
CubeDefaultMeasure ( dimension )
CubeDescription
Returns the description of the cube. "Dimension" specifies from which cube to retrieve the metadata.
Syntax
CubeDescription ( dimension )
CubeIsOptimized
Returns "true" if the cube is optimized. "Dimension" specifies from which cube to retrieve the
metadata.
Syntax
CubeIsOptimized ( dimension )
CubeName
Returns the name of the cube. "Dimension" specifies from which cube to retrieve the metadata.
Syntax
CubeName ( dimension )
CubeSchemaUpdatedOn
Returns the date time that the cube schema was last updated. "Dimension" specifies from which
cube to retrieve the metadata.
Syntax
CubeSchemaUpdatedOn ( dimension )
exp
Returns the constant 'e' raised to the power of "numeric_expression". The constant 'e' is the base
of the natural logarithm.
Syntax
exp ( numeric_expression )
Example
exp ( 2 )
Result: 7.389056
extract
Returns an integer representing the value of "date_part_expression" in "datetime_expression".
"Date_part_expression" could be the year, month, day, hour, minute, or second.
Syntax
extract ( date_part_expression , datetime_expression )
Example 1
extract ( year , 2003-03-03 16:40:15.535 )
Example 2
extract ( hour , 2003-03-03 16:40:15.535 )
Result: 16
floor
Returns the largest integer that is less than or equal to "numeric_expression".
Syntax
floor ( numeric_expression )
GetLocale
Returns the run locale (deprecated).
Syntax
GetLocale ()
HorizontalPageCount
Returns the current horizontal page count.
Syntax
HorizontalPageCount ()
HorizontalPageNumber
Returns the current horizontal page number.
Syntax
HorizontalPageNumber ()
InScope
Returns Boolean 1 (true) when the cell is in the scope of the data items and MUNs; otherwise,
returns Boolean 0 (false).
Syntax
InScope ( dataItem , MUN, ... )
IsAccessible
Returns Boolean 1 (true) if the report is run with the accessibility features enabled. Use this function
as a variable expression with a conditional block to make your reports accessible. For example,
you can add a list or crosstab equivalent to a chart in reports that are run with accessibility features
enabled.
Syntax
IsAccessible()
IsBursting
Returns Boolean 1 (true) when the report will be distributed to the recipient; otherwise, returns
Boolean 0 (false).
Syntax
IsBursting ('recipientName')
IsCrosstabColumnNodeMember
Returns Boolean 1 (true) if the current node is a crosstab column node member.
Syntax
IsCrosstabColumnNodeMember ()
IsCrosstabRowNodeMember
Returns Boolean 1 (true) if the current node is a crosstab row node member.
Syntax
IsCrosstabRowNodeMember ()
IsFirstColumn
Returns Boolean 1 (true) if the current column is the first column.
Syntax
IsFirstColumn ()
IsInnerMostCrosstabColumnNodeMember
Returns Boolean 1 (true) if the current node is an innermost crosstab column node member.
Syntax
IsInnerMostCrosstabColumnNodeMember ()
IsInnerMostCrosstabRowNodeMember
Returns Boolean 1 (true) if the current node is an innermost crosstab row node member.
Syntax
IsInnerMostCrosstabRowNodeMember ()
IsLastColumn
Returns Boolean 1 (true) if the current column is the last column.
Syntax
IsLastColumn ()
IsLastInnerMostCrosstabColumnNodeMember
Returns Boolean 1 (true) if the current node is the last innermost crosstab column node member.
Syntax
IsLastInnerMostCrosstabColumnNodeMember ()
IsLastInnerMostCrosstabRowNodeMember
Returns Boolean 1 (true) if the current node is the last innermost crosstab row node member.
Syntax
IsLastInnerMostCrosstabRowNodeMember ()
IsOuterMostCrosstabColumnNodeMember
Returns Boolean 1 (true) if the current node is an outermost crosstab column node member.
Syntax
IsOuterMostCrosstabColumnNodeMember ()
IsOuterMostCrosstabRowNodeMember
Returns Boolean 1 (true) if the current node is an outermost crosstab row node member.
Syntax
IsOuterMostCrosstabRowNodeMember ()
IsPageCountAvailable
Returns Boolean 1 (true) if the page count is available for the current execution of the report; otherwise, returns Boolean 0 (false).
Syntax
IsPageCountAvailable ()
ln
Returns the natural logarithm of "numeric_expression".
Syntax
ln ( numeric_expression )
Locale
Returns the run locale.
Syntax
Locale ()
lower
Returns "string_expression" with all uppercase characters converted to lowercase. This function
appears in the Bursted Sales Performance Report sample report in the GO Data Warehouse (query)
package.
Syntax
lower ( string_expression )
mapNumberToLetter
Adds "integer_expression" to "string_expression".
Syntax
mapNumberToLetter ( string_expression , integer_expression )
Example
mapNumberToLetter ( 'a' , 1 )
Result: b
mod
Returns an integer value representing the remainder (modulo) of "integer_expression1" / "integer_
expression2".
Syntax
mod ( integer_expression1 , integer_expression2 )
ModelPath
Returns the model path.
Syntax
ModelPath ()
Now
Returns the current system time.
Syntax
Now ()
nullif
Returns null if "string_expression1" equals "string_expression2" (case-insensitive), otherwise
returns "string_expression1".
Syntax
nullif ( string_expression1 , string_expression2 )
octet_length
Returns the number of bytes in "string_expression".
Syntax
octet_length ( string_expression )
PageCount
Returns the current page count. This function works only when the report output is Adobe PDF
or Microsoft Excel. If you save the report output, this function works for all formats.
Syntax
PageCount ()
PageName
Returns the current page name.
Syntax
PageName ()
PageNumber
Returns the current page number.
Syntax
PageNumber ()
ParamCount
Returns the parameter count of "parameterName".
Syntax
ParamCount ('parameterName')
ParamDisplayValue
Returns a string that is the parameter display value of "parameterName". This function appears
in the Recruitment Report sample report in the GO Data Warehouse (analysis) package.
Syntax
ParamDisplayValue ('parameterName')
ParamName
Returns the parameter name of "parameterName".
Syntax
ParamName ('parameterName')
ParamNames
Returns all parameter names.
Syntax
ParamNames ()
ParamValue
Returns the parameter value of "parameterName".
Syntax
ParamValue ('parameterName')
position
Returns the integer value representing the starting position of "string_expression1" in "string_
expression2". Returns 0 if "string_expression1" is not found.
Syntax
position ( string_expression1 , string_expression2 )
power
Returns "numeric_expression1" raised to the power of "numeric_expression2".
Syntax
power ( numeric_expression1 , numeric_expression2 )
Example
power ( 3 , 2 )
Result: 9
ReportAuthorLocale
Returns the author locale.
Syntax
ReportAuthorLocale ()
ReportCreateDate
Returns the date when the report was created.
Syntax
ReportCreateDate ()
ReportDate
Returns the report execution date and time.
Syntax
ReportDate ()
ReportDescription
Returns the report description. This function works only when the report is run from IBM Cognos
Connection.
Syntax
ReportDescription ()
ReportID
Returns the report ID.
Syntax
ReportID ()
ReportLocale
Returns the run locale.
Syntax
ReportLocale ()
ReportName
Returns the report name. This function works only when the report is run from IBM Cognos
Connection.
Syntax
ReportName ()
ReportOption
Returns the value of the run option variable identified by "optionName", such as attachmentEncoding, burst, cssURL, email, emailAsAttachment, emailAsURL, emailBody, emailSubject, emailTo,
emailToAddress, history, metadataModel, outputEncapsulation, outputFormat, outputLocale,
outputPageDefinition, outputPageOrientation, primaryWaitThreshold, print, printer, printerAddress,
prompt, promptFormat, saveAs, saveOutput, secondaryWaitThreshold, verticalElements, or xslURL.
Syntax
ReportOption ('optionName')
ReportOutput
Returns the name of the output format, such as CSV, HTML, layoutDataXML, MHT, PDF,
rawXML, singleXLS, spreadsheetML, XLS, XML, or XLWA.
Syntax
ReportOutput ()
ReportPath
Returns the report path. This function works only when the report is run from IBM Cognos
Connection.
Syntax
ReportPath ()
ReportProductLocale
Returns the product locale.
Syntax
ReportProductLocale ()
ReportSaveDate
Returns the date when the report was last saved.
Syntax
ReportSaveDate ()
round
Returns "numeric_expression" rounded to the nearest value with "integer_expression" significant
digits to the right of the decimal point. If "integer_expression" is negative, "numeric_expression"
is rounded to the nearest absolute value with "integer_expression" significant digits to the left of
the decimal point. Rounding takes place before data formatting is applied.
Syntax
round ( numeric_expression , integer_expression )
Example
round (125, -1)
Result: 130
RowNumber
Returns the current row.
Syntax
RowNumber ()
ServerLocale
Returns the locale of the server that runs the report.
Syntax
ServerLocale ()
ServerName
Returns the name of the web server where the run request originated from. The value may be empty
if the request is executed from the scheduler.
Syntax
ServerName ()
sqrt
Returns the square root of "numeric_expression". "Numeric_expression" must not be a negative
value.
Syntax
sqrt ( numeric_expression )
substring
Returns the substring of "string_expression" that starts at position "integer_expression1" for
"integer_expression2" characters or to the end of "string_expression" if "integer_expression2" is
-1. The first character in "string_expression" is at position 1.
Syntax
substring ( string_expression , integer_expression1 , integer_expression2 )
Example
substring ( [Sales (analysis)].[Sales staff].[Sales staff].[Sales
staff].[Position code], 3 , 5 )
TOCHeadingCount
Returns the table of contents heading count for a specified heading level.
Syntax
TOCHeadingCount ( headingLevel )
Today
Returns the current system date.
Syntax
Today ()
trim
Returns "string_expression" trimmed of any leading and trailing blanks or trimmed of the character
specified by "match_character_expression". "Trim_what_expression" may be "leading", "trailing",
or "both" (default). "Match_character_expression" can be an empty string to trim blanks or can
specify a character to be trimmed.
Syntax
trim ( trim_what_expression , match_character_expression , string_expression )
upper
Returns "string_expression" with all lowercase characters converted to uppercase.
Syntax
upper ( string_expression )
URLEncode
Returns the URL encoded value of the input text.
Syntax
URLEncode ('text')
Syntax
date2string ( date_expression )
date2timestamp
Converts "date_expression" to a timestamp. The time part of the timestamp will equal zero.
Syntax
date2timestamp ( date_expression )
date2timestampTZ
Converts "date_expression" to a timestamp with a time zone. The time and time zone parts of the
timestamp will equal zero.
Syntax
date2timestampTZ ( date_expression )
DTinterval2string
Returns a date time interval as a string in DDDD HH:MM:SS.FFFFFFF or -DDDD HH:MM:SS.FFF
format.
Syntax
DTinterval2string ( date_time_interval_expression )
DTinterval2stringAsTime
Returns a date time interval as a string in HHHH:MM:SS.FFFFFFF or HH:MM:SS.FFF format.
Days are converted to hours.
Syntax
DTinterval2stringAsTime ( date_time_interval_expression )
int2DTinterval
Converts an integer to a date time interval. "String_expression" specifies what "integer_expression"
represents: "ns" = nanoseconds, "s" = seconds (default), "m" = minutes, "h" = hours, "d" = days.
Syntax
int2DTinterval ( integer_expression , string_expression )
Example 1
int2DTinterval (1020,"h")
Example 2
int2DTinterval (1020,"s")
Result: 17 minutes
int2YMinterval
Converts "integer_expression" to a year month interval. "String_expression" specifies what "integer_
expression" represents: "y" = years, "m" = months (default).
Syntax
int2YMinterval ( integer_expression , string_expression )
number2string
Converts "numeric_expression" to a string, using the %g format specifier (C/C++ syntax).
Syntax
number2string ( numeric_expression )
string2date
Returns "string_expression" as a date in YYYY-MM-DD format.
Syntax
string2date ( string_expression )
string2double
Returns a floating point number. "String_expression" has the following form: "[whitespace] [sign]
[digits] [digits] [ {d|D|e|E }[sign]digits]"
Syntax
string2double ( string_expression )
string2DTinterval
Returns "string_expression" as a date time interval in [-]DD HH:MM[:SS[.FFF]] format.
Syntax
string2DTinterval ( string_expression )
string2int32
Returns an integer. "String_expression" has the following form: "[whitespace] [{+|-}] [digits]"
Syntax
string2int32 ( string_expression )
string2int64
Returns a long integer. "String_expression" has the following form: "[whitespace] [{+|-}] [digits]"
Syntax
string2int64 ( string_expression )
string2time
Returns "string_expression" as a time in HH:MM:SS.FFFFFFF format.
Syntax
string2time ( string_expression )
string2timestamp
Returns "string_expression" as a timestamp in YYYY-MM-DD [T|t|[white space]+]
HH:MM:SS.FFFFFFF format.
Syntax
string2timestamp ( string_expression )
string2timestampTZ
Returns "string_expression" in YYYY-MM-DD HH:MM:SS.FFFFFFF +HHMM or YYYY-MMDD [T|t] HH:MM:SS.FFF -HHMM format.
Syntax
string2timestampTZ ( string_expression )
string2YMinterval
Returns "string_expression" as a Year Month Interval in [-]YY MM format.
Syntax
string2YMinterval ( string_expression )
time2string
Returns a time as a string in HH:MM:SS.FFF format.
Syntax
time2string ( time_expression )
timestamp2date
Converts "timestamp_expression" to a date. The time part of the timestamp will be ignored.
Syntax
timestamp2date ( timestamp_expression )
timestamp2string
Returns a timestamp as a string in YYYY-MM-DD HH:MM:SS.FFFFFFF format.
Syntax
timestamp2string ( timestamp_expression )
timestamp2timestampTZ
Converts "timestamp_expression" to a timestamp with a time zone. The displacement part of the
timestamp with the time zone will be zero.
Syntax
timestamp2timestampTZ ( timestamp_expression )
timestampTZ2date
Converts "timestamp_time_zone_expression" to a date. The time and time zone parts of the
timestamp will be ignored.
Syntax
timestampTZ2date ( timestamp_time_zone_expression )
timestampTZ2string
Returns a timestamp with the time zone as a string in YYYY-MM-DD HH:MM:SS.FFFFFFF
+HHMM or YYYY-MM-DD HH:MM:SS.FFF -HHMM format.
Syntax
timestampTZ2string ( timestamp_time_zone_expression )
timestampTZ2timestamp
Converts "timestamp_time_zone_expression" to a timestamp. The displacement part of the timestamp
with the time zone will be ignored.
Syntax
timestampTZ2timestamp ( timestamp_time_zone_expression )
timeTZ2string
Returns a time with the time zone as a string in HH:MM:SS.FFF +HHMM or HH:MM:SS.FFFFFFF
-HHMM format. For example, -05:30 means a timezone of GMT minus 5 hours and 30 minutes
Syntax
timeTZ2string ( timeTZ_expression )
YMinterval2string
Returns "year_month_interval_expression" as a string in (YY MM) or -(YY MM) format.
Syntax
YMinterval2string ( year_month_interval_expression )
An underlined letter on the screen designates an accelerator; for example, F is the accelerator
for the File menu. In Microsoft Windows, press the Alt key, then the accelerator to trigger
an action; for example, Alt+F shows the File menu. If they are enabled, you can also use extended
accelerators.
Command keys directly trigger an action and usually make use of the Ctrl keys. For example,
to print, press Ctrl+P.
Description
Shortcut
Context-sensitive help
F1
New file
Ctrl + N
Open file
Ctrl + O
Save file
Ctrl + S
Undo
Ctrl + Z
Redo
Ctrl + Y
Cut
Ctrl+X
Copy
Ctrl+C
571
Description
Shortcut
Paste
Ctrl+V
Delete
Del
Description
Diagram shortcut
Autolayout as a tree
Ctrl + A
Autolayout as a star
Ctrl + S
Zoom in
Ctrl + +
Zoom out
Ctrl + -
Ctrl + 0
Zoom to 100%
Ctrl + 1
Undo
Ctrl + Z
Redo
Ctrl + Y
Ctrl + D
Del
Description
Rename
F2
Delete
Del
Zoom In
Ctrl + +
Zoom out
Ctrl + -
Ctrl + 0
Zoom to 100%
Ctrl + 1
Undo
Ctrl + Z
Redo
Ctrl + Y
any unit of measure information that exists in SAP BW is automatically appended to the data
value
you cannot define a format for each currency in a multi-currency query subject.
Calendar Type
Specifies the type of calendar to be displayed. The date values will be mapped to the selected calendar
before being formatted. The default value is inherited from the user's content language. Note that
the Japanese Imperial setting is only applicable for Japanese languages.
Clock
Specifies whether to display the time in 12-hour or 24-hour format. The default value is inherited
from the user's content language.
Currency
Specifies the currency to be used. The default currency symbol will be displayed unless the values
of the Currency Display and Currency Symbol properties are changed. The default value is inherited
from the model.
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
575
Currency Display
Specifies whether to display the international or local currency symbol. By default, the local currency
symbol is displayed.
Currency Symbol
Specifies a character or characters to use as the symbol to identify the local currency. This symbol
will precede the number and any sign, even if it is a leading sign. A space between the symbol and
the numeric value can be specified by entering it in this property, after the symbol. The default
value is inherited from the user's content language.
Date Ordering
Specifies the order in which to display the day, month, and year. The default value is inherited from
the user's content language.
Date Separator
Specifies the character to be displayed between the year, month, and day. The default value is
inherited from the user's content language.
Date Style
Specifies the date style. The results rendered are determined by the language. Generally, Short uses
only numbers, Medium uses some abbreviated words, Long uses complete words, and Full includes
all available details.
Decimal Separator
Specifies the character that will separate non-decimal numbers from decimals. This property is
ignored if no decimals are displayed. The default value is inherited from the user's content language.
Display AM / PM Symbols
Specifies whether to display the AM or PM symbols. The default value is inherited from the user's
content language.
Display As Exponent
Specifies whether to render values in scientific notation, using exponents. If this property is set to
No, scientific notation will not be used. If this property is not specified, scientific notation will be
Display Days
Specifies whether to display the day. The format of the day can be controlled by selecting one of
the specific formats. Selecting Julian means that the 3-digit day of the year will be displayed. The
default value is inherited from the user's content language.
Display Eras
Specifies whether to display the era. The default value is inherited from the user's content language.
Display Hours
Specifies whether to display the hours. The default value is inherited from the user's content language.
Display Milliseconds
Specifies whether to display the milliseconds. The format of the milliseconds can be controlled by
selecting one of the specific formats. This property is ignored if seconds are not displayed. The
default value is inherited from the user's content language.
Display Minutes
Specifies whether to display the minutes. The format of the minutes can be controlled by selecting
one of the specific formats. The default value is inherited from the user's content language.
Display Months
Specifies whether to display the month. The format of the month can be controlled by selecting one
of the specific formats. The default value is inherited from the user's content language.
Display Months
Specifies whether to display the month.
Display Seconds
Specifies whether to display the seconds. The format of the seconds can be controlled by selecting
one of the specific formats. The default value is inherited from the user's content language.
Display Weekdays
Specifies whether to display the weekday. The format of the weekday can be controlled by selecting
one of the specific formats. The default value is inherited from the user's content language.
User Guide 577
Display Years
Specifies whether to display the year. The first two digits of the year, which indicate the century,
can be controlled by selecting one of the associated property values. The default value is inherited
from the user's content language.
Display Years
Specifies whether to display the year.
Exponent Symbol
Specifies the character to be displayed to identify exponents if the scientific notation is used. The
symbol will be rendered after the number, separated by a space. The default value is inherited from
the user's content language.
Mantissa (digits)
Specifies the number of digits to be displayed following the exponent symbol if the scientific notation
is used.
Negative Pattern
Specifies a presentation format, based on patterns, for negative numbers. Some restrictions exist.
The numerical part of the negative pattern is ignored. Only the suffix and the prefix are used. For
example, in the pattern ABC#,##0.#EFG, ABC is the prefix, EFG is the suffix and #,##0.# is the
numerical part of the pattern.
Padding Character
Specifies the character that will be used to pad values that have fewer digits than the minimum
number of digits. The default value is inherited from the user's content language.
Pattern
Specifies a presentation format that is based on patterns. The pattern format overrides formats
specified in other properties. For example, to format the date as 2009/12/31 23:59:59 PM, use the
pattern yyyy/mm/dd hh:mm:ss aa. For example, to format thousands using the letter K, set the
Format Type to Number, set the Scale to -3 (to remove 000), and then use the pattern to ####K.
Percentage Symbol
Specifies whether to display the values per hundred (percent) or per thousand. The symbol will be
appended to the number and any trailing sign. A space between the numeric value and the symbol
can be specified by entering it in this property, after the symbol. The default value is inherited from
the user's content language.
Scale
Specifies how many digits to move the decimal delimiter for formatting purposes. For example,
move the decimal three spaces to present values in thousands. The default value is inherited from
the database field.
Thousands Separator
Specifies how to delimit digit groups, such as thousands. This property is only used if the Use
Thousands Separator property is set to Yes. The default value is inherited from the user's content
language.
Time Separator
Specifies the character to be displayed between the hour, minute, and second. The default value is
inherited from the user's content language.
Time Style
Specifies the time style to be displayed. The exact results that will be rendered are determined by
the language. Generally, Short means that the minimum details will be displayed, Long adds seconds,
and Full means that all details are displayed, including the time zone. The default value is inherited
from the user's content language.
580 IBM Cognos Framework Manager
Time Unit
Specifies the unit of measure of the value. This property will be ignored if any day or time components are shown. The default value is inherited from the user's content language.
Pattern Guidelines
When you define a pattern, the number of symbols you use affects how the data will be shown.
There are different rules for text, numbers, and values that can take the form of text or numbers.
Text
You can specify whether text is produced in full or abbreviated form.
Number of symbols
Meaning
Example
4 or more
Less than 4
Abbreviated form
Numbers
The number of symbols you use in a pattern sets the minimum number of digits that are produced
in a report. Numbers that have fewer digits than specified are zero-padded. For example, if you
specify mm for minutes, and the database value is 6, the report will show 06.
Note: The year value is handled differently. If you specify two symbols for year, the last two digits
of the year value is produced. For example, yyyy produces 1997, and yy produces 97.
583
Number of symbols
Meaning
Example
3 or more
Text
Less than 3
Numbers
MM produces 01
M produces 1
Locale Group A
Locales: af-za, en, en-au, en-be, en-bw, en-ca, en-gb, en-hk, en-ie, en-in, en-mt, en-nz, en-ph, en-sg,
en-us, en-vi, en-za, fo-fo, gl-es, id, id-id, is, is-is, it, it-ch, it-it, kk-kz, ms, ms-bn, ms-my, nb-no, nl,
nl-be, nl-nl, no, no-no, om-et, om-so, pl, pl-pl, pt, pt-br, pt-pt, so-dj, so-et, so-ke, so-so, sv, sv-fi,
sv-se, sw-ke, sw-tz
Meaning
Symbol
Presentation
Example
Era
Text
AD
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Day in year
Number
189
Day in month
Number
10
Number
Number
Day in week
Text
Tuesday
Meaning
Symbol
Presentation
Example
Text
pm
Number
24
Number
Number
12
Number
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Single quote
''
n/a
'
Locale Group B
Locales: be-by, bg-bg, el, el-gr, fi, fi-fi, hr, hr-hr, hu, hu-hu, ja, ja-jp, ko, ko-kr, ro, ro-ro, ru, ru-ua,
ru-ru, sh-yu, sk, sk-sk, sl-si, sq-al, sr-sp, th, tr, tr-tr, uk-ua, zh, zh-cn, zh-hk, zh-mo, zh-sg, zh-tw
Meaning
Symbol
Presentation
Example
Era
Text
AD
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Meaning
Symbol
Presentation
Example
Day in year
Number
189
Day in month
Number
10
Number
Number
Day in week
Text
Tuesday
Text
pm
Number
24
Number
Number
12
Number
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Single quote
''
n/a
'
Locale Group C
Locales: ca-es, cs, cs-cz, da, da-dk, es, es-ar, es-bo, es-cl, es-co, es-cr, es-do, es-ec, es-es, es-gt, es-hn,
es-mx, es-ni, es-pa, es-pe, es-pr, es-py, es-sv, es-us, es-uy, es-ve, eu-es, mk-mk
Meaning
Symbol
Presentation
Example
Era
Text
AD
Meaning
Symbol
Presentation
Example
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Day in year
Number
189
Day in month
Number
10
Number
Number
Day in week
Text
Tuesday
Text
pm
Number
24
Number
Number
12
Number
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Meaning
Symbol
Presentation
Example
Single quote
''
n/a
'
Locale Group D
Locales: de, de-at, de-be, de-ch, de-de, de-lu
Meaning
Symbol
Presentation
Example
Era
Text
AD
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Day in year
Number
189
Day in month
Number
10
Number
Number
Day in week
Text
Tuesday
Text
pm
Number
24
Number
Number
12
Number
Meaning
Symbol
Presentation
Example
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Single quote
''
n/a
'
Locale Group E
Locales: fr, fr-be, fr-ca, fr-ch, fr-fr, fr-lu
Meaning
Symbol
Presentation
Example
Era
Text
AD
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Day in year
Number
189
Day in month
Number
10
Number
Number
Day in week
Text
Tuesday
Text
pm
Meaning
Symbol
Presentation
Example
Number
24
Number
Number
12
Number
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Single quote
''
n/a
'
Meaning
Symbol
Presentation
Example
Era
Text
AD
Year
Number
1996
Number
1996
Month in year
July and 07
Week in year
Number
27
Week in month
Number
Day in year
Number
189
Day in month
Number
10
Locale Group F
Locales: ga-ie
Meaning
Symbol
Presentation
Example
Number
Number
Day in week
Text
Tuesday
Text
pm
Number
24
Number
Number
12
Number
Minute in hour
Number
30
Second in minute
Number
55
Millisecond
Number
978
Time zone
Text
'
n/a
n/a
Single quote
''
n/a
'
Symbol
Meaning
Symbol
Meaning
Separates formats for positive numbers and formats for negative numbers.
'
/u221E
Infinity symbol.
/uFFFD
593
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
Limitations
The data source must be a specifically constructed query defined in the SAP BW data source.
For general information about creating packages, see "Create or Modify a Package" in the Framework Manager User Guide.
Steps
1. In Query Designer, click New Query.
2. In the New Query dialog box, select the information provider that contains the cube that you
want to import.
3. Click the Tools icon
4. Drag a characteristic that you wish to import from the InfoObject catalog on the left column
to one of the fields on the right-hand side of the page. For example, Columns or Rows.
The characteristics you select will define the metadata in the Transformer cube. The characteristics must adhere to the following restrictions:
You must have at least a single optional variable to segment the data.
Select a characteristic that is representative of the data source. The characteristics can be
either key figures, which will become measures in Transformer, or dimensions, which will
become the Transformer dimensions.
Do not assign any of the characteristics a display hierarchy, either explicitly or by a variable.
Ensure that all selected key figures use the same currency.
Only include characteristics in the SAP BW query that you wish to extract using Framework
Manager. Including unnecessary characteristics increases data volume, thereby adversely
affecting performance.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
Characteristics must be copied to the Columns or Rows fields of the query definition. If
copied to the Free Characteristics or the Filter fields, the characteristics show as dimensions
when importing from the package but the stream extract processing is not able to fetch the
values.
If you have filters defined, they must reference only dimensions that have been included
elsewhere in the query definition.
If you include a free characteristic, no values will appear for that characteristic in the key
figures extract. A filter on a free characteristic acts as a filter on the returned SAP BW data.
You can use this as a filter to define a subset of an InfoCube.
Use a picklist prompt, rather than a type-in prompt for the query. A picklist prompt provides
values for segmenting the data.
5. To define the metadata that will populate the Transformer cube, you must change the properties
of each characteristic that you have selected for inclusion. Right-click a characteristic, and select
Properties.
6. In the Properties of Characteristic dialog box, change the Display As value to Key, and the
Suppress Results Rows value to Always. Note that any restriction or filter applied here will be
carried forward in Transformer.
7. Repeat steps 5 and 6 for each characteristic that you selected in step 4.
Note: You should only select the characteristics that you require. To avoid excessive memory
consumption, and decreased system performance or failure, carefully consider what characteristics you want to include in the query. We recommend that you consult an SAP BW administrator to ensure that the data volumes are not exceeded.
8. Click the Queries Properties icon
to this Query check box. This exposes the query to Framework Manager.
9. Click Save, and provide the new query with a Description and a Technical Name. We recommend
that you use the SAP BW naming convention in the Technical Name field. That is, begin the
entry with the letter 'Z' followed by an intuitive name or your standard naming convention. It
is important to write down this technical name, as you will need it to find the query in Framework Manager.
You are now ready to create a variable (p. 595). For more information on using the SAP Query
Designer, see your SAP BW documentation.
Create a Variable
You must now create an optional prompt parameter for the query so Transformer can issue smaller
queries to SAP, and thereby retrieve the entire data set.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
A basic guideline to follow is that when a variable is utilized for the extraction, Transformer will
first fetch all members that exist for the dimension against which the variable is defined. After this,
Transformer will perform individual data fetches to extract the fact data for each of the individual
members within the dimension in order to satisfy the variable.
This allows Transformer to break down your data extraction into manageable chunks that the SAP
BW server can handle. There are no set standards as to which dimension to apply it to. To achieve
optimal performance, you must understand your SAP BW data and determine which dimension
evenly breaks up the factual data.
You must choose carefully which dimension to define the variable on. It may require some experimentation to achieve optimal performance. For example, you may have a [COUNTRY] dimension
that contains three countries as members, United States (US), Canada (CA), and Mexico (MX). If
most of the business is performed in the US (90%) and the remaining business (10%) is recorded
against Canada and Mexico evenly, this dimension would not evenly split up the data. The resulting
queries would have one very large request (US) and two small ones (CA and MX). Therefore, this
dimension would not be a good candidate.
You do not want to apply a variable on a dimension that would cause too many very small requests.
For example, [0MATERIAL], a dimension often utilized in SAP BW environments would probably
not be a good candidate because it would cause too many small requests to be performed.
You may have a dimension defined for [COSTCENTER] that evenly divides up the data for 10
distinct cost centers that may serve to segment the data evenly. Another good alternative may be
calendar year or calendar month because it may divide your data into sections that perform adequately.
It is not necessary to apply any variables to queries for data extraction. Some extraction will perform
perfectly well when no variables are applied. For example, a good approach may be to apply a
variable on a dimension which splits the data into 20 individual fetches and test the extraction. If
this performs well, you may choose to apply a variable on a different dimension which may contain
5 distinct members and see how it compares.
No formula can be applied as no two environments are alike. However, a cautious approach is
recommended to avoid disrupting your SAP BW environment.
Steps
1. In Query Designer, right-click a characteristic that you have selected in the previous procedure
and select Restrict.
To ensure that data is distributed evenly, select a characteristic that is representative of the cube
and will not result in a large number of values. You want a resulting variable where the number
of rows for each value of the variable is similar; you do not want a resulting variable that is
too fine-grained (for example, not many rows per value resulting in an excessive number of
queries), nor do you want a variable that is too coarse-grained (for example, more than one
million rows per value).
2. In the Selection for dialog box, click the Variables tab, right-click anywhere inside the
Description window and select New Variable.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
Note: If one of the characteristics that you have chosen already has a variable, you can avoid
creating a new variable and skip to step 7 of this procedure.
3. In the New Variable Wizard General Information page, type a Variable Name and Description,
and select a dimension as the characteristic. Click Next.
4. In the Details page, select Single Value, Multiple Single Values, or Interval in the Variable
Represents field, Optional in the Variable entry is field, and select the Ready for Input check
box. Click Next.
5. In the Default Values page, ensure that the Default Value field is empty.
6. Click Next until you are returned to Selection for dialog box. The new variable appears in
the Description window.
7. Select the variable and click the right arrow
Selection window, and save the query. You are now ready to import the query in Framework
Manager.
Import the SAP BW metadata using the MetaData Wizard (p. 598)
Framework Manager imports the SAP BW query into a model, and defines a package that it
exports to Content Manager.
When importing, note the following:
The dimensions selected in the SAP BW query are available in the Dimension Folders in
the Import dialog box.
Always select the primary hierarchy whose name matches the hierarchy.
If other hierarchies are available, select one that gives the desired set of levels within the
hierarchy.
Framework Manager imports time dimensions into the model from the SAP BW data source
only if a configuration parameter is turned on. Setting the configuration as a time dimension
is a global entry; every imported dimension will then be treated as time strings.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
must be in the package for querying to work correctly. You can hide the hierarchy if you don't
want it visible.
5. Select the main query items that directly relate to the level. That is, those labeled (Key), (Name),
and so on.
Tip: Secondary or additional attributes are removed on import to Transformer. Only items
that are needed are imported. However, to improve performance, we recommend that you do
not select secondary or additional attributes. If you select all the attributes here, you can exclude
unwanted query items when publishing the package.
6. Complete the remaining screens in the Metadata Wizard, accepting the default values, and click
Next. This will generate dimensions and import the metadata.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
7. At the final wizard screen, verify the results, and click Finish.
5. Choose whether to use the default access permissions for the package:
User Guide 599
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
6. When you are prompted to open the Publish Package Wizard, click Yes.
7. Select the default values, and click Publish. This will publish the package to the content store,
and will allow you to access the package in Transformer.
8. At the final screen verify the results, and click Finish.
You are now ready to create a model in Transformer. For more information on creating a package,
see "Create or Modify a Package" in the Framework Manager User Guide.
creates a single query for each dimension and for the facts.
imports facts and dimensions in the same manner as dimensionally-modeled relational models.
That is, facts and dimensions are imported at the same time.
ensures that the scope is set properly between the dimensions and facts.
populates the dimension with the appropriate business key and caption information.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
only imports the necessary items from the BW package required for cube building, when the
metadata is imported. This reduces the number of attributes and keeps the data volumes to
only the necessary items for cube building.
If you want to define business rules, do so in the Transformer model rather than in Framework
Manager. Calculations that you define in Framework Manager are not imported into Transformer.
Steps
1. In Transformer, click Create a new model.
2. In the New Model Wizard, click Cancel.
3. With the Dimension Map pane selected, from the Edit menu, click Insert Dimension from
Package.
4. Click Browse to open the metadata browser.
5. In the Browse Metadata dialog box, select the package that contains your SAP BW query and
click OK.
6. In the Insert Dimension from Package dialog box, click Finish.
7. In the Select Dimension and Measures from Package dialog box, click the dimensions and
measures to include in the data source.
Select a query item that will provide the dates for the PowerCube. Note that the dates for the
PowerCube can be derived entirely from the transaction data.
8. If there are errors or warnings, you are notified. In the Data Sources pane, expand the package
to view the data source queries and query items. Key figures or measures appear in the Measures
pane.
Ensure that the aggregation rule for each measure is correctly defined within Transformer to
align as closely as possible with the aggregation rule defined in SAP BW.
It is recommended that the storage type for all measures be set to 64-bit floating point.
For the root level of each characteristic (dimension), ensure it is marked as unique.
SAP BW presentation hierarchies may contain ragged paths, typically in association with the
"not assigned" and "#" nodes in the hierarchy. The gaps in these hierarchies produce blanks
at the associated level in the Transformer hierarchy. In Transformer, it is possible to define the
text that should be used for blanks (the default text is "<blank>"). A best practice is to define
a more appropriate text for blank entries for all such levels.
9. If you want to add another query, repeat steps 3 to 7.
Tip: If you add a new dimension to a model after adding the measures, Transformer does not
automatically add the key for the new dimension to the Key Figures. As a result, the scope is
not defined in the Dimension Map. In such situations, you must manually add the key for the
new dimension from the lowest level of the dimension to the Key Figures.
10. Save the model.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
You can now use this model to create PowerCubes for use with the desired IBM Cognos component,
accessing the dimensional and fact data from the original SAP BW data source. For more information,
see the section "Create a Model" in the Transformer User Guide.
Extract Size
The Extract Size data source property within Framework Manager controls the amount of data
retrieved from SAP BW at any one time.
If this setting is negative, zero, or empty, a single query is issued to SAP BW to extract the characteristic data.
If this setting is a positive value, Framework Manager issues multiple queries to SAP BW, each of
which returns approximately the number of megabytes specified by the Extract Size property.
This feature can reduce the overall size of the query result on the SAP BW server. Overall query
execution may take longer, but for large characteristics, not using this feature may result in consumption of a user's allotted memory space on the SAP BW server.
The entire data for a characteristic dimension will be in memory within Framework Manager prior
to the production of an extract file. It is important that only the required query items be extracted
from SAP BW to ensure that an extract does not fail due to memory allocation errors within
Framework Manager.
Model query subjects are extracted using the same mechanism by which queries are executed within
IBM Cognos. Therefore, the Extract Size property has no effect on the query execution.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
Measure Dimensions
When extracting a measure dimension, you should create a model query subject containing the
measures that you want. You should include the business key query item from each of the levels of
each dimension, depending on the level of granularity that you are trying to achieve.
For information about externalizing model query subjects, see "Framework Manager Considerations" (p. 605).
Characteristic Dimensions
Characteristic dimensions are externalized independent of the type of SAP BW data source, such
as InfoCube or SAP BW query.
Framework Manager uses a single approach to externalize all dimensions that do not contain fact
query items. In these cases, the extract size configuration setting is used to control the manner in
which data is extracted from SAP BW.
Note: Model query subjects are externalized in a different manner, regardless of whether they
contain fact query items or not. For information about externalizing model query subjects, see
"Framework Manager Considerations" (p. 605).
Set the characteristic display to Key. Setting the display to anything else may result in incorrect
data.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
To change what appears for a characteristic, right-click the characteristic and click Properties.
In the Properties of Characteristic dialog box, change the Display As value to Key.
We strongly recommend that you use Key.
To reduce data volumes, as well as the amount of aggregation performed by the SAP BW server,
we strongly recommend that summarization for all characteristics in the query be disabled in
its property sheet.
To disable summarization for a characteristic, right-click the characteristic along the edge of
the SAP BW query and click Properties. In the Properties dialog box, set the Suppress Results
Rows value to Always.
If at least one characteristic in an SAP BW query is displayed as something other than Key,
then summarization for all characteristics must be suppressed.
None of the characteristics may be assigned a display hierarchy, either explicitly or by a variable.
The values of each key figure should be in a single currency. A variable should not be used to
drive the assignment of a target currency.
Include in the SAP BW query only those characteristics which are to be extracted using
Framework Manager. Including unnecessary characteristics increases the volume of data
transferred from SAP BW, thus affecting performance.
NULL values
# symbols
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
REST_H
Not assigned
Because such duplicate tokens can cause problems in Transformer, in unique levels for example,
we recommend that you assign filters to the dimension so that they do not appear in the imported
data.
Finally, remember to select only those query items needed to generate your filtered data.
It must be optional.
If an SAP BW query contains such a variable and the key figures dimension is externalized,
Framework Manager runs a query for each possible value associated with a variable. Thus, by
choosing an appropriate characteristic, the key figures dimension can be extracted without
exceeding the memory restrictions of either the client or server. Memory caches on the client and
server are flushed after each query.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
If a presentation hierarchy is used to drive the creation of extract sections, it is important that the
values for a variable be obtained from a single level in the hierarchy, otherwise the extract will
contain data summarized at different levels. To restrict the values for a variable to a single level of
a hierarchy, edit the Level Restriction of the variable in Framework Manager. For example, using
a value such as "2:2" indicates that only values from the second level of the hierarchy are to be
used (level 0 is the root of a hierarchy).
In the presence of an SAP BW query with one such variable, the value of the variable is reset after
each query.
If an SAP BW query contains anything more than a single variable, or one that is defined differently
than described above, Framework Manager does not attempt to use a variable to break the
extraction of the key figures dimension into smaller sections.
externalizing the data takes longer to perform than the timeout period assigned to passports
within IBM Cognos Configuration
The extract of each characteristic must have a common key query item that is equivalent to a
surrogate key query item in the key figures extract.
For an extract based on an SAP BW query, it is strongly recommended that all characteristics
be displayed as Key in the SAP BW query.
If a characteristic does not have a presentation hierarchy, or a new one is desired, extract one
or more query items that can form the basis for levels in a hierarchy.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
During the import of SAP BW metadata into a model that will extract data, limit the model to
only those query items that are absolutely required to build a PowerCube. This will improve
data extract performance.
Null values are included in CSV files when externalizing SAP BW-based query subjects and
dimensions.
A practical limit for PowerCubes is 2,000,000 categories (values) for a dimension (characteristic).
Transformer Guidelines
When using the SAP BW data that you extracted from Framework Manager, keep these considerations in mind.
In Transformer version 8.3, you can insert regular dimensions from SAP data sources directly
from a IBM Cognos data source, using the Insert dimension from package option.
Using the model wizard in Transformer, insert a data source of type Delimited-Field Text With
Column Titles and start by selecting the CSV file. Do not run auto-design.
Drag all the key figure columns from the Data Sources pane into the Measures pane. Ensure
that the aggregation rule for each measure is correctly defined within Transformer to align as
closely as possible with the aggregation rule defined in SAP BW.
It is recommended that the storage type for all measures be set to 64-bit floating point.
Using the date wizard, select a query item that will provide the dates for the PowerCube. Note
that the dates for the PowerCube can be derived entirely from the transaction data.
Insert the various CSV files corresponding to the characteristics that were externalized using
Framework Manager.
Each CSV file contains a column that corresponds to a column in the key figures CSV file. By
right-clicking the various columns and editing the column properties, ensure the columns that
provide the linkage between a characteristic and the key figures have the same name. For
example, if a key figure column is named Customer and the corresponding column in the customer CSV file is named Customer - Key, then the name of the column in the key figures CSV
file can be changed to Customer - Key.
For each characteristic, create a new dimension, using the key columns, or other attributes of
a characteristic, to drive the levels of the dimension. For each level, ensure that the properties
for the label, short name, and description are assigned source columns, if applicable.
For the root level of each characteristic (dimension), ensure it is marked as unique.
SAP BW presentation hierarchies may contain ragged paths, typically in association with the
"not assigned" and "#" nodes in the hierarchy. The gaps in these hierarchies produce blanks
at the associated level in the Transformer hierarchy.
In Transformer, it is possible to define the text that should be used for blanks (the default text is
"<blank>"). A best practice is to define a more appropriate text for blank entries for all such levels.
Appendix F: Guidelines for Working with SAP BW Data for Use in Transformer
Range
Reserved Words
A to C
abs, all, and, any, as, asc, at, avg, between, bigint, bit_length,
boolean, both, by, call, case, cast, ceil, ceiling, char, char_length,
character, character_length, coalesce, count, create, cross, cube,
cume_dist, current, current_date, current_time, current_timestamp, cursor
D to M
N to Q
R to T
609
Range
Reserved Words
U to Z
The following are also reserved words: _cursor, _local and _rowset.
boolean
byte
date
dateTime
decimal
double
ENTITIES
ENTITY
float
ID
IDREF
int
integer
language
long
Name
NCName
negativeInteger
NMTOKEN
NMTOKENS
nonNegativeInteger
NonPositiveInteger
NOTATION
positiveInteger
QName
611
short
string
time
token
unsignedLong
unsignedInt
unsignedShort
unsignedByte
base64Binary
duration
gYearMonth
gYear
gMonthDay
gMonth
hexBinary
Glossary
access permission
A privilege that permits the access or use of an object.
alias
An alternative name used instead of a primary name.
attribute
In dimensional models, a property that provides qualitative information about members of a level
in a dimension. For example, the Store level within the Retailer dimension might have properties
such as address or retail space. In general, dimensional attributes do not have measure values or
rollups associated with them, but are used to locate or filter members.
In relational models, a query item that is not a measure or identifier. When a query item is an
attribute, it is not intended to be aggregated, or used for grouping or generating prompt pick lists.
In BI modeling, a characteristic of an entity which is descriptive rather than a unique identifier or
an aggregative measure.
In TM1, a property that provides qualitative information about dimensions.
calculated member
A member of a dimension whose measure values are not stored but are calculated at run time using
an expression.
cardinality
For OLAP data sources, the number of members in a hierarchy. The cardinality property for a
hierarchy is used to assign solve orders to expressions.
For relational data sources, a numerical indication of the relationship between two query subjects,
query items, or other model objects.
conformed dimension
A dimension, with a single definition, that is reused or shared across multiple data subject areas.
The common definitions for common dimensions allow data from different subject areas to be
meaningfully compared and used in calculations and drill throughs from one area to another.
In Data Manager,
a dimension with a single definition that can be reused or shared across multiple coordinated data
marts.
cube
A multidimensional representation of data needed for online analytical processing, multidimensional
reporting, or multidimensional planning applications.
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
613
Glossary
data source
The source of data itself, such as a database or XML file, and the connection information necessary
for accessing the data.
In TM1, the file or data used as the source for the TurboIntegrator import process.
dimension
In Cognos Planning, a list of related items such as Profit and Loss items, months, products, customers,
and cost centers, including calculations. The rows, columns, and pages of a cube are created from
dimensions.
In Cognos BI, TM1, and Express, a broad grouping of descriptive data about a major aspect of a
business, such as products, dates, or locations. Each dimension includes different levels of members
in one or more hierarchies and an optional set of calculated members or special categories.
governor
A set of rules to limit user activities, such as the execution of reports, that either take too long, or
consume too many resources.
hierarchy
The organization of a set of entities into a tree structure, with each entity (except the root) having
one or more parent entities and an arbitrary number of child entities.
In Data Manager, a particular view of a business dimension. A hierarchy contains the definition of
related reference data that is organized into a tree structure of members related as parents and
children.
level
A set of entities or members that form one section of a hierarchy in a dimension and represent the
same type of object. For example, a geographical dimension might contain levels for country, region,
and city.
locale
A setting that identifies language or geography and determines formatting conventions such as
collation, case conversion, character classification, the language of messages, date and time representation, and numeric representation.
measure
A performance indicator that is quantifiable and used to determine how well a business is operating.
For example, measures can be Revenue, Revenue/Employee, and Profit Margin percent.
member
In Data Manager, a node in a reference structure.
model
In Data Manager, a system, consisting of fact data and metadata, that represents the aspects of a
business.
614 IBM Cognos Framework Manager
Glossary
model segment
A part of a Framework Manager project, such as a parameter map, a data source, a namespace, or
a folder, that is a shortcut to a second project. Segments are used to simplify model maintenance
or to facilitate multi-user modeling.
namespace
For authentication and access control, a configured instance of an authentication provider that
allows access to user and group information. In Framework Manager, namespaces uniquely identify
query items, query subjects, and so on. You import different databases into separate namespaces
to avoid duplicate names.
In XML and XQuery, a uniform resource identifier (URI) that provides a unique name to associate
with the element, attribute, and type definitions in an XML schema or with the names of elements,
attributes, types, functions, and errors in XQuery expressions.
normalization
The process of restructuring a data model by reducing its relations to their simplest forms. It is a
key step in the task of building a logical relational database design. Normalization helps avoid
redundancies and inconsistencies in data. An entity is normalized if it meets a set of constraints for
a particular normal form (first normal form, second normal form, and so on).
package
A subset of a model, which can be the whole model, to be made available to the Cognos server.
project
In Framework Manager, a set of models, packages, and related information for administration,
and for sharing model information.
In Metric Studio, a task or set of tasks undertaken by a team and monitored on a scorecard. A
project tracks the dates, resources, and status of the project.
In Metric Designer, a group of extracts. Each extract contains the metadata that is used to populate
the Metric Studio data store or to create applications.
publish
In Cognos BI, to expose all or part of a Framework Manager model or Transformer PowerCube,
through a package, to the Cognos server, so that the data can be used to create reports and other
content.
In Cognos Planning, to copy the data from Contributor or Analyst to a data store, typically so that
the data can be used for reporting purposes.
query item
A representation of a column of data in a data source. Query items may appear in a model or in a
report and contain a reference to a database column, a reference to another query item, or a calculation.
Glossary
query subject
A named collection of query items that are closely functionally related. Query subjects are defined
using Framework Manager to represent relational data and form the set of available data for
authoring reports in Query Studio and Report Studio. A query subject is similar to a relational view
in that it can be treated as a table but does not necessarily reflect the data storage.
Index
A
accessibility features, 571
keyboard shortcuts, 571
accessing
data source connections, 56
secured InfoCube, 197
access permissions
definition, 613
action logs, 295
running in batch mode, 297
adding
business rules for relational metadata, 155
business rules for SAP BW metadata, 237
data source functions, 314
function sets, 314
groups, 256
languages for relational metadata, 134
languages to packages, 262
metadata security, 261
object security, 259
roles, 256
security, 261
users, 256
additive, 145, 223
administrative access, 261
advisor, model, 191
aggregate rollups, 311
aggregation, 322
rules for relational metadata, 141, 143, 144, 145
rules for SAP BW metadata, 222, 223, 224
types, 223
types for relational metadata, 145
aggregation for calculations, 334
aggregation rules, 146
Aggregation Rules property
relational metadata, 141
aggregation type
calculated, 191
aliases
definition, 613
Licensed Materials Property of IBM
Copyright IBM Corp. 2005, 2010.
B
balanced hierarchies, 118, 206
binary round-off errors, 379
BLOB, 305
BmtScriptPlayer
syntax, 298
braces in expressions, 377
branches
creating, 276
branching
methodologies, 274
projects, 273
broken reports, 269
business layer, 77
business rules for relational metadata, 155
calculations, 155
617
Index
filters, 158
macros, 168
parameter maps, 163
parameters, 167
prompts, 149
session parameters, 165
business rules for SAP BW metadata, 237
calculations, 237
filters, 239
business view, 77
business view for relational metadata, 179
folders, 187
namespaces, 187
shortcuts, 184, 185
shortcuts and relationships, 185
business view for SAP BW metadata, 246
folders, 248
namespaces, 248
shortcuts, 247
shortcuts and dimensions, 248
C
cached data, 304
reusing, 313
cached metadata, 191
calculated aggregations
relational metadata, 143
calculated aggregation type, 191, 334
calculated key figures, 197
calculated members
definition, 613
calculations
creating for relational metadata, 155
creating for SAP BW metadata, 237
order of operations, 334
security, 260
unexplained number discrepancies, 379
cardinality
1-1, 355
1-n, 355
checking, 339
data source, 79
definition, 613
dimensions and facts, 339
facts, 191
mixed, 191
618 IBM Cognos Framework Manager
notation, 79
queries, 80, 320
redefining, 82
rules, 80, 320
types, 80, 320
catalog, 317
categories
for verifying, 251
changed features, 13, 18
changes in model not in report, 270
changing
metadata, 284
type of SQL, 107
changing packages
analyzing the effects, 287
characteristic
mapping to Framework Manager, 203
characteristic dimensions
externalizing, 603
characteristic structures, 201
checking
projects, 251
relationships, 78
choosing
query processing, 312
clearing
object security, 259
CLOB
Oracle, 375
Cognos PowerCubes, See IBM Cognos PowerCubes
Cognos SQL, 109
comments
adding to SQL, 106
Common Warehouse Metamodel, 291
exporting, 378
comparing tables, 97
complex expressions
relationships, 82
Composite stored procedures, 89
concepts, 319
conditional query subjects, 163, 243
conformed dimension
definition, 613
conformed dimensions, 348
creating, 97
multiple facts, 352, 357
Index
SAP BW, 15, 17
conformed star schema groups, 348
connecting to multiple PowerCubes, 53
connections between
dimensions, 127, 213
query subjects, 97
content manager data source, 317
Context Explorer, 97, 127, 213
controlling
access, 256
SQL generation, 304
converting
measures into query items, 124, 125
model query subjects into data source query subjects, 106
query items into measures, 154
query subjects into dimensions, 105
regular dimensions, 130
copying
projects, 285
creating, 291
branches, 276
calculations for relational metadata, 155
calculations for SAP BW metadata, 237
data source connections, 56
dimensions for relational metadata, 114, 122, 123
dimensions for SAP BW metadata, 205
filters for relational metadata, 158
filters for SAP BW metadata, 239
folders for relational metadata, 187
folders for SAP BW metadata, 248
links, 283
measure dimensions, 347
measure dimensions for relational metadata, 124
measure folders for relational metadata, 188
namespaces, 76
namespaces for relational metadata, 187
namespaces for SAP BW metadata, 248
packages, 254
parameter maps for relational metadata, 163
parameter maps for SAP BW metadata, 243
projects, 26, 47
prompts with query macros, 171
query item folders for relational metadata, 188
query sets for relational metadata, 97
query subjects for relational metadata, 86, 87, 90
D
data
formatting for relational metadata, 148
formatting for SAP BW metadata, 225
security, 256, 257
using multilingual, 131
database connections, See data source connections
database functions
vendor-specific, 314
database layer, 77
database only, 312
databases
importing, 59
data extraction
SAP BW guidelines for variable usage, 595
data formats
date and time symbols, 584
decimal format symbols, 591
using patterns, 583
data source
adding functions, 314
updated by stored procedure, 90
User Guide 619
Index
data source connections, 56
accessing, 56
creating, 56
isolation levels, 54
Microsoft SQL, 56
OLAP cubes, 52
testing, 58
data source functions
adding, 314
data source query subjects
creating, 86
definition, 25
data source query subjects for relational metadata, 85
determinants, 92, 94
using parameters, 167
data sources
Architect XML files, 61
connection levels, 54
DecisionStream, 62
definition, 613
ERwin, 69
IBM Cognos models, 61
IBM DB2 Cube Views, 69
Impromptu XML files, 61
Microsoft Analysis Server, 60
Microsoft SQL Server, 60
modifying properties, 317
multilingual, 133
Oracle Designer, 74
other metadata sources, 69
paths to file-based data source connections, 57
properties, 209, 312
relational databases, 59
SAP BW, 15, 17, 197
XML files, 75
datatypes
graphic, 376
data types, 366
data warehouse
relationships, 78
date
format type, 148, 225
prompts, 151, 227
date prompts, 149, 226
DB2, 377
Index
Dimension Map tab, 34
dimensions
ambiguous, 360
converting from query subjects, 368
creating, 34
definition, 25, 614
exploring, 32, 44
hierarchies, 346
identifying, 339
measure, 336, 347
mixed cardinality, 191
model, 326
modifying, 34
properties, 34
query subjects, 326
regular, 326, 332, 336, 345
role-playing, 339
SAP BW, 593
searching, 36
semi-additive measures, 146
shared, 336
star schema groups, 348
dimensions for relational metadata, 114, 180
balanced hierarchies, 118
converting, 130
converting from query subjects, 105
dimension map, 114, 122, 123
exploring, 127
hierarchies, 117
keys, 120
levels, 117, 119
measure, 124
merging, 127
modifying, 34
network hierarchies, 119
ragged hierarchies, 119
regular, 115
roles, 122, 123
scope relationships, 126
shortcuts, 185
snowflaked, 183
testing, 128
unbalanced hierarchies, 119
dimensions for SAP BW metadata, 204
balanced hierarchies, 206
dimension map, 205
hierarchies, 205
key figures, 212
levels, 205, 209
network hierarchies, 209
ragged hierarchies, 208
regular, 205
roles, 210, 212
shortcuts, 248
testing, 213
unbalanced hierarchies, 207
DMR (dimensionally modeled relational) metadata, 345
documenting the model, 272
double-counting, 92, 339, 355, 360
double quotation marks, 168
drop-down list prompts, 149, 151, 226, 227
duplicate object names
importing, 59
durable models, 13, 189
renaming query items, 287
dynamic query mode, 13, 266, 268, 305, 306, 308
E
editing
SQL, 106
embedded files, 263, 266
embedded strings, 168
in expressions, 168
in macros, 168
environment
Framework Manager, 23
error messages
QE-DEF-0177, 376
QE-DEF-0259, 377
UDA-SQL-0107, 376
UDA-SQL-0114, 376
errors
repairing, 252
ERWin metadata
out of memory error, 375
escape symbol, 168
evaluating
relational query subjects, 104
SAP BW query subjects, 218
Event Studio
stored procedures, 90
Index
examples for relational metadata
filter, 162
in_range function, 158
multilingual modeling, 136
parameter map, 165
prompts, 174
examples for SAP BW metadata
in_range function, 239
except all query set, 97
except query set, 97
Explorer Diagram, 44
Explorer tab, 32
Explorer Tree, 43
exploring
dimensions, 114, 127, 205, 213
object-based security, 271
objects, 32, 44
packages, 271
query subjects, 97
roles, 271
exporting
CWM file, 378
metadata as CWM files, 291
translation tables, 135
expression editor
function sets, 314
searching for values, 382
expressions
braces, 377
custom, 82
imported, 74
relationships, 82
using prompts, 149
externalized dimensions
prompts, 378
externalize methods
IQD, 19
externalizing
characteristic dimensions, 603
Framework Manager requirements, 605
InfoCube key figures, 603
measure dimensions, 603
model query subjects, 602
query subjects, 263, 266
SAP BW Dimensions, 593
SAP BW Query key figures, 603, 605
622 IBM Cognos Framework Manager
F
fact data, 344
fact-less query, 348
facts, 347
aggregation rules, 146
ambiguous, 360
cardinality, 191
identifying, 339
mixed cardinality, 191
fact tables, 124, 180
features
changed, 13, 18
deprecated, 13, 18
new, 13, 17
removed, 13, 19
file-based data sources
paths, 57
filters
mandatory, 160
optional, 160
security, 257, 260
filters for relational metadata
applying to query subjects, 160
creating, 158
determining usage, 160
mandatory, 158
modifying, 158
multiple dimensions, 34
multiple query items, 34
multiple query subjects, 34
optional, 158
filters for SAP BW metadata
applying, 242
creating, 239
determining usage, 242
modifying, 239
finding
objects, 36
fixing
failed transactions, 279
folders
creating, 187, 188
measure, 188
query item, 188
Index
using shortcuts, 184
folders for SAP BW metadata
creating, 248
using shortcuts, 247
font
settings, 33, 47
foreign keys, 84
formatting
data for relational metadata, 148
data for SAP BW metadata, 225
format types
currency, 148, 225
date, 148, 225
text, 148, 225
Framework Manager
project, 23
security filters change for SAP BW, 19
full outer joins, 79, 376
Oracle, 379
functions
project, 314
function set ID, 317
function sets
adding, 254, 314
defining, 314
G
gateways
cannot access URI, 375
generating
models, using Model Design Accelerator, 49
relationships, 84
governor
Allow Dynamic Generation of Dimensional Information, 310
Allow Enhanced Model Portability at RunTime, 309
Allow Usage of Local Cache, 310
Cross-Product Joins, 306
Grouping of Measure Attributes, 307
Maximum External Data File Size, 311
Maximum External Data Row Count, 311
Maximum External Data Sources, 311
Maximum Number of Report Table, 305
Maximum Number of Retrieved Rows, 305
Outer Joins, 305
Publish Entire Model When Processing, 310
H
hierarchies, 322, 326, 368
balanced, 118, 206
definition, 614
multiple, 346
network, 119, 209
ragged, 119, 208
regular dimension, 117, 205
SAP BW, 199
specifying roles, 122, 123
time-dependent, 14, 200
unbalanced, 119, 207
versioned, 200
I
IBM accessibility page, 573
IBM Cognos 8 Planning and SAP BW data, 593
IBM Cognos models
importing, 61
IBM Cognos PowerCubes
publishing, 268
identifiers
unique, 92
imported metadata
checking, 339
User Guide 623
Index
importing
Architect XML files, 61
databases, 59
data sources, 69
DecisionStream, 62
duplicate object names, 59
IBM Cognos models, 61
Impromptu XML files, 61
metadata from XML files, 75
metadata into Framework Manager, 58
relational metadata, 84
relationships, 78
SAP BW hierarchies, 199
SAP BW metadata, 197, 202
translation tables for relational metadata, 136
import view, 77
Impromptu Query Definition files, 263, 266
Impromptu XML files
importing, 61
improving performance
reusing cached data, 313
in_range function, 158, 239
InfoCube
mapping to Framework Manager, 203
permissions for accessing metadata, 198
InfoCube key figures
externalizing, 603
Informix
functions, 89
stored procedures, 89
inner joins, 79, 84, 378
intersect all query set, 97
intersect query set, 97
IQD
files, 263, 266
IQD externalize method, 19
isolation levels, 54
J
Japanese characters
export paths, 378
joins, 78
creating, 45
deleting, 45
full outer, 79, 376
inner, 79, 84, 378
624 IBM Cognos Framework Manager
loop, 341
modifying, 45, 82
Oracle, 379
outer, 79, 81
overriding, 45
K
keyboard shortcuts, 571
key figures, 197
mapping to Framework Manager, 203
modifying, 212
prompts, 378
structures, 201
keys, 114, 205, 368
cardinality, 79
foreign, 84
for levels, 120
for roles, 210, 212
primary, 84
specify roles, 122, 123
L
languages
adding for relational metadata, 134
defining for relational metadata, 134
incorrect in SAP BW query, 376
setting up multilingual environment, 131
specifying for packages, 262
Large Text Item Limit, 305
layers, 77
level of details
settings, 33, 47
levels, 114, 117, 205, 210, 212, 368
definition, 614
member unique names, 120, 210
regular dimension, 119, 209
security, 378
sorting, 121
specify roles, 122, 123
unique, 115
limitations
linking, 281
macros, 171
segmenting, 281
limited local, 312
Index
linked projects, 280, 372
synchronizing, 303
linking
limitations, 281
links, 280
creating, 283
literal strings, 168
in expressions, 168
in macros, 168
locales
definition, 614
locales, See Also languages
local query processing
rollup processing, 311
log file
archive entries, 301
log files, 295
play back, 296
logging on
to Microsoft SQL, 56
loop joins, 339, 341
M
macros
creating, 171
limitations, 171
prompts, 168
using, 168
main projects, 282
managing
packages, 259, 261, 271, 272
project, 271
projects, 285, 295
mandatory cardinality, 80
mandatory prompts, 171
many-to-many relationships, 79
many-to-one relationships, 78
mapping
parameter values for relational metadata, 163
parameter values for SAP BW metadata, 243
SAP BW objects to Framework Manager, 203
master-detail tables, 344, 347
maximum cardinality, 80, 320
measure dimensions, 336
creating, 347
externalizing from SAP BW, 603
role-playing, 339
measure dimensions for relational metadata
creating, 124
exploring, 127
scope relationships, 126
measure dimensions for SAP BW metadata
exploring, 213
measure folders, 188
measures
calculated aggregation type, 191
converting, 125, 154
converting to query items, 124
definition, 614
for IBM Cognos 8 Planning, 593
IBM Cognos BI upgrade, 367
semi-additive, 146
measure scope issues, 126
members
definition, 614
sorting, 121
member unique names
relational metadata, 120
SAP BW metadata, 210
merging
projects, 273
query subjects, relational, 96
query subjects, SAP BW, 217
regular dimensions, relational, 127
merise notation, 33, 47
metadata
cached, 191
changing, 284
exporting, 291
importing, 58
merging, 96, 217
moving, 284
publishing, 251
relational, 77
SAP BW, 197
security, 256, 261
synchronizing, 301
understanding, 271
Metadata Wizard, 47
methodologies
branching, 274
Index
Microsoft
SQL server and logon, 56
SQL Server data sources, 60
Microsoft Analysis Server
data sources, 60
migrating
models, 294
Minimized SQL, 112, 191
model query subjects, 113
minimum cardinality, 80, 320
model
durability, 189
versioning, 270
Model Accelerator, 45
model advisor, 191
model business views, 179, 246
Model Design Accelerator, 43
building query subjects, 49
creating projects, 47
creating star schemas, 48
diagram colors, 44
diagram settings, 47
Explorer Diagram, 44
Explorer Tree, 43
generating models, 49
joins, 45
managing star schemas, 50
Metadata Wizard, 47
Model Accelerator, 45
Model Warning View, 46
Query Subject Diagram, 45
Relationship Editing Mode, 45
model documentation, 272
modeling
data sources, 133
distributed models, 273
main projects, 273
multilingual, 133
multiuser, 273
modeling problems, 191
model objects, 28
shortcuts, 333
using parameters, 163, 243
viewing, 28, 43
model portability, 294, 304
Index
relationships, 82
session parameters, 165, 245
SQL at runtime, 171
stored procedure query subjects, 90
moving
metadata, 284
projects, 286
MultiCube
mapping to Framework Manager, 203
multidimensional
query subjects, 216
multi-edge suppression, 263
multilingual
data, using, 131
data sources, 133
multilingual modeling
example for relational metadata, 136
packages, 262
parameters, 134
relational metadata, 131
multilingual reporting environment
setting up, 131
multiple cubes in packages, 268
multiple data sets, 292
setting default data set, 293
multiple data source connections
using, 53, 56
multiple-fact queries, 326, 352, 357
multiple-grain queries, 326, 352, 357
multiple hierarchies, 346
multiple relationships, 191
multiple users
modeling, 273
multiple valid relationships, 339, 341
multiuser modeling, 273
N
namespaces, 23
creating, 76
creating for relational metadata, 187
creating for SAP BW metadata, 248
definition, 25, 615
naming conventions
objects, 38
native metadata, 52
native SQL, 110
O
objects
exploring, 32, 44
naming conventions, 38
properties, 34
remapping, 290
reorder, 31
searching for, 36
unique identifiers, 38
object security, 256
adding, 259
calculations, 260
exploring, 271
filters, 260
model query subjects, 260
removing, 259
shortcuts, 260
OLAP cubes
as datasources, 52
OLAP data sources
publishing, 268
one-to-many relationships, 78, 355
one-to-one relationships, 78, 355
opening
projects, 27
operations for calculations, 334
optional cardinality, 80, 320
optional prompts, 171
optional relationships, 79
Oracle
Designer, 74
full outer joins, 379
User Guide 627
Index
Oracle full outer joins, 376
order of operations for calculations, 334
organizing models, 179, 246
outer joins, 79, 84, 304
Analysis Studio, 81
full, 79, 376
Oracle, 379
out of memory error, 375
P
package administrative access
modifying, 261
packages, 23
access, 261
adding security, 261
administrative access, 261
analyzing changes, 287
containing multiple cubes, 268
creating, 254
creating in Cognos Connection, 197, 266
definition, 25, 615
exploring, 271
managing, 259, 261, 271, 272
modifying, 254
multilingual support, 262
publishing, 251, 266
SAP BW data sources, 14
security, 256
verifying, 251
viewing inclusion, 272
parameter maps for relational metadata
creating, 163
using as lookup tables, 131
parameter maps for SAP BW metadata, 243
creating, 243
parameters
in data source query subjects, 167
parameters for relational metadata
aliases, 163
creating, 163
data source query subjects, 167
model objects, 163
multilingual modeling, 134
nested, 163
session, 165
using, 168
628 IBM Cognos Framework Manager
Index
segmenting, 282
shortcuts, 283
synchronizing, 301
view transaction history, 296
Project Viewer, 28
Prompt Info property, 149, 226
prompt information properties, 149
prompts
cascade on reference, 152, 228
creating, 171
creating with macros, 171
date, 149, 151, 226, 227
defining, 149, 226
different values to use and display, 152, 228
display item reference, 152, 228
drop-down list, 149, 151, 226, 227
examples, 174
filter on reference, 153, 229
in expressions, 149
key figures, 378
mandatory, 171
optional, 171
properties, 149, 151, 226, 227
SAP BW variables, 230
search, 149, 151, 226, 227
stored procedure example, 92
testing, 154, 230
text box, 151, 226, 227
time, 149, 151, 226, 227
type-in, 149, 151, 226, 227
use item reference, 152, 228
properties
aggregation rules, 141
aggregation rules for SAP BW metadata, 222
cascade on reference, 152, 228
catalog, 317
content manager data source, 317
cubes, 317
data sources, 312
display item reference, 152, 228
filter on reference, 153, 229
function set ID, 317
modifying, 34
parameter map, 317
prompt info, 149, 226
prompt type, 151, 227
Q
QE-DEF-0177, 376
QE-DEF-0259, 377
queries
fact-less, 348
multiple-fact, 326, 352, 357
multiple-grain, 326
single fact, 351
split, 361
stitched, 339
Query, SAP BW
mapping to Framework Manager, 203
query items
converting, 125, 154
converting from measures, 124
definition, 26, 615
properties, 34
query items for relational metadata
aggregation rules, 145
durable model capability, 287
folders, 188
modifying, 34, 138
renaming, 287
roles, 122, 123
usage, 144
query items for SAP BW metadata
aggregation, 223
aggregation rules, 223
User Guide 629
Index
formatting, 225
modifying, 219
roles, 210, 212
usage, 223
query macros
using to create prompts, 171
query mode
dynamic, 13
query processing, 312, 317
choosing, 312
query reuse, 313
query sets for relational metadata
creating, 97
testing, 101
Query Subject Diagram, 45
query subjects
building using Model Design Acclerator, 49
converting to dimensions, 368
csv files, 263, 266
DB2, 377
definition, 25, 615
determinants, 191, 332, 368
dimensions, 191, 326
embedded files, 263, 266
exploring, 32, 44
externalized, 263, 266
facts, 191
Impromptu Query Definition files, 263, 266
minimized SQL, 191
mixed cardinality, 191
multiple relationships, 191
properties, 34
SAP BW, 367
searching, 36
security, 257
star schema groups, 348
tab files, 263, 266
testing, 74
Transformer files, 263, 266
using in Transformer, 263
query subjects for relational metadata
changing type of SQL, 107
converting, 105, 106
converting from dimensions, 130
creating, 86, 87, 96
data source, 85
630 IBM Cognos Framework Manager
determinants, 92, 94
editing SQL, 106
evaluating, 104
exploring, 97
generating SQL, 112
model, 87
modifying, 34, 90
parameter maps, 163
query sets, 97
relationships, 78
shortcuts, 185
SQL, 85
stored procedure, 88
testing, 101
types, 85
updating, 104
query subjects for SAP BW metadata
creating, 217
evaluating, 218
model, 216
parameter maps, 243
query type, 317
quick tours, 11
quotation marks, 168
in expressions, 168
in macros, 168
R
ragged hierarchies, 119, 208
recording transactions, 295
recursive relationships, 191, 342
reflexive relationships, 191, 342
regional settings
setting up a multilingual environment, 131
Regular Aggregate property, 145
relational metadata, 141
SAP BW metadata, 222, 223
regular dimensions, 326, 332, 336
creating, 345
hierarchies, 346
role-playing, 339
regular dimensions for relational metadata, 115
converting, 130
exploring, 127
hierarchies, 117
levels, 117, 119
Index
merging, 127
scope relationships, 126
regular dimensions for SAP BW metadata, 205
exploring, 213
hierarchies, 205
levels, 205, 209
related objects, 97, 127, 213
relational data source query subjects
evaluating, 104
updating, 104
relational metadata, 77
business rules, 155
business view, 77
import view, 77
query items, 138
star schemas, 180
relational modeling concepts, 320
relational models
migrating, 294
Relationship Editing Mode, 45
relationships
0-1, 78
0-n, 78
1-1, 78
1-n, 78, 355
ambiguous, 339
cardinality, 78, 320
changing, 82
checking, 78, 339
complex expressions, 82
creating, 83
custom, 82
definition, 78
detecting, 84
determinants, 191
from Oracle Designer, 74
generating, 84
importing, 78
levels of granularity, 342
many-to-many, 78, 79
many-to-one, 78
modifying, 82
multiple, 191
multiple valid, 339, 341
n-n, 78
one-to-many, 78
one-to-one, 78
reflexive and recursive, 191
scope, 126
shortcuts, 83, 185
verifying, 78
remap objects, 290
RemoteCube
mapping to Framework Manager, 203
removed features, 13, 19
removing
object security, 259
renaming
projects, 286
relationships, 82
reorder objects, 31
repairing
IBM Cognos ReportNet models, 367
repairing models, 252
report
dependencies, 288
reporting requirements, 21
reports
not showing changes to model, 270
reserved symbols
number sign, 168
reserved words, 609
resetting
Regular Aggregate property, 148
Usage property, 148
resolving
ambiguous objects, 360
split queries, 361
restricting
access, 256
BLOBs, 305
data retrieved, 304
reusing cached data, 313
role-playing dimensions, 191, 339
roles
adding, 256
dimensions, 122, 123
exploring, 271
roles for SAP BW metadata
dimensions, 210, 212
rollup processing, 311, 317
round-off errors, 379
User Guide 631
Index
row limits, 304
rules
aggregation for SAP BW metadata, 222
business, 155
business for SAP BW metadata, 237
cardinality, 80
rules of cardinality, 320
S
sample models, 39
SAP BW
conformed dimensions, 15, 17
custom properties, 230
guidelines for using fact data, 595
importing key figures, 197
security filter change in Framework Manager, 19
Transformer, 602
wrong language in query, 376
SAP BW data
Cognos Planning, 593
creating packages, 14
SAP BW dimensions, 593
SAP BW metadata, 197
importing, 197
SAP BW Query
permissions for accessing metadata, 198
SAP BW Query key figures
externalizing, 603
SAP BW query subjects, 367
SAP BW structures, 201
SAP BW variables, 209, 230
save as
copying projects, 285
saving automatically
options, 30
schema, 317
scope relationships, 114, 122, 123, 126, 205
script files
fixing errors, 300
scripts
running, 269
searching
objects, 34, 36
search prompts, 149, 151, 226, 227
secured InfoCube
accessing, 197
632 IBM Cognos Framework Manager
security
CSVIdentityName function, 258
CSVIdentityNameList function, 259
exploring, 271
filter change in Framework Manager for SAP
BW, 19
filters, 257
levels, 378
packages, 254
types, 256
segmented projects, 280, 282, 372
copying, 285
deleting, 287
moving, 286
synchronizing, 302
segmenting
limitations, 281
projects, 282
segments, 280
recommendations for using, 280
self-joins, 191
semi-additive, 148
semi-additive measures, 146, 225
Semi-Aggregate property, 148
SAP BW metadata, 222, 225
session parameters
modifying for relational metadata, 165
modifying for SAP BW metadata, 245
setting
governors, 304
suppression, 263
settings
font, 33, 47
level of detail, 33, 47
notation, 33, 47
snap options, 33, 47
test, 102, 129, 215
shared dimensions, 336
shortcuts, 333
behavior, 304, 306
security, 260
shortcuts for relational metadata
dimensions and query subjects, 185
relationships, 83, 185
using, 184
Index
shortcuts for SAP BW metadata
dimensions, 248
using, 247
show dependencies, 289
single fact queries, 351
single quotation marks, 168
snap options
settings, 33, 47
snowflaked data sources, 343
snowflaked dimensions, 183
sorting
levels, 121
members, 121
objects, 34
sort objects, 31
sparse data
semi-additive measures, 146
sparse data and Analysis Studio, 81
split queries, 361
SQL, 351
As View, 112, 113
changing type, 107
Cognos, 106, 109
comments, 106
determinants, 96
editing, 106
generation types, 112
inner joins, 378
Minimized, 112, 113, 191
model query subjects, 113
native, 106, 110
pass-through, 106, 111
query subjects, 85
server, connecting, 56
stand-alone native, 106, 111
SQL generation
controlling, 304
SQL Generation for Determinant Attributes
governor, 308
SQL Generation for Level Attributes
governor, 308
SQL Parameter Syntax
governor, 309
square brackets, 168
star dimensions, 183
star schema concepts, 343
Index
UDA-SQL-0107, 376
UDA-SQL-0114, 376
unable to access service at URL, 375
validating
relational query subjects, 104
SAP BW query subjects, 218
Index
valid relationships
multiple, 339
vargraphic datatype, 376
variables
guidelines for SAP BW fact data, 595
SAP BW, 230
stored procedure, 92
using when externalizing, 605
vendor-specific database functions, 314
verifying
IBM Cognos ReportNet models, 365, 367
models, 251
packages, 251
relationships, 78
versioned hierarchies, 200
versioning
models, 266
viewing
diagrams, 32, 44, 45
model objects, 28, 43
package inclusion, 272
properties, 34
related objects, 97, 127, 213
SQL, 106
statistics, 36
summaries, 36
tasks, 36
W
With clause, 304
X
XML files
importing, 75