COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: andy_mason_84 on 02 Jul 2013 03:26:05 AM

Title: Creating a Global Report variable.
Post by: andy_mason_84 on 02 Jul 2013 03:26:05 AM
Hi All,

Does anyone know if it is possible to create a global variable so that it appears in every report automatically?

For example if we were to have a Boolean variable of 1+1=5 which is always false so we can apply that to comments etc in the report that we never want to render.

The only way I can think about doing it is by adding it into all the default templates, which would resolve this for any new reports, but what about the reports that already exist?

Any advice would be welcomed with open arms  :)

Thanks,

AM
Title: Re: Creating a Global Report variable.
Post by: blom0344 on 02 Jul 2013 04:35:41 AM
Copy variable from template to the reports?  AFAIK you can have global styles, but not 'global' variables outside a report definition
Title: Re: Creating a Global Report variable.
Post by: charon on 02 Jul 2013 10:58:15 AM
I agree with bloom. What exactly is the goal of that variable? (im sorry, but i was not able to follow your example).
Maybe a global filter expression or a parameter map in framework manager would do the trick for you?

cheerz :P
Title: Re: Creating a Global Report variable.
Post by: blom0344 on 02 Jul 2013 11:25:06 AM
blom  8) 8) 8)

sorry about that..

The Cognos model is mainly about manipulating SQL to be generated. Variables are about Cognos itself, don't think you can work them into a model
Title: Re: Creating a Global Report variable.
Post by: charon on 02 Jul 2013 12:24:53 PM
SRY!  ;D

And back to the topic, now i get the requirement. I agree, the FM wont be the right place to execute or implement display-logic. I think your first direction of thinking were correct, implement it in your templates ...and i fear the older reports has to get "migrated" then.  ::)
Title: Re: Creating a Global Report variable.
Post by: andy_mason_84 on 03 Jul 2013 08:14:29 AM
Thanks for your suggestions and comments.

For those that didn't understand my original babble.

Here is another explanation:

In our FM Model we provide a filter for Company that the user can drag in instead of having to create it each time, this way we always know the Parameter will always be 'Company in ?Company?'.

What I want to do is then create a boolean variable that will appear in all reports, that says '?Company? is null'.

Then in all our reports we apply this variable as a Render variable on the Company Column, so if they don't select a company from the prompt (so it passes nothing) then we assume they do not want to see that in the report and that column is hidden.

This is a simplistic explanation, so it may not make logical sense to you, but I don't want to have to create the Boolean Variable in every report if I don;t have too.  Although i am pretty sure that is what i will have to do.
Title: Re: Creating a Global Report variable.
Post by: blom0344 on 03 Jul 2013 08:28:57 AM
Your requirement is quite clear, but AFAIK you cannot add a variable to an FM model. The variable itself is part of the report definition..
Title: Re: Creating a Global Report variable.
Post by: andy_mason_84 on 03 Jul 2013 08:35:50 AM
Cheers Blom, I thought as much.
Title: Re: Creating a Global Report variable.
Post by: barrysaab on 03 Jul 2013 11:58:42 AM
Interesting conversation!Thanks