COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: jburchill on 27 Jun 2014 09:42:09 AM

Title: Changing Expression to New Expression
Post by: jburchill on 27 Jun 2014 09:42:09 AM
Hello, is it possible to change the words inside an expression to reference a new expression.
Example of what I'm trying to do, inside my data item expression [budget].[Jan13]  I want to change that to [budget].[Jan14] since the year is 2014.  then in 2015 it will change automatically.

I've tried to create with strings and current year, but when I run the report it shows [budget].[Jan14] as output since its a string.

Not sure if this can be done, but it would really reduce the number of reports I need to redo each year.
Title: Re: Changing Expression to New Expression
Post by: bi4u2 on 27 Jun 2014 10:19:14 AM
I am attaching a screenshot of a similar solution, this expression is inside a data item in the Framework Manager and is designed to substitute a Year based on a prompt. Maybe this can give you some ideas.
Title: Re: Changing Expression to New Expression
Post by: jburchill on 27 Jun 2014 01:47:38 PM
ok, so you did this in the framework model.  Can you explain your code?  I haven't done much coding inside the FM.