COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Sundaramoorthy on 03 Mar 2016 08:52:11 AM

Title: Issue with Macro(Applicable to Not Null Columns)
Post by: Sundaramoorthy on 03 Mar 2016 08:52:11 AM
Hi All,

For one of the requirement, In order to select dynamic columns during run time we have defined static choices in prompt & also placed macro in the data items. Here for few columns like Indicators(It has data either 'Y' or 'N') & which got set as not null columns in DB, below macro is throwing error.

#promptmany('pIndicator','token','A')#

Please advise.
Title: Re: Issue with Macro(Applicable to Not Null Columns)
Post by: MFGF on 03 Mar 2016 10:41:41 AM
Quote from: Sundaramoorthy on 03 Mar 2016 08:52:11 AM
Hi All,

For one of the requirement, In order to select dynamic columns during run time we have defined static choices in prompt & also placed macro in the data items. Here for few columns like Indicators(It has data either 'Y' or 'N') & which got set as not null columns in DB, below macro is throwing error.

#promptmany('pIndicator','token','A')#

Please advise.

Aha! "Throwing error"? Is this a game where we have to guess what the error is before we can start to consider what might be causing it? Ok! I'm up for the challenge!

My first guess is that the error message says "Error! Cognoise members are not clairvoyant". Am I right?
If so, I think the issue is that nobody who has signed up to use this forum (so far) has the ability to read minds. I don't see any fix for this error, sadly. I can recommend an excellent workaround, though. You should post up as many details about the issue as you can, including the precise details of the error message you might be getting, and then no clairvoyance would be necessary.

You should also take a look at the post below - the first numbered paragraph will help you LOTS.

http://www.cognoise.com/index.php/topic,24030.0.html

Always happy to help! :)

MF.
Title: Re: Issue with Macro(Applicable to Not Null Columns)
Post by: Sundaramoorthy on 03 Mar 2016 11:17:17 AM
Hi MF,

For my mentioned issue,just i need to know the valid macro expression for columns which should not have null values in them.

Just overview of that logic with sample

Having static choice prompt (checkbox) with parameter :pIndicator

Use Value : [Sales (Query)].[Product].[Product Indicator]

Display Value: Product Indicator

So, if we not selected this particular column during report execution from prompt, then that column should not get included in the DB hitting query.For resolving that, instead of actual expression i placed this macro in the data item & got the error like parsing text issue.
Title: Re: Issue with Macro(Applicable to Not Null Columns)
Post by: Gopinath on 04 Mar 2016 02:18:44 AM
enclose your default value 'A' with an sq()

#promptmany('pIndicator','token',sq('A'))#


Title: Re: Issue with Macro(Applicable to Not Null Columns)
Post by: Sundaramoorthy on 04 Mar 2016 02:28:14 AM
Thanks Gobinath...Will try that option.
Title: Re: Issue with Macro(Applicable to Not Null Columns)
Post by: Sundaramoorthy on 04 Mar 2016 06:41:43 AM
Thank you Gobinath..its worked