COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Kindness on 03 Mar 2011 10:43:11 AM

Title: How to get level label
Post by: Kindness on 03 Mar 2011 10:43:11 AM
Hi!
Does anybody know how to get level label from given member?

for example, if we look to the property of some member:
Path [Dimensional Layer].[Training Modules].[Main Hierarchy].[Training Module]->[all].[3]
Ref [Dimensional Layer].[Training Modules].[Main Hierarchy].[Training Module]->[all].[3]
Member Caption Food Handling
Member Unique Name [Dimensional Layer].[Training Modules].[Main Hierarchy].[Training Module]->[all].[3]
Level Unique Name [Dimensional Layer].[Training Modules].[Main Hierarchy].[Training Module]
Hierarchy Unique Name [Dimensional Layer].[Training Modules].[Main Hierarchy]
Dimension Unique Name [Dimensional Layer].[Training Modules]
Level Number 1
Level Label Training Module
Parent Unique Name [Dimensional Layer].[Training Modules].[Main Hierarchy].[Training Modules (all)]->[all]

I need to get this property - Level Label Training Module.

Thanks.
Title: Re: How to get level label
Post by: AussiePete2011 on 03 Mar 2011 06:21:22 PM
Hi there,

This might be what you are after
http://www-01.ibm.com/support/docview.wss?uid=swg21371398

roleValue

Returns the value of the attribute that is associated with the role whose name is specified by "string" within the specified context. The second argument 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 modelled relational data sources, assignment of roles is the modeller's responsibility.) Intrinsic roles that are defined for members of all data source types include: '_businessKey', '_memberCaption', '_memberDescription', '_memberUniqueName'.

http://publib.boulder.ibm.com/infocenter/c8bi/v8r4m0/topic/com.ibm.swg.im.cognos.ug_cr_rptstd.8.4.1.doc/ug_cr_rptstd_i_sql-99.html#sql-99

Cheers
Peter B
Title: Re: How to get level label
Post by: JGirl on 07 Mar 2011 11:17:03 PM
Does caption(level([Member])) give you what you need?
Title: Re: How to get level label
Post by: Kindness on 10 Mar 2011 06:26:50 AM
No, it doesn't. it returns captions of all members in the level. but i need a label of level, for example: if we have time hierarchy than the level label of the member [march/2011] is [month], the level label of the member [2011] is [year].
Title: Re: How to get level label
Post by: AussiePete2011 on 10 Mar 2011 05:13:01 PM
http://my.safaribooksonline.com/book/databases/business-intelligence/9781849680349/working-with-dimensional-models/161