COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: giovanni.lucarelli on 10 Oct 2008 03:37:25 AM

Title: Cognos 8 - Report Studio
Post by: giovanni.lucarelli on 10 Oct 2008 03:37:25 AM
Hi,
first of all I wanna tell u that I'm not expert about Cognos 8 Report Studio so, maybe, my question could be very stupid for somebody  :-[
however...I have this problem: I have a prompt on Time Regular Dimension where I choose a month...well...I need in my report billling for the month that i choosed and for the previous one.

which function I should to use to obtain the previous munth?

(I am working with Oracle 10g db)

Please help me...thanks for everybody
Title: Re: Cognos 8 - Report Studio
Post by: blom0344 on 10 Oct 2008 04:44:26 AM
For a dimensional package I would guess the prevMember function, for a relational package you can use a CASE expression:

CASE WHEN
[MONTH] = 1 THEN 12
ELSE [MONTH] - 1
END
Title: Re: Cognos 8 - Report Studio
Post by: giovanni.lucarelli on 10 Oct 2008 08:33:25 AM
thanks very much blom0344 to reply so fast...  ;)

yeah, I forgot to tell u that I have a dimensional package.... but the problem persists still... this becasue if I use a prompt filter (id est year=2007) in my report I have the year selected by the prompt (2007 in this case) but I've no the previous (using prevMember function) 'cause the report is filtered by that prompt ...
sorry for my englisk  :-[

Title: Re: Cognos 8 - Report Studio
Post by: Suraj on 10 Oct 2008 01:11:22 PM
of course it'll be blank if you filter the query for 2007 and try to go back to 2006.
you have to use similar logic for year as well or just have both years come to the report and apply logic when month is 1, go for 12 month of last year.
Title: Re: Cognos 8 - Report Studio
Post by: vincentsquirexiii on 04 Mar 2009 11:00:45 PM
try this in the filter:


"([year] = ?year_parameter?) or ([year] = ?year_parameter? - 1)"