COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => Upgrade to C8 => Topic started by: Aditi on 30 May 2012 04:57:05 AM

Title: Automating a report in cognos 8.4
Post by: Aditi on 30 May 2012 04:57:05 AM
Hi All,
I need to automate a report in cognos for the previous month.
I am currently working in 8.4 version and proceeding by making changes with the filter but its not helping me .
Below is the code im using for Filter condition:

[DataItem] between (first_of_month(add_months(current_date,-1)) and (last_of_month(add_months(current_date,-1)))
Its giving me Pogo Handling errors while i validate the report.
Any suggestion on how can i automate my report?

Thanks,
Aditi
Title: Re: Automating a report in cognos 8.4
Post by: Aditi on 30 May 2012 05:50:10 AM
Also the format in which my dataitem is : yyyymm
Title: Re: Automating a report in cognos 8.4
Post by: Lynn on 30 May 2012 06:57:48 AM
The two portions of your between clause will return DATE datatypes. The datatype of [DataItem] must also be a date.
Title: Re: Automating a report in cognos 8.4
Post by: Aditi on 31 May 2012 06:46:44 AM
Hi Lynn,
I understand the format of the two is not matching here, could you please tell me the exact equation or the function to be used to make the format same.
I tried using caption function and then casting it into varchar...
but i tink i am not framing it properly.

Please help.

Thanks,
Aditi
Title: Re: Automating a report in cognos 8.4
Post by: Lynn on 31 May 2012 07:24:26 AM
I'm not sure you posted this question to the correct board which is unfortunate since you may not get the benefit of advice from others. Is your source a cube? You mention the caption function which is a dimensional concept although filtering is a relational construct.

There are numerous posts about not mixing dimensional and relational constructs. I suggest you search the boards more thoroughly to see if you can find an answer already posted. I'm afraid I don't know how to advise you on how to achieve your requirement.
Title: Re: Automating a report in cognos 8.4
Post by: Aditi on 01 Jun 2012 04:14:13 AM
Lynn,
I am now trying to do it by using the following code description:

case (?P_timebucket?)
when (1)
then
(
[MONTHYEAR] = extract(year,getdate())+
extract(month,getdate()-1)
)
else (1=2)
end

Monthyear is of the format 201206 and the left side of the equation sign is to be converted to the same format as the right side.

My source is a cube as enquired by you in the previous post.

Thanks,
Aditi
Title: Re: Automating a report in cognos 8.4
Post by: Lynn on 01 Jun 2012 09:19:49 AM
I'm not well versed enough on reporting with cube sources to answer you question. I do know that case is also a relational concept rather than a dimensional concept, so I suspect you are barking up the wrong tree.