Blog Pro de Jean-Baptiste HEREN

Notes d'un consultant Freelance en Informatique

To content | To menu | To search

Cognos 8 - convert a member unique name from one hierarchy to another

If you need to build any report or Event studio Query using the same data from different packages; and you want to prompt just once.

You can convert the member unique name from one hierarchy to another, using the cognos substitute macro.

Consider the following example :

You prompt on level value using the following hierarchy :

[First package].[First dimension].[First hierarchy].[First Level]

Then you want to filter one Query built on another package using the same prompt value :

[Second package].[Second dimension].[Second hierarchy].[Second Level]

It means yo uwant to convert :

-- Source hierarchy
[First package].[First dimension].[First hierarchy].[First Level]->:[YK].[[First dimension]].[First hierarchy]].[First Level]].&[00004]]]

-- to Destination Hierarchy
[Second package].[Second dimension].[Second hierarchy].[Second Level]->:[YK].[[Second dimension]].[Second hierarchy]].[Second Level]].&[00004]]]

So you can use a Query element containing a substitute macro :

-- Formula
# sq(substitute ('First package','Second package',
 substitute ('First hierarchy','Second hierarchy',
 substitute ('First dimension','Second dimension',
 substitute ('First Level','Second Level',
 prompt('First Level Prompt Name', 'token')))))) #

Post updated on Wednesday 06 April 2011, 15:45

Jean-Baptiste Heren

Author: Jean-Baptiste Heren

Stay in touch with the latest news and subscribe to the RSS Feed about this category

Be the first to comment on this article

Add a comment This post's comments feed

no attachment



You Might Also Like

result_crosstab.png

Cognos Report : Display a different measure in row for the aggregated column

Following tip is when you use a Relational Datamodel (DMR). In a Cognos Report crosstab, If You need to Display different measure in the aggregated column, you can do it using a simple if-then-else...

Continue reading

model.xml documentation in cognos 8 with xslt

In one of my recent projects, I had to build an automatic documentation builded on top of a database, using cognos 8 reporting itself. This article covers the way I could extract technical...

Continue reading