COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: fshahul on 03 Aug 2017 10:25:57 PM

Title: Define Last Month as default value for prompt based on dimensional datasource
Post by: fshahul on 03 Aug 2017 10:25:57 PM
Hi,

I need to set Last month as a default selection in the value prompt using DMR model in Cognos 10.2.1.

Use Value: [AB DMR].[All Dates].[Date].[Month]
Values are like: 2017/JAN, 2017/FEB, 2017/MAR.....

For Sorting, we used Month Key column.

Can anyone please help me on this.

Thanks.

Title: Re: Define Last Month as default value for prompt based on dimensional datasource
Post by: fshahul on 03 Aug 2017 10:27:48 PM
Please check the tabular data.
Title: Re: Define Last Month as default value for prompt based on dimensional datasource
Post by: New_Guy on 04 Aug 2017 07:36:25 AM
Hi,
Create a value prompt using the month members, and also static choice like previous month or current month based on your requirement.
Create a data item for your time using the filter function like case when ?prmTime? = 'Current Month' then item filter([Time hierarchy], roleValue('_memberCaption',[Time Hierarchy] = #sq( timestampMask ( $current_timestamp , 'yyyy-dd-mm' )) # else [Time hierarchy] = ?prmTime? end.
Manipulate the #sq macro to macro to match your membercaption or the businesskey.
Check the below link
http://www-01.ibm.com/support/docview.wss?uid=swg21458631 (http://www-01.ibm.com/support/docview.wss?uid=swg21458631)

Good luck
New guy