Creating custom macros
Custom macros that you create can be used in flowchart processes and in definitions for derived fields.
1.
2.
Click Options Two radio button controls with a menu arrow that points down icon and select Custom Macros.
3.
In the Custom Macros dialog, click New Item.
4.
From the Save Under list, select the folder where you want to save the macro. If no folders have been created, use the default, None.
5.
In the Name field, enter a name and declaration for the macro so that it can be referenced.
Use the following syntax: MacroName(var1,var2,...)
For example: GenGroupBy(id,val1,table,val2)
The MacroName must be unique and alphanumeric. It can include underscores (_) but not spaces.
*
*
The variable names must match the variable names in the custom macro definition in the Expression window, and they must be expressed as a comma-separated list in parentheses.
6.
From the Security Policy list, select a security policy for the new custom macro.
7.
Use the Note field to explain what the custom macro is designed to do and what each variable represents.
8.
From the Expression Type list, select the type of custom macro that you are creating:
*
If you select Raw SQL Selecting ID List, you must select a database from the Database field.
*
If you select Raw SQL Selecting ID + Value, you must select a database from the Database field and select a Value Type. Be sure to select the correct value type. Otherwise, when you later attempt to profile this query, a "Mismatched Type" error results.
*
If you select Text as the value type, specify the width of the value type in bytes in the Width (# Bytes) field. You can obtain this information from the database. If you do not have access to the database or are unable to obtain the information, enter 256, the maximum width.
9.
Click in the Expression field to open the Specify Selection Criteria dialog.
10.
*
The following example shows a new custom macro definition.
Custom macro example
11.
Click Save.
The custom macro is saved in the Items List.
The macro can now be accessed by name for use in flowchart processes and in definitions for derived fields.