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
Also the format in which my dataitem is : yyyymm
The two portions of your between clause will return DATE datatypes. The datatype of [DataItem] must also be a date.
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
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.
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
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.