To use Cognos product documentation, you must enable JavaScript in your browser.

Query Items

Information about query items for relational metadata appears in a different topic .

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.

Presentation hierarchy levels, key figures, and attributes are imported as query items in 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.

Query item property

Description

Name

The name of the query item or measure.

Description

A description of the query item or measure.

Last Changed

The date that the query item or measure was last changed.

Screen Tip

A description that can appear in the published package for your users.

Expression

Used to create embedded calculations that provide your users with calculated values that they regularly use.

This property is for measures only.

Note: The Expression property is not used by SAP BW.

External Name

The name that appears in the data source.

Is Hidden

Whether to hide or show the query item or measure in the published package.

Even when Is Hidden is set to True and the query item or measure is invisible to your users, it is always present in the published package because the query item or measure may be needed by other objects in the model. You do not see the query item or measure in the Package Publish wizard.

For example, a calculation may make use of a hidden query item.

Usage

The intended use for the data represented by the query item.

This property is for query items only.

Format

How information appears in a report.

Currency

Which currency is used.

This property cannot be changed in the Property pane. Use the Format property to change the currency.

Data Type

The data type that was set in the data source.

Because this property is set in the data source, it is read-only in Framework Manager.

Precision

The total number of digits.

Because this property is set in the data source, it is read-only in Framework Manager.

Scale

How many digits are represented in the scale.

For example, you can show numbers in thousands so that 100,000 means 100,000,000.

Because this property is set in the data source, it is read-only in Framework Manager.

Size

The size of the query item or measure.

Because this property is set in the data source, it is read-only in Framework Manager.

Is Nullable

Whether the query item or measure can contain a null value.

Because this property is set in the data source, it is read-only in Framework Manager.

Display Type

How the query item is shown.

The column value can appear in the Cognos 8 studios as a picture, as a link, or as a value.

The default is value.

This property is for query items only.

MIME Type

The format that the column value uses.

For example, if Display Type is set to picture, MIME Type could be jpeg.

This property is for query items only.

Note: The MIME Type property is not used by SAP BW.

Prompt Info

Prompt behavior.

Regular Aggregate

The type of aggregation that is associated with the query item, measure, or calculation in the published package.

Aggregate Rules

For dimensionally modeled relational metadata, the rules for semi-additive aggregation.

For SAP BW metadata, the Aggregate Rules property is read-only.

Is Unsortable

Whether the values of this query item can be sorted.

This property is for query items that contain large objects such as BLOBs.

You may be interested in the following related topics:

Modifying How Query Items Are Aggregated

Information about aggregation of relational query items appears in a different topic .

You can change how some query items and measures are aggregated in reports. Framework Manager applies aggregate rules when your users create a report that summarizes a query item or measure.

When you import metadata, Framework Manager assigns values to the Usage and Regular Aggregate properties for query items and measures depending on the type of object that the query item or measure is in. The Usage property identifies the intended use for the data represented by the query item . The Regular Aggregate property identifies the type of aggregation that is applied to the query item or measure . Your users can override the values of the Regular Aggregate property. For semi-additive measures, you can specify additional aggregate rules by modifying the Aggregate Rules property .

When modifying the Regular Aggregate property, you can select values that are not available through importing, such as average and maximum. You must understand what the data represents to know which aggregate rule is required. For example, if you aggregate a part number, the only aggregate values that apply are count, count distinct, maximum, and minimum.

Rules for Setting Properties for Dimensions

Framework Manager uses the following rules to set the Usage and Regular Aggregate properties.

ObjectUsage propertyRegular Aggregate property
Query item in a regular dimensionAttributeUnsupported
Query item in a measure dimensionIdentifierCount
Measure in a measure dimensionFact

Automatic if the measure is a calculation

Sum if the measure is not a calculation

If the measure is semi-additive, use the Aggregate Rules property to define rules for semi-additive aggregation .

For SAP BW metadata, you cannot change these properties for dimensions.

Rules for Setting Properties for Calculations

The Regular Aggregate property for a calculation in SAP BW metadata is set to Automatic. To determine what automatic means, these rules apply.

Calculation

Aggregation type

key items

unsupported

all other items

calculated

Rules for Setting Properties for Model Query Subjects

For model query subjects, Framework Manager uses the settings for the object that the model query subject is based on.

Note: If you change an aggregation value for SAP BW metadata, the aggregation cannot perform time-based queries because the aggregation rules are not applied.

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.

Usage property value

SAP BW object

Description

Identifier

hierarchy level

Uniquely identifies characteristic values at a particular level in a hierarchy.

Fact

key figure

Represents a key figure that typically is numeric data. Date and time data are also supported.

Attribute

display attribute

Represents a display attribute that is associated with a characteristic.

Regular Aggregate Property

The Regular Aggregate property identifies the type of aggregation for the query item or calculation when you publish it. Your users can either use this default setting to perform calculations on groups of data, or apply a different type of aggregation.

For example, if the Regular Aggregate property value of the Quantity query item is sum, and it is grouped by Product Name in a report, the Quantity column in the report shows the total quantity of each product.

The following aggregation types are supported for SAP BW data sources:

Rules to Determine the Automatic Aggregation Type

If the calculation is in an SAP BW object, these rules apply.

Calculation

Aggregation type

key items

unsupported

all other items

calculated

Aggregate Rules Property

For dimensionally modeled relational metadata, the method by which a semi-additive measure is aggregated for the dimensions that you select.

For SAP BW metadata, the Aggregation Rules property is read-only. The Semi-Aggregate property is used instead.

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 Framework Manager, the semi-aggregate behavior is ignored in the Cognos 8 studios.

The Semi-Aggregate property will not be supported in future releases. Instead, use the Aggregate Rules property for semi-additive measures.

Format Query Items

Information about formatting relational items appears in a different topic .

You can specify how query item values appear in reports. Use the Format property to choose a format type, such as text, date, and currency. Each format type contains properties that further specify how the data appears.

For example, you can assign the Currency format type to a numeric query item, and then use the No. of Decimal Places property in the Data Format dialog box to specify how many decimal places appear in reports.

Some characters are language-sensitive and appear properly only when your locale supports the applicable font. For example, for Japanese currency symbols to appear correctly, your locale must be set to Japanese.

If Framework Manager does not show the currency you require, you must ensure that you install the appropriate language packs to support the currency symbols. For example, to have the Indian currency symbol (rupee) appear, you must run an operating system or install a language pack that can show this symbol. The Japanese operating system or Japanese language is one that can show the Indian currency symbol.

You can define properties for several query items at the same time. However, if the query items have different format types, all properties that were previously specified are overridden and the default values from the data source are used. If the original format types of the selected query items are the same, all the properties for the selected query items are set identically.

For example, to use the same decimal separator for two query items and to keep the number of decimals different, each query item must be changed individually. If both are selected and changed at the same time, all properties including the number of decimals are set identically for both query items.

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.

  5. In the Properties box, select or type the appropriate property value.

  6. Click OK.

Define a Prompt Control

Information about prompt controls for relational metadata appears in a different topic.

Prompts help your users quickly find the information they need in a report. Prompts are generally defined in reports. However, you can change the definition of the dimension or query subject in the model so that a prompt appears automatically when your users create filters. This is useful for query items, such as ProductTypeCode, whose values are not shown in a report but are useful for filtering data.

In general, it is better to define type-in prompts in the reports to make use of the additional prompt features. However, your users cannot modify some variables. For these variables, you can use Framework Manager to define type-in prompts.

The syntax for using a prompt as a value is

?<PromptName>?

You can use prompts in

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.

    GoalProperty
    Set the type of prompt control that is generated when the report is run.Prompt Type
    Set the generated prompt as part of a series of generated cascading prompts.Cascade On Item Reference
    Specify that a prompt defined for one query item will use a different query item, and its rules, in the prompt.

    The query item specified in the Display Item Reference property will display a list of values in the prompt. Each value in the list will be associated with a value in the query item specified in the Use Item Reference property.

    Display Item Reference
    Specify that a prompt defined for one query item will use a different query item, and its rules, in the prompt.

    The query item specified in the Use Item Reference property will be used in the prompt.

    Use Item Reference
    Set an alternative query item that is used by any Report Studio or Query Studio filter. Filter Item Reference

Prompt Type Property

The Prompt Type property sets the type of prompt control that is generated when the report is run, such as an edit box or a pull-down list. Use this property to have the prompt show one query item but use a different one. For example, the prompt can show Employee Name but use Employee Number.

The default value for this property is Server Determined.

Value

Prompt Control

Server Determined

The type of prompt control is based on information in the server, such as the data type of the query item.

Edit Box

A simple text box. If the data type of the column is date or dateTime, this value generates a date or date-time control as well as the text box.

Select Date

A date control with a calendar interface.

Select Date/Time

A date-time control with a calendar interface.

For SAP BW metadata, this value is not relevant.

Select Interval

A date-time interval control.

For SAP BW metadata, this value is not relevant.

Select Time

A time control that filters data based on the selected time period. For example, if you define a Select Time prompt for Order Time, the user can use the time control to show all orders placed after 1:00, or all the orders placed between 10:00 and 11:00.

If you are referring to a time member, you must use the exact values only.

If you are using a range, the end points of the range must correspond to values in the data source.

Select Value

A drop-down list.

Select with Search

A list control so that users can search for values.

For SAP BW metadata, this value is not relevant.

Select with Tree

A tree prompt control for prompts that are based on a hierarchy node.

Cascade On Item Reference Property

The Cascade On Item Reference property indicates that the generated prompt is part of a series of generated cascading prompts. The query item that you reference in this property is the parent item in the cascade. The system prompts the user for the cascade item before prompting them for the current query item.

For example, if you want to prompt for Product Line and then Product within the selected line, set the Cascade On Item Reference property of the Product query item to Product Line.

Display Item Reference and Use Item Reference Properties

These properties specify that a prompt defined for one query item will use a different query item, and its rules, in the prompt.

The query item specified in the Display Item Reference property will display a list of values in the prompt. Each value in the list will be associated with a value in the query item specified in the Use Item Reference property.

The query item specified in the Use Item Reference property will be used in the prompt.

For example, you want the prompt to display Country Name while using Country Code to retrieve data. Set the Display Item Reference property to Country Name and set the Use Item Reference property to Country Code.

These properties are used only for data driven prompt controls whose Prompt Type property is set to either Select Value or Select with Search.

Filter Item Reference Property

The Filter Item Reference property identifies an alternative query item that is used by any Report Studio or Query Studio filter. This property is used only when Report Studio or Query Studio generates a filter. This property helps create more efficient queries because it is faster to filter on an indexed numeric column than a non-indexed string column.

For example, a report author wants to create a filter for the Country query item. You set the Filter Item Reference property to use Country Code for any filter that uses the Country query item.

Another example is a report author wants to create a filter for the Country Code query item that appears in the Orders table. You want that filter to use the Country Code in the Country table because there are fewer rows to read in the Country table.

Testing a Prompt

When you test a model object that references a prompt, 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.

Framework Manager supports these types of SAP BW variables:

Variables for hierarchies function as placeholders for the hierarchy of a characteristic. All the values for hierarchy variables are read-only.

The SAP BW variable information is obtained using the SAP BW BAPI MDDataProviderBW::GetVariables.

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 locale-dependent. Each locale in the model should be represented 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.

The default value is obtained from SAP BW.

Default Low Caption and Default High Caption Properties

The value for each of these properties is a composite, locale-dependent string value. Each locale in the model should be represented 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.

The default value is obtained from SAP BW.

Restrictions: The Default High Caption property is applicable only for variables with a Selection Type of interval.

Fixed Value Property

This property is a boolean property that determines whether the value of the variable can be changed. If this property is set to true, your users are not prompted for the associated variable, and the default value is always applied.

The default value is false.

Restrictions: This property is not applicable to hierarchy variables.

Selection Type Property

The possible values are value, interval, complex, multiValued.

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.

Entry Type Property

The default value is obtained from SAP BW.

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.

Data Type

The default value is obtained from SAP BW.

Value

SAP BW Equivalent

xsdString

CHAR

xsdDate

CHAR

The VAR_TYPE value is SAP_VAR_TYPE_MEMBER and the reference dimension is based on 0CALDAY.

xsdFloat

FLTP

xsdDatetime

DATS

xsdInt

NUMC, DEC, INT1, INT2, or INT4

xsdLong

NUMC, DEC, INT1, INT2, or INT4

xsdMUN

CHAR

Restrictions: Read-only.

Default Low Value and Default High Value Properties

Each of these properties specifies a range of values.

The default value is obtained from SAP BW.

Restrictions: The Default High Value property is applicable only for variables with a Selection Type of interval.

Description Property

This property is a string value.

SAP BW Variable Type Property

The possible values are numeric, characteristic, hierarchy, or hierarchicalNode.

The default is obtained from SAP BW.

Restrictions: Read-only.

Prompt Type Property

The default value depends on the type of the variable. If the value of this property is not one of the predefined values, it is assumed to be hierarchyPickList.

Value

Restrictions

typeIn

Required for numeric variables and optional for characteristic values

pickList

Optional for characteristic variables

calendar

Only for characteristic variables based on 0CALDAY

hierarchyPickList

Optional for all presentation hierarchies

notApplicable

Required for hierarchy variables

Restrictions: Read-only for some types of variables such as characteristic and formula.

Level Restriction Property

This property is a numeric value.

The default value is 1.

Restrictions: Applicable only for hierarchical node variables with a Prompt Type of hierarchyPickList.

Trim Levels Property

This property is a string value that reduces the number of members in a hierarchical picklist. If the property is set to zero (0), members from all levels of a hierarchy are included in the prompt. You can also specify a range such as 2:4 to include only the members from certain levels. If the starting and ending ranges are the same, such as 3:3, only members from that level will be included.

The default value is zero (0).

Restrictions: Applicable only for characteristic variables with a Prompt Type of hierarchyPickList.

Use Default Values Property

This property is a boolean property that determines whether the default values will be used. If this property is set to true, your users are not prompted for the associated variable, and the default value is always applied.

The default value is false.

Initial Number of Pick List Values Property

A numeric value that specifies the initial number of values used to populate a picklist, hierarchical picklist, or prompt.

The default value is zero (0), which means all.

Show Key and Caption Property

To show keys and captions for SAP BW variables, set this property to true. This property is applicable only for pick list prompts and hierarchy node prompts.

The default value is false.

Numeric Variable Property Values

The following variable properties are applicable to numeric variables:

Property

Default value

Type

numeric

Caption

 

Selection Type

value

Entry Type

 

Data Type

 

Default Low

 

Default High

 

Prompt Type

typeIn

Fixed Value

false

You can change the default values for a numeric variable except for the Prompt Type property, which is read-only.

Hierarchy Variable Property Values

The following variable properties are applicable to hierarchy variables:

Property

Default value

Type

hierarchy

Caption

 

Selection Type

value

Entry Type

obtained from SAP BW

Data Type

xsdString

Default Low

 

Default High

 

Prompt Type

not applicable

Because hierarchy variables are resolved entirely at run time, all these properties are read-only.

Characteristic Variable Property Values

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.

Characteristic Value Variable Property Values

The following variable properties are applicable to characteristic value variables:

Property

Default value

Type

characteristic

Caption

 

Selection Type

obtained from SAP BW

Entry Type

obtained from SAP BW

Data Type

xsdString

Default Low

If the entry type is value or complex, the default property is shown.

If the entry type is interval, the default low property is shown. This value is obtained from SAP BW.

Default High

If the entry type is value or complex, the default property is shown.

If the entry type is interval, the default high property is shown. This value is obtained from SAP BW.

Prompt Type

typeIn or pickList

This depends on the number of members in the referenced dimension.

If the value is invalid, typeIn is used.

Fixed Value

false

A characteristic value variable for the 0CALDAY dimension is shown in the model as a date. The Data Type property is set to xsdDate and the Prompt Type property is set to calendar. The Prompt Type property is read-only for the 0CALDAY dimension.

Hierarchy Node Variable Property Values

The following variable properties are applicable to hierarchy node variables:

Property

Default value

Type

characteristic

Caption

 

Selection Type

value

Entry Type

obtained from SAP BW

Data Type

xsdString

Dimension

obtained from SAP BW

Hierarchy

obtained from SAP BW

Default Low

 

Default High

 

Prompt Type

hierarchy PickList

You can change the Prompt Type property to typeIn or pickList.

Trim Levels

zero (0)

Fixed Value

false

Maximum Number of Values

100

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: