dcsimg

How do I configure date macros for scheduled exports?

Products

Webtrends Analytics 8.x
Webtrends Analytics 9.x

Cause

In addition to using date macros to specify which log files in a data source are to be analyzed, Webtrends can also schedule report exports that save the files to a specified path using date macros to define the file name. This feature is useful in situations where there is concern that previously saved files may be overwritten by new ones. Using date macros, the exported reports can be saved using the current date, or a predefined date, without fear of overwriting previous exports.


Resolution

When creating a new scheduled job, select Scheduled Jobs > New and move through the Scheduled Report Wizard to the Report Destinations option. Check the box for “Save the report to the location specified below” and under “File Location and Name,” specify the path where the export is to be saved. Anything can be used for the naming convention, whether it is prefixed, inserted, or appended to the date macros. The options for the date macros are as follows:

%dd+n%, %dd-n% – Specifies the current day, plus or minusndays
%mm+n%, %mm-n% – Specifies the current month, plus or minusnmonths
%yy+n%, %yy-n% – Specifies the current year, plus or minusnyears
%yyyy+n% – Specifies the current four-digit year, plusnyears
%yyyy-n% – Specifies the current four-digit year, minusnyears
%dy% – Specifies the current day of year (001-366)
%wy% – Specifies the current week of year (00-53)
%dw% – Specifies the current day of week (0-6)
%wm% – Specifies the current week of month (0-5)

Examples:
If today is September 17th, then “C:\Testing\file-%mm%-%dd%.pdf” would export the file “file-09-17.pdf” to C:\Testing.

If today is September 17th, 2009, then “C:\Exports\%yyyy%%mm%%dd%_Content Groups.doc” would export the file “20090917_Content Groups.doc” to C:\Exports.

If report data from the previous month is being exported (e.g., it’s the first of the month and the previous month’s data is needed) then “C:\monthly_report-%mm-1%.doc” would export a file named “monthly_report-08.doc”