COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Revelator80 on 24 Aug 2010 03:16:29 AM

Title: parallelPeriod/prevMember functions
Post by: Revelator80 on 24 Aug 2010 03:16:29 AM
Hi,

I followed the IBM instruction for creating a YTD data item for my reporting purposes, which is working well. However, I want to be able to implement LAST YTD and similar functions. Whenever I try, using either the parallelperiod or prevmember functions (as these seem most useful) I get errors.

My data source is DMR and, as prescribed by IBM I have data items for selected month (just sets the parameter), year to date set: periodsToDate([DW_Present].[Time Information].[Time].[Financial Year];[Selected Month]) and finally the data item for the spend YTD: (total([Evidenced Spend] within set [Year to Date Set]))

My assumption is that I would need to edit one of these to get last YTD. Any advise would be gratefully received.

Cheers
David
Title: Re: parallelPeriod/prevMember functions
Post by: MFGF on 26 Aug 2010 08:00:18 AM
Quote from: Revelator80 on 24 Aug 2010 03:16:29 AMWhenever I try, using either the parallelperiod or prevmember functions (as these seem most useful) I get errors.

Can you share with us the exact syntax you coded for these, and the errors that were reported?

MF.
Title: Re: parallelPeriod/prevMember functions
Post by: peritas-chris on 29 Aug 2010 11:34:12 PM
Great question. Just as MF said, if you could post the exact syntax you are using, that would be great.

Generally, I have a data item that is a direct pointer to the member they chose in the selected hierarchy.

For example, a data item called [ChosenMonth] has expression: [DW_Present].[Time Information].[Time] -> ?Selected Month?

Of course, this requires the right prompt to feed it.  But, it makes navigating around the hierarchy a heck of a lot easier.

You're right to use parallelPeriod too, in the following way:

periodsToDate([DW_Present].[Time Information].[Time].[Financial Year],parallelPeriod([DW_Present].[Time Information].[Time].[Financial Year],[ChosenMonth]))