COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tequila on 27 Feb 2014 05:19:31 AM

Title: Prompt - which current_year as standard setting
Post by: tequila on 27 Feb 2014 05:19:31 AM
Hello,

I have list (crosstab) contain costumer revenue in years (2009,2010, 2011, 2012, 2013 and 2014), and a optional prompt to choice a year.

When I start a report und don't choice a year, the list will show only 'current_year' (2014) as Standard settig and not all years.
And after that i can choice other year so far as i will.

Have anybody solution for me

thnx



Title: Re: Prompt - which current_year as standard setting
Post by: navissar on 27 Feb 2014 05:45:15 AM
So, this is a report against a relational data source which should display by default the current year, and if the user selects another year(s) - then it should re-run for those years, right?
We can't really use default selections, because this is dynamic (current year). Macros are particularly handy in situations like this - you set the default value in the macro like this:

[namespace].[query subject].[Year] = #prompt('year','integer',timestampMask ($current_timestamp,'yyyy'))#

This expression will default to current year.
If you want to enable multi select (So users can choose more than one year), you should use
[namespace].[query subject].[Year] in (#promptmany('year','integer',timestampMask ($current_timestamp,'yyyy'))#)

This should do the trick.
Title: Re: Prompt - which current_year as standard setting
Post by: tequila on 27 Feb 2014 06:56:16 AM
Hi Nimrod,

exactly what I mean.

thank you very much

Title: Re: Prompt - which current_year as standard setting
Post by: srinu_anu2007 on 27 Feb 2014 07:27:28 AM
Hi,

My requirment is also same when iam using this filtter iam getting an error


my filter:[packagename].[dimname].[hierarchy name] in (#promptmany ('Year','integer',timestampMask ($current_timestamp,'yyyy'))#)

The argument at position 2 of the function 'in' is invalid in filter/slicer expression '[packagename].[dimname].[hierarchy name] in (2014) ' of query 'Year_Prompt', expected one of the following types: 'member, memberSet'.

iam not using 2014 in my query. please suggest me.

Thanks,
Title: Re: Prompt - which current_year as standard setting
Post by: srinu_anu2007 on 27 Feb 2014 08:01:26 AM
Hello tequila,

Can you explain what you did and how u did? it's very needful in my requirement

Thanks,
Title: Re: Prompt - which current_year as standard setting
Post by: navissar on 27 Feb 2014 08:31:54 AM
Yeah, you're using a dimensional datasource. That would be different. Try
set([packagename].[dimname].[hierarchy name].[Year level]) in (#promptmany ('Year','integer',timestampMask ($current_timestamp,'yyyy'))#)

Or create a proper filter using dimensional syntax.
Title: Re: Prompt - which current_year as standard setting
Post by: Francis aka khayman on 27 Feb 2014 09:11:22 PM
you can use lag([Current Month],12) to get the same month from last year
Title: Re: Prompt - which current_year as standard setting
Post by: srinu_anu2007 on 28 Feb 2014 03:53:15 AM
Hi Nimrod,

I don't have levels in my hierarchy and you can see the whatever i attached for dynamic current month i.e. the same hierarchy for year also iam using and what iam doing in that hierarchy is iam just dragging the hierarchy to my query and selecting the root members only radio buttion and able to see all years like..2009...2017. and i am filtering as you suggested still it's giivng an error(The V5 Query could not be planned by the Query Service. The 'BaseMember' node is invalid for the OLAP Transformation Library and the Query Service Planner is currently not able to resolve it.) can you please suggest the same.

Thanks