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???
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.
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?
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.
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