BusinessObjects Board

Run for previous week...?

I have a report that my users would like to have automatically refreshed for the previous work week. I would like to have the report scheduled to run on the weekend for viewing on Mondays.

Currently, prompts are used to determine start and end dates. I don’t want to have to reschedule the BCA job everyweek…so I’m looking for a way to have this report automatically run for the previous week???

I searched but couldn’t find a solution.

Any ideas? :confused:

Many thanks!


highrider (BOB member since 2005-02-15)

The solution is to replace your prompts with a pre-defined condition (created in the universe) which has the logic to decide what date period should be covered, based upon what day today is.

Here is the BCA FAQ on this…


Nick Daniels :uk: (BOB member since 2002-08-15)

ahh, great. This will for sure work! Thanks for the very quick response!!!


highrider (BOB member since 2005-02-15)

Ok…I have the report built so that when I pass a zero for my prompt it will run for the previous 5 days.

I would like to have the report run for the PREVIOUS YEAR’s previous week as well. If I subtract 366 and 370 off the sysdate, then I would get the exact week for the prior year, mathematically. However, the work week dates could/will shift.

Is there an easy way to subtract a years worth of time from a date, and have the work week dates align?


highrider (BOB member since 2005-02-15)

Hi,

I dont have access to the universe and I can create an object in the report only. My Rec also similar. Whenever my client wants to run the report it should display the data for previous week only.

Can you suggest something…


tsreddy09 (BOB member since 2006-01-31)

You can use CurrenDate(), RelativeDate(), DayNumberOfWeek() functions to create necessary filters and show data only for previous week.


mkumar (BOB member since 2002-08-26)

In report leve, you can use macro to set default values,

Private Sub Document_BeforeRefresh(Cancel As Boolean)
Call Default
End Sub

Sub Default()
For i = 1 To ActiveDocument.Variables.Count
  If ActiveDocument.Variables.Item(i).IsUserPrompt = True Then
     If ActiveDocument.Variables.Item(i).Name = "Enter Country" Then
        ActiveDocument.Variables.Item(i).Value = "US"
     End If
  End If
Next i
End Sub

Hope this helps.


KhoushikTTT :us: (BOB member since 2005-02-24)

Thanks…I tried with current date and got it…


tsreddy09 (BOB member since 2006-01-31)