Hi,
Platform: BO CR XI R2 (Version 11.5) and Oracle 8i
I am trying to create a MTD report. I can't use CR's "MonthToDate" feature because our fiscal Calendar Year is set up differently than the "normal" calendar year. For example, our months don't begin at the 1st of every month but rather the 27th or 28th of the previous month. This month is tracked in a field called PERIOD , in the format "200612", meaning 2006 December.
That's why rather than using a record selection filter such as
{TABLE.INVOICE_POSTED_DATE} is in the period MonthToDate ,
instead I want to use a filter such as
{TABLE.PERIOD} = Year (currentDate) & Month (currentDate),
The problem with this filter is that it won't work when the the month (PERIOD) changes on the last few days of the actual month (after the 27th or the 28th)
So I wrote a formula to determine the correct month to filter by, using a global variable:
Global StringVar tempMonth;
if {TABLE.PERIOD} = Year (currentDate) & Month (currentDate) then
tempMonth := Year (currentDate) & Month (currentDate)
else if {TABLE.PERIOD} = Year (currentDate) & Month (currentDate) + 1 then
tempMonth := Year (currentDate) & Month (currentDate) + 1;
Now, that I have the correct month identified using a global variable , I want to modify my selection formula as:
{RECASTED_ALL.PERIOD} = tempMonth
But when I run this filter, I get an error message in the above selection statement saying that CR expects a string, date, number, char, etc instead of the tempMonth . My question is that "tempMonth" is already defined as a Global String variable; why does it not accept/recognize it?
We should be able to define global variables anywhere we want and use them everywhere else in the report, right?
Any ideas whats going on here?
L8R
mirogak
Platform: BO CR XI R2 (Version 11.5) and Oracle 8i
I am trying to create a MTD report. I can't use CR's "MonthToDate" feature because our fiscal Calendar Year is set up differently than the "normal" calendar year. For example, our months don't begin at the 1st of every month but rather the 27th or 28th of the previous month. This month is tracked in a field called PERIOD , in the format "200612", meaning 2006 December.
That's why rather than using a record selection filter such as
{TABLE.INVOICE_POSTED_DATE} is in the period MonthToDate ,
instead I want to use a filter such as
{TABLE.PERIOD} = Year (currentDate) & Month (currentDate),
The problem with this filter is that it won't work when the the month (PERIOD) changes on the last few days of the actual month (after the 27th or the 28th)
So I wrote a formula to determine the correct month to filter by, using a global variable:
Global StringVar tempMonth;
if {TABLE.PERIOD} = Year (currentDate) & Month (currentDate) then
tempMonth := Year (currentDate) & Month (currentDate)
else if {TABLE.PERIOD} = Year (currentDate) & Month (currentDate) + 1 then
tempMonth := Year (currentDate) & Month (currentDate) + 1;
Now, that I have the correct month identified using a global variable , I want to modify my selection formula as:
{RECASTED_ALL.PERIOD} = tempMonth
But when I run this filter, I get an error message in the above selection statement saying that CR expects a string, date, number, char, etc instead of the tempMonth . My question is that "tempMonth" is already defined as a Global String variable; why does it not accept/recognize it?
We should be able to define global variables anywhere we want and use them everywhere else in the report, right?
Any ideas whats going on here?
L8R
mirogak