cancel
Showing results for 
Search instead for 
Did you mean: 

How to get only Previous Month data in Report.

0 Kudos

Hi Experts,

Need your Help!

I am using Business Object XI, while creating report need to populate data only for Previous month.

As of now "Booked Date" is coming from years 2001 to till date but users want to populate data for those Flats booked previous month only.

This report is "Scheduled" BO report.

Please see the attached JPG file for your reference. Here I want to reflect only Aug 2015 data ( Aug, 1 2015 to Aug, 31 2015).

Please let me know how to get Previous month data in report.

Thanks

Sam

Accepted Solutions (1)

Accepted Solutions (1)

amitrathi239
Active Contributor

Hi,

try with these steps.

V Prev Month=Month(RelativeDate(CurrentDate();-(DayNumberOfMonth(CurrentDate())+1)))

V Booked Month=Month([Booked Date]

Create a variable and apply the filter on the table.

V Month=If([V Booked Month]=[V Prev Month]) then "Show" else "Hide"

Apply the report filter where V Month equals to Show.

Amit

0 Kudos

Hi Amit,

Thanks for your reply!

I tried your advice but its not working as we are looking for. But some how now in report all the records coming only for Aug month but years..... 2011,2012,2013,2014,2015.

Please see the JPG file for your reference.

Thanks

Sam

amitrathi239
Active Contributor
0 Kudos

Hi,

try with these.

V Prev Month=FormatDate(RelativeDate(CurrentDate();-(DayNumberOfMonth(CurrentDate())+1));"MM/yyyy")

V Booked Month=Formatdate([Booked Date];"MM/yyyy")


Create a variable and apply the filter on the table.

V Month=If([V Booked Month]=[V Prev Month]) then "Show" else "Hide"

Apply the report filter where V Month equals to Show.

Amit

0 Kudos

Hi Amit,

Sorry for replying you very late!

your advice worked. You are awesome.

Thank you soooooo much.

Thanks

Sam

0 Kudos

Hi,

It's possible to put prints of this steps??

Kind Regards,

Bernard

Answers (3)

Answers (3)

0 Kudos

DATA: vdate TYPE datum.

TRY.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = -2
olddate = sy-datum
IMPORTING
newdate = vdate.
CATCH cx_root.
ENDTRY.

WRITE vdate.
Former Member
0 Kudos

Hi Sam,


You can create a report level variable "PreviousMonth" =ToNumber(UserResponse("month"))-1 to get previous month value.


-Megha

0 Kudos

Hi Megha,

Thanks for your reply!

Tried your advice but getting error "#ERROR".

Please advice some other option.

Thanks

Sam

former_member196948
Participant
0 Kudos

Hi Sam,

Try below function in Universe level..

Create Object called Sysdate : add_months(SYSDATE(),-1)

and use as a filter in report

Regards,

Jeet