Summary
This articles describes Macros and their usage. Macros are placeholders used to generate contextual information and utilize it in various ways. Macro usage includes customizing file and folder names in deliveries and supplying document parameter values.
Macro Usage
Fields marked with the M icon support the use of Macros. Macros may be entered manually or selected from the Macro Builder.
Macro Builder
Use the Macro Builder to view available macros and preview macro result. Not all macros will resolve as some are contextual and can only be resolved at runtime.
- Select the M button to open the Macro Builder
- Select a macro
- Add it to Field Value
- Select the Test button to preview the result
- Select the Apply Field Value button
Custom Function
Create a custom function using and reuse the function (Macro Build > Functions)
Create
- Open the Macro Builder
- Select Date category
- Add a Marco to Field Value and customize (example: [FIRSTDAYINMONTH+1D])
- Select Test
- Select Save
- Name: Provide function name
- Description (optional): Provide function description
Manage
Manage custom function under System > Configuration > Catergory:General > UserFunctionMacros
Usage Examples
- File: [$DOCNAME]_[=state]_[TODAY,MM-DD-YYYY] = Revenue By State_Arizona_11-10-2009
- Folder: \\folder1\[$DOCNAME]\[TODAY,MM-DD-YYYY] = \\folder1\Revenue By State_Arizona\11-10-2009
System Macros
System macros are invoked using [$MACRONAME]
Macro | Description | Example/Options |
---|---|---|
BURST | Burst Name | |
BURSTID | Burst ID Number | |
BURSTSTATUS | Burst Status (started, completed or aborted) | |
BURSTITEMS | List of documents in a burst and their status | |
BURSTOUTPUT | List of files delivered to a destination | $BURSTOUTPUT
|
DELIVERY | Delivery name | |
DOCNAME | Document Name | |
DOCINAME | Instance Name | A burst can contain multiple instances of a document, each uniquely named. This macros returns the document instance name. |
DOCDESC | Document Description | |
DP | Data Provider name when publishing Web Intelligence in Delimited Text format | |
SCHEDULE | Schedule Name | |
SCHEDULESTATUS | Status of a schedule (started, completed, aborted, or expired) | |
SCHEDULEITEMS | List of bursts in a schedule and their status | |
EVENT | Event name | For use in event-based schedule to insert Event name into schedule Action notifications |
TAB | Report tab name | Insert Web Intelligence report tab name in a file name when the Split option is used. Example: Report tab name is SUMMARY. [$TAB]_[TODAY,MM-DD-YY] SUMMARY_10-28-10 |
VIEW | Tableau view name | Insert Tableau view name in a file name when the Split option is used. Example: View name is SUMMARY. [$VIEW]_[TODAY,MM-DD-YY] SUMMARY_10-28-10 |
XDCID | XDC ID Number | |
XDCNAME | XDC Name | |
XDCPATH | Folder path where XDC object resides | |
DOCEXTID | XI Document ID Number | |
USER | InfoBurst User | Name of the InfoBurst user requesting the job |
USEREMAIL | InfoBurst User email address | Email address of the InfoBurst user requesting the job |
SERVERNAME | InfoBurst server name | |
SYSTEMMESSAGE |
Date-Time Macros
Macro | Description | Example | Support +/- | Date Units |
---|---|---|---|---|
M | Month of year | 1 | Yes | N/A |
MM | Month of year | 02 or 10 | Yes | N/A |
DD | Day of month | 05 or 12 | Yes | N/A |
YY | Current Year | 04 | Yes | N/A |
YYYY | Current Year | 2004 | Yes | N/A |
HH | Hour | 12 | Yes | N/A |
MN | Minute | 34 | Yes | N/A |
SS | Second | 20 | Yes | N/A |
DATE | Current Date | 01_10_04 | No | same as [MM]_[DD]_[YY] |
TIME | Current Time | 12_34_20 | No | same as [HH]_[MN]_[SS] |
WEEK or WW | Week # | 05 | Yes | N/A |
DN | Day # | 02 | Yes | N/A |
QTR | Quarter | 01 | Yes | N/A |
DY or DDX | Short Day | MON | No | N/A |
DAY or DDLX | Long Day | MONDAY | No | N/A |
MMX | Short Month | JAN | No | N/A |
PREVMONTH | Previous month (short) | JAN | No | N/A |
MMLX | Long Month | JANUARY | No | N/A |
PREVLONGMONTH | Previous month (long) | JANUARY | No | N/A |
TODAY | Todays Date | 8/11/10 [TODAY,YYYYMM] = 201008 [TODAY-1M,MM-DD-YY] = 07-11-10 [TODAY-7D,DD-MONTH-YYYY] = 11-AUG-2010 | Yes | D,K,M,Y |
CURRXXX | Day of current week as defined in macro | CURRMON = 4/8/13 | Yes | D,K,M,Y |
PREVWORKDAY | Previous working day (includes holidays) | 5/5/04 | Yes | D,K,M,Y |
PREVxxx | Date of previous day of the week where xxx is the day abbreviation. Supports date formatting. | [PREVFRI] = 12/10/10 [PREVFRI,MM-DD-YYYY] = 12-10-2010 | No | D,K,M,Y |
NEXTxxx | Date of previous day of the week where xxx is the day abbreviation. Supports date formatting. | [NEXTMON] = 12/20/10 [NEXTMON,MM-DD-YYYY] = 12-20-2010 | No | D,K,M,Y |
XXXYYYInMonth | XXX=1st-5th, YYY=SUN-SAT | [2ndTUEInMonth] | Yes | D,K,M,Y |
XXXYYYInNextMonth | XXX=1st-5th, YYY=SUN-SAT | [3rdMonInNextMonth] | Yes | D,K,M,Y |
LastXXXInMonth | XXX=SUN-SAT | [LastSATInMonth] | No | |
LastXXXInNextMonth | XXX=SUN-SAT | [LastSATInNextMonth] | No | |
XXXDayInMonth | XXX=1st-31st | [10thDayInMonth] | Yes | D,K,M,Y |
XXXDayInNextMonth | XXX=1st-31st | [5thDayInNextMonth] | Yes | D,K,M,Y |
FIRSTDAYINMONTH | First day in month | 1/1/04 | Yes | D,M |
LASTWEEKDAYINMONTH | Last week day in current month | N/A | Y | D,K,M,Y |
LASTWEEKDAYINQTR | Last week day in current quarter | N/A | Y | D,K,M,Y |
LASTWEEKDAYINYEAR | Las week day in current year | N/A | Y | D,K,M,Y |
LASTDAYINMONTH | Last day in current month | 1/31/04 | Yes | D,M |
FIRSTDAYINQTR | First day in month | 1/1/04 | Yes | Q |
LASTDAYINQTR | Last day in current quarter | 1/31/04 | Yes | Q |
FIRSTDAYINYEAR | First day in year | 1/1/04 | Yes | Y |
LASTDAYINPREVQTR | Last day in previous quarter | 3/31/04 | Yes | D,K,M,Y |
LASTDAYINYEAR | Last day in year | 12/31/04 | Yes | Y |
- D: Calendar day
- K: Week day (Mon-Fri)
- M: Month
- Y: Year
- +0 returns the first D/K/M/Y
If-Then Condition
Use simple If-Then condition with Date macros. In the following example, the condition macro resolves 'Y' if the Month Number is less than 7 or 'N' if the number is greater than 7:
[TODAY,MM]~[@iif($value<7,Y,N)]
Combine Date Macro Operators
Combine date macro operators:
Example: [TODAY+4M+0k]
Date Macro Variable
Date macro variable allows for passing of date from one macro to another. Usage scenario described below.
Report runs on 1/1/19. Report contains start and end date parameters. Report should run for past three months.
Start Date: [FIRSTDAYINMONTH-3M] (result = 10/1/18)
End Date: [TODAY-1D] = 12/31/18
The start date should be 9/1/18.
The date macro ($<VARIABLE>) variable allows for passing of date resolved be first macro to be used in second macro. Variable name can vary.
Start Date: [FIRSTDAYINMONTH-3M@startdate] (result = 9/1/18)
End Date: [TODAY-1D$startdate] = 12/31/18
Parameter Macro
The parameter macro is used to provide the document bursting parameter value. The macro is invoked using [=PARAMETER NAME]
Macro | Description | Example |
---|---|---|
PARAMETER NAME | Bursting Parameter Value | If the document prompt name is Enter Customer State: then [=Enter Customer State:] If document filter name is Customer City then [=Customer City] |
Extra Column Macro
The extra macro is used to provide extra column values from a data source used to supply bursting parameter values. The macro is invoked using [%COLUMN NAME].
Function Macros
Function | Parameters | Description | Example |
---|---|---|---|
@first | (variable) or (variable,n) where n = # chars | Extract first (n) chars from a variable | [@first(city)] [@first(product,3)] |
@mid | (var,n1,[n2]) | Extract characters from a variable where n1=starting point and n2=number of characters to extract (optional) | [@mid(city,2,3)] |
@last | (var,n) | Extract last (n) characters from a variable | [@last(city,3)] |
@rpl or @replace | (variable,find,replace) | Replace characters in (find) with (replace) for a variable. Supports multiple characters (i.e., [@rpl(agent,/\:,-)] | [@rpl(agent,/,-)] |
@rm or @remove | (variable,remove) | Remove characters in (remove) from variable | [@rm(agent,/)] |
@sp or @convspace | (variable,find) | Replace characters in (find) with a space for a variable | [@sp(agent,/)] |
@embed | (/folder/file) | Embed HTML file cataloged in InfoBurst into email message | [@embed(/folder1/disclaimer)] When Burst and HTML reside in the same folder, use the following to reference the Burst: [@embed(^burst/disclaimer)] |
@query | (query id,query name,parameter) | Return value from a database query | [@query(105,States,Region=West)] |
Macro Concatenation
Pass the result of one macro to another.
Example
Variable is DATE with a value of 12/31/99. Requirement is to extract the first five characters from the string (12/31) then replace the / with -.
[@first(date,5)]~[@rpl(date,/,-)]
Macro Concatenation Character
The default macro concatenation character is ~. The character can be customized in System > Configuration > General.