COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: AJAYC on 09 Oct 2017 11:22:43 AM

Title: Using RoleValue in Substitute function
Post by: AJAYC on 09 Oct 2017 11:22:43 AM
Hi Guys

Is it possible to use a value retrieved from a roleValue within a substitute function ?

I have the following:

#
substitute ( 'SomeValue',
                roleValue ( 'ParameterName', AttributeRequired ) ,
                prompt('ParameterName','memberuniquename'))
#

I'm trying to substitute the "SomeValue" with the value "AttributeRequired", however this is not working for me  :(

Any suggestions gladly accepted.

Thanks
Ajay


Title: Re: Using RoleValue in Substitute function
Post by: CognosPaul on 09 Oct 2017 11:44:00 AM
When using macros, you're limited to the macro function set. roleValue is a dimensional function, set you can put that around the macro function but not inside it.

In a case like this you could make two data items, one that has the mun and one with the roleValue. Pull the mun into the report and on the node add the roleValue as a property.

In the report change the text item from member caption to report expression. You can then use report expressions on both data items to get the desired results. Unfortunately there's no substitute or replace function in the report expressions, so you can probably do something with length, substring, and concatenation.