Design > Expression Macros > Hybrid Macros
  

Hybrid Macros

A hybrid macro expands an expression both vertically and horizontally. A hybrid macro generates a set of vertical expressions that also expand horizontally.
Configure a hybrid macro based on your business requirements. Use the configuration guidelines for vertical and horizontal macros to create a hybrid macro.

Example

For example, the following expression uses the %OPR_IIF% horizontal expansion function to convert the format of the date fields represented by the %dateports% macro input field to the 'mm-dd-yyyy' format:
%OPR_IIF[IsDate(%dateports%,%fromdateformat%),To_String(To_Date(%dateports%,%fromdateformat%),'mm-dd-yyyy'),%dateports%]%
The %fromdateformat% macro input field defines the different date formats used in the date fields: mm/dd/yy and mm/dd/yyyy.
At run time, the application expands the expression vertically and horizontally, as follows:

IIF(IsDate(StartDate,’mm/dd/yy’),To_String(To_Date(StartDate,’mm/dd/yy’),’mm-dd-yyyy’),
IIF(IsDate(StartDate,’mm/dd/yyyy’),To_String(To_Date(StartDate,’mm/dd/yyyy’),’mm-dd-yyyy’), StartDate))

IIF(IsDate(EndDate,’mm/dd/yy’),To_String(To_Date(EndDate,’mm/dd/yy’),’mm-dd-yyyy’),
IIF(IsDate(END _DT,’mm/dd/yyyy’),To_String(To_Date(EndDate,’mm/dd/yyyy’),’mm-dd-yyyy’), EndDate))
The expression expands vertically to create an expression for the StartDate and EndDate fields that %dateports% represents. The expression also expands horizontally to use the constants that %fromdateformat% represents to evaluate the incoming fields.