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
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
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 :-[
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.
try this in the filter:
"([year] = ?year_parameter?) or ([year] = ?year_parameter? - 1)"