COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ambuj2k50 on 19 Oct 2012 01:42:08 AM

Title: Prev 3 Quarter data from Input Quarter
Post by: ambuj2k50 on 19 Oct 2012 01:42:08 AM
Hi all,

I want to create a crosstab with product line as rows and in columns in want to add the Quarter input by user and prev three quarter to that. The user should have to option to input the frequency of previous quarters to be shown in the column.

I am using DMR (Sales Data Warehouse ) Package.

Plz suggest the possible way to achieve it with the sample package.

Thanks in advance.
Title: Re: Prev 3 Quarter data from Input Quarter
Post by: pricter on 19 Oct 2012 05:03:00 AM
Unfortunately I do not have a report studio in front of me.

In order to get the selected quarter create a data item (named Selcted Quarter)with the following expression

[Quarter Level]->?Quarter?

For having the last three quarters create a data item with the following expression

lastPeriods ( 3, [Selected Quarter])
Title: Re: Prev 3 Quarter data from Input Quarter
Post by: ambuj2k50 on 19 Oct 2012 09:38:52 AM
Thanks Pricter for replying...
When i created the report with the given code it is throwing the error DPR-ERR-2056 : The Report Server is not responding. (Though i can run other report)
Please check the attached XML and suggest some solution.
Title: Re: Prev 3 Quarter data from Input Quarter
Post by: pricter on 19 Oct 2012 10:06:12 AM
As I said I do not have a cognos installation infront of me.

But you can try the following.

Instead of using parameter ?P1? try to use a macro to fetch it. For example

lastPeriods (#prompt('P1','integer','3')#,[Selected Quarter])
Title: Re: Prev 3 Quarter data from Input Quarter
Post by: pricter on 20 Oct 2012 11:19:24 AM
I managed to get a report studio in front of me with the sample.

You wrongly used the Quarter Key. Instead of this you should use the Quarter Level

For example replace the (in both queries)

[Sales].[Time].[Time].[Quarter].[Quarter key]

with

[Sales].[Time].[Time].[Quarter]

and your report will work
Title: Re: Prev 3 Quarter data from Input Quarter
Post by: ambuj2k50 on 22 Oct 2012 02:54:01 AM
Thanks a lot ... You solved my problem :)