Built-In Macros
DivePort provides a set of built-in macros (also referred to as portal variables) that represent commonly required values.
- Most are global, available from every page in a portal.
- Some are limited, available only in specific portlet instances.
- Some require a Measure Factory license.
Built-in macros use the format:
$(MACRO_NAME)
The macro name must be in all capital letters, enclosed in parentheses, and preceded by a dollar sign. Some built-in macros require parameters to be included within the parentheses.
IMPORTANT: Parameters to macros that contain spaces must be enclosed in quotation marks.
Macro Name | Description |
---|---|
BASE_URI | Represents the path from the webapps subdirectory of the installation directory to the main page. For example, $(BASE_URI) returns /DivePort-test. |
CLIENT_IP | Represents the IP address of the current browser’s host system. For example, $(CLIENT_IP) returns address 192.162.125.26. |
CONCAT | Concatenates any number of arguments without spaces or delimiters. For example, $(CONCAT This Fine Day) returns ThisFineDay. |
CROSSLINK_VALUE |
Displays the last CrossLink selection for the specified dimension, using the format $(CROSSLINK_VALUE <dimension> <default>). Where: <default> is the text that displays if there is no CrossLink. If a <default> value is not included, an empty string is displayed. For example: $(CROSSLINK_VALUE “Sales Region” “None yet”) returns the last CrossLinked Sales Region value or the string None yet if no CrossLink has occurred. |
CURRENT_URI | Represents the full server path of the current page, as seen in the address bar. For example: $(CURRENT_URI) returns https://MyCompany.com/DivePort-#page=a0166. |
DIVELINE_SERVER | Displays the current DiveLine server name. For example, $(DIVELINE_SERVER) returns MyCompany.com:2130. |
DIVEPORT_VERSION | Displays the current major version and the point release of DivePort. For example, $(DIVEPORT_VERSION) returns 7.0(26). |
DOCUMENTS_URI | Used to create a URL to a resource located in a Document Library on the current DivePort instance. For example, $(DOCUMENTS_URI)/Customer Invoices/2019/12345.pdf produces a URL that fetches the file /2019/12345.pdf from the Document Library named Customer Invoices. |
IMAGES_URI | Used to create a URL to a resource located in the custom images folder of the current DivePort instance. This folder is located at webdata/<diveport>/customizations/images on disk (backslashes on window). For example, $(IMAGES_URI)/arrow.png produces a URL that fetches the filesystem path webdata/<diveport>/customizations/images/arrow.png. |
NETDIVER_URI | Embeds a NetDiver instance in a portlet. Optionally, you can include a path to the file that you want to open in the NetDiver instance. Syntax: $(NETDIVER_URI "/<path_to_marker>") For example: $(NETDIVER_URI "/program_markers/Programs/case_vol.mrk") opens NetDiver with the case_vol marker file. |
NUM_CROSSLINK_VALUES |
Returns the number of selected values in a CrossLink. Use this when using MultiSelect CrossLinks. Syntax: $(NUM_CROSSLINK_VALUES <dimension>). For example, $(NUM_CROSSLINK_VALUES “Product Family”) returns the number of selected Product Family values in the CrossLink click action. |
NUM_QUICKVIEW_VALUES |
Returns the number of selected values in a QuickView. The format is $(NUM_QUICKVIEW_VALUE <dimension>). The <dimension> parameter is required. The page must have a QuickView Portlet for this variable to work. Use NUM_QUICKVIEW_VALUES with picklist QuickViews. For example, $(NUM_QUICKVIEW_VALUES “Sales Region”) returns the number of values included in the Sales Region picklist. |
PAGE | Returns the Name of the current page, as defined in the page settings. |
PAGE_ID | Returns the ID of the current page, as defined in the page settings. |
PAGE_PATH | Provides the path seen in the Classic interface location bar (You are here:). When used on a page, printed output includes this breadcrumb information in the pdf, jpeg, or ppt file. |
PORTAL_MEDIA_URI | Used to create a URL to a resource located in the standard portal media document library on the current DivePort instance. You can use this option to define an image for a menu portlet, image portlet, or indicator portlet. For example, entering $(PORTAL_MEDIA_URI/images/company_logo.png), in the Large Icon box of a page setting fetches the company_logo.png image file to display in any menu portlet that is linked to the page. |
PRODIVER_URI | Embeds a ProDiver instance in a portlet. Optionally, you can include a path to the file that you want to open in the ProDiver instance. Syntax: $(PRODIVER_URI "/<path_to_marker>")For example: $(PRODIVER_URI "/program_markers/Programs/case_vol.mrk") opens ProDiver with the case_vol marker file. |
QUICKVIEW_VALUE |
Returns the selected value of the QuickView for the specified dimension. Syntax: $(QUICKVIEW_VALUE "<dimension>" <default value>). A dimension value is required and it must be contained in a QuickView portlet. For example, $(QUICKVIEW_VALUE "Sales Region" Northeast) returns the Northeast sales region selected in the QuickView. Alternatively, you can use the label of the QuickView to resolve to the string that is displayed in the QuickView. Syntax: $(QUICKVIEW_VALUE "<QuickView label>". For example: $(QUICKVIEW_VALUE "Current Month"). If a default value is specified and there is currently no QuickView value selected, the most recent selection for the specified QuickView is returned. If the QuickView is a picklist, a comma-separated list of all values in the picklist is returned. NOTE: If the dimension value contains a backslash (\), scripts might interpret part of the string as a control character (\t, \n). Be sure to include code to prevent this. |
SKIN | Returns the name of the currently selected skin file. |
USER | Returns the DiveLine username of the currently logged-in user. |
USER_EMAIL | Returns the email address of the currently logged-in user, as defined in DI-Config. |
USER_NAME | Returns the first and last names of the currently logged-in user, as defined in DI-Config. |
USER_SHORT_NAME | Returns the shortname of the currently logged-in user, as defined in DI-Config. |
Macro Name | Description |
---|---|
ADDL_VALUE_DATA | Applies to custom hover text and row-level click actions in box and horizontal box chart portlets. Displays the unformatted value of one of the box plot's additional values, for the selected row and the specified index. The format is $(ADDL_VALUE_DATA <additional value index>), where <additional value index> corresponds to the index of the value in the list of additional values, and the first additional value is 1. |
ADDL_VALUE_LABEL |
Applies to custom hover text and row-level click actions in box and horizontal box chart portlets. Displays the column label of of one of the box plot's additional values, for the specified value for the selected row and the specified index.. The format is $(ADDL_VALUE_LABEL <additional value index>), where <additional value index> corresponds to the index of the value in the list of additional values, and the first additional value is 1. |
ADDL_VALUE_STRING | Applies to custom hover text and row-level click actions in box and horizontal box chart portlets. Displays the formatted value of one of the box plot's additional values, for the selected row and the specified index. The format is $(ADDL_VALUE_STRING <additional value index>), where <additional value index> corresponds to the index of the additional value in the list of additional values, and the first additional value is 1. |
COLUMN_LABEL | Returns the column label of the named column. The format is $(COLUMN_LABEL <column_name>). COLUMN_LABEL is available in measures, chart, indicator, and map portlets. |
FIRST_VALUE_IN_ COLUMN |
Returns the first non-blank value in the specified column, regardless of which row the macro is being executed for. The format is $(FIRST_VALUE_IN_COLUMN <column_name>), where <column_name> is the name of the column in the underlying marker. For example, $(FIRST_VALUE_IN_COLUMN "Attending Physician"). This variable can be used in the Title and Value Format properties of a measures portlet, and for row-scoped click actions in the chart portlet. |
LAST_LOGON | After a user logs on, displays a date and time stamp describing the last time that the user successfully logged on. This message is appended to the message of the day and therefore requires that a message of the day is defined. This macro is intended to be used on portals that use the logon portlet instead of the logon dialog box. |
MESSAGE_ OF_THE_DAY |
After a user logs on, displays a specified message. This macro is intended to be used on portals that use the logon portlet instead of the logon dialog box. |
ROW_DATA |
Returns the unformatted value for the selected row in the specified column. The format is $(ROW_DATA <column_name>), where <column_name> is the name of the column in the underlying marker. For example, $(ROW_DATA "Plan Units"). The DivePort user selects the row. You can use ROW_DATA macros:
If the column is a number, and the value property uses $(ROW_DATA), and the format is Auto (or ""), the column renders as if the property was $(ROW_STRING) instead. Therefore, a None-formatted marker column backed by Spectre data renders in a Measures Portlet using the Spectre formatting by default. |
ROW_PERCENTAGE | Returns the percentage value of the specified column. The format is $(ROW_PERCENTAGE <column_name>)%, where <column_name> is the name of the column in the underlying marker or other data source. For example,($(ROW_PERCENTAGE "Cost")%) |
ROW_STRING |
Returns the formatted value for the selected row in the specified column. The format is $(ROW_STRING <column_name>), where <column_name> is the name of the column in the underlying marker. For example, $(ROW_STRING "Company Name"). The DivePort user selects the row. You can use ROW_STRING to define Title or Subtitle options of indicator and marker portlets, as well as with row-scoped click actions in chart and map portlets. ROW_STRING formats as in the column definition in the marker (or underlying cPlan). Therefore, numbers and dates are formatted. |
VALUE_DATA |
Applies to custom hover text and row-level click actions in chart portlets. Displays the unformatted value for the selected row for a column that appears in the chart as a value. The format is $(VALUE_DATA <value index>), where <value index> corresponds to the index of the value in the chart, where the first value is index 1. If the chart shows only one value, the index can be omitted. NOTE: This macro corresponds to ROW_DATA. |
VALUE_LABEL | Applies to custom hover text and row-level click actions in chart portlets. Displays the column label. The format is $(VALUE_LABEL <value index>), where <value index> corresponds to the index of the value in the chart, where the first value is index 1. If the chart shows only one value, the index can be omitted. |
VALUE_PERCENTAGE |
Applies to custom hover text and row-level click actions in chart portlets. Returns the percentage value of the specified index. The format is $(VALUE_PERCENTAGE <value index>)%, where <value index> corresponds to the index of the value in the chart, where the first value is index 1. If the chart shows only one value, the index can be omitted. |
VALUE_STRING | Applies to custom hover text and row-level click actions in chart portlets. Displays the formatted value for the selected row in the specified index as a tooltip. The format is $(VALUE_STRING <value index>), where <value index> corresponds to the index of the value in the chart, where the first value is index 1. If the chart shows only one value, the index can be omitted. |
WELCOME_MESSAGE | Displays a message on the logon dialog box before the user logs on. This macro is intended to be used on portals that use the logon portlet instead of the logon dialog box. |
Macro Name | Description |
---|---|
DEFAULT_FACTORY | Returns the name of the Default Factory Project as specified in the environment settings, for the current environment. This is also the factory that is used for Self Service pages. |
DIMENSION_<#> |
Applies to stamp templates, where <#> is the number of a dimension. Returns the name of the dimension that the user selected for a stamp. For example, $(DIMENSION_1) returns the name of the first dimension, $(DIMENSION_2) returns the name of the second dimension, and so on. |
FACTORY_COMPLETE_MONTH | Returns the last date of the previous month of the specified factory, using the specified date format. The format is $(FACTORY_COMPLETE_MONTH "<factory project>" "<date format>"). For example, $(FACTORY_COMPLETE_MONTH "mf_hc_demo" "YYYY-MM"). |
FACTORY_COMPLETE_MONTH_ YEAR_START_DATE |
Returns the first date of the year containing the most recent complete month of the specified factory, using the specified date format. This takes the Calendar QuickView into account. For example if the Calendar QuickView is set to Fiscal this macro returns the first date of the fiscal year. The format is $(FACTORY_COMPLETE_MONTH_YEAR_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_COMPLETE_MONTH_YEAR_START_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_CURRENT_DATE |
Returns the current date of the specified factory, using the specified date format. The format is $(FACTORY_CURRENT_DATE "<factory project>" "<date format>"). For example, $(FACTORY_CURRENT_DATE "mf_hc_demo" "YYYY-MM"). TIP: The last complete day is always FACTORY_CURRENT_DATE minus one. |
FACTORY_CURRENT_TIME_RANGE_ END_DATE |
Returns the last date in the specified current time range of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_CURRENT_TIME_RANGE_END_DATE "<factory project>" "<date format>"). For example, $(FACTORY_CURRENT_TIME_RANGE_END_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_CURRENT_TIME_RANGE_ START_DATE |
Returns the first date in the specified current time range of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_CURRENT_TIME_RANGE_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_CURRENT_TIME_RANGE_START_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_TIME_RANGE_ END_DATE |
Returns the last date in the specified previous time range of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_PREVIOUS_TIME_RANGE_END_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_TIME_RANGE_END_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_TIME_RANGE_ START_DATE |
Returns the first date in the specified previous time range of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_PREVIOUS_TIME_RANGE_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_TIME_RANGE_START_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_YEAR_TIME_ RANGE_END_DATE |
Returns the last date in the specified time range offset by one year of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_PREVIOUS_YEAR_TIME_RANGE_END_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_YEAR_TIME_RANGE_END_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_YEAR_TIME_ RANGE_START_DATE |
Returns the first date in the specified time range offset by one year of the specified factory in the specified date format. This takes the Calendar QuickView into account. The format is $(FACTORY_PREVIOUS_YEAR_TIME_RANGE_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_YEAR_TIME_RANGE_START_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_YEAR_ COMPLETE_MONTH_ YEAR_START_DATE |
Returns the first date containing the most recent complete month of the previous year of the specified factory in the specified date format. This takes the Calendar QuickView into account. For example if the Calendar QuickView is set to Fiscal this macro returns the first date of the fiscal year. The format is $(FACTORY_PREVIOUS_YEAR_COMPLETE_MONTH_YEAR_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_YEAR_COMPLETE_MONTH_YEAR_START_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_PREVIOUS_YEAR_ CURRENT_DATE |
Returns the current date of the previous year of the specified factory, using the specified date format. This takes the Calendar QuickView into account. For example if the Calendar QuickView is set to Fiscal this macro returns the first date of the fiscal year. The format is $(FACTORY_PREVIOUS_YEAR_CURRENT_DATE "<factory project>" "<date format>"). For example, $(FACTORY_PREVIOUS_YEAR_CURRENT_DATE "mf_hc_demo" "YYYY-MM"). |
FACTORY_YEAR_START_DATE | Returns the first date of the year of the specified factory in the specified date format. This takes the Calendar QuickView into account. For example if the Calendar QuickView is set to Fiscal this macro returns the first date of the fiscal year. The format is $(FACTORY_YEAR_START_DATE "<factory project>" "<date format>"). For example, $(FACTORY_YEAR_START_DATE "mf_hc_demo" "YYYY-MM"). |
MEASURE_<#> | Applies to stamp portlets and stamp templates, where <#> is the number of a measure. Returns the name or label of the measure that the user selected for a stamp. For example, $(MEASURE_1) returns the name or label of the first measure, $(MEASURE_2) returns the name or label of the second measure, and so on. |
MEASURE_<#>_ LABEL |
Applies to stamp portlets and stamp templates, where <#> is the number of a measure. Returns the label of the measure that the user selected for a stamp. For example, $(MEASURE_1_LABEL) returns the label of the first measure, $(MEASURE_2_LABEL) returns the label of the second measure, and so on. If no label is specified for the measure, this macro returns the name of the measure instead. |
MEASURE_CALCULATION |
Returns the measure calculation for the last selected measure. For example, the measure calculation for Total admissions is `count()`. The format is $(MEASURE_CALCULATION). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_CALCULATION "None"). |
MEASURE_CATEGORY | Returns the category assigned to the last selected measure. For example, Total admissions is in the Inpatient Volumes category. The format is $(MEASURE_CATEGORY). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_CATEGORY "None"). |
MEASURE_DATA_SET | Returns the data set associated with the last selected measure. For example, Total admissions is in the Admissions data set. The format is $(MEASURE_DATA_SET). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_DATA_SET "None"). |
MEASURE_DEFINITION | Returns a description of the last selected measure. The format is $(MEASURE_DEFINITION). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_DEFINITION "None"). |
MEASURE_DESCRIPTION | Returns a description of the business rules that define how the last selected measure is calculated. The format is $(MEASURE_DESCRIPTION). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_DESCRIPTION "None"). |
MEASURE_FILTER |
Returns filter information for the filter that is set in the factory config file for the measure. Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_FILTER "None"). |
MEASURE_FORMAT | Returns the numeric format of the last selected measure. The format is $(MEASURE_FORMAT). For more information, see Formatting Numeric Values. Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_FORMAT "None"). |
MEASURE_GOOD_DIRECTION | Returns the good direction for the last selected measure. If the measure does not have a good direction designated, the macro returns the default value of up. The format is $(MEASURE_GOOD_DIRECTION). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_GOOD_DIRECTION "None"). |
MEASURE_LABEL | Returns the label for the last selected measure as specified in the factory configuration file. If the measure definition does not include a label and no default value is provided, this macro will display the measure name. The format is $(MEASURE_LABEL). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_LABEL "None"). |
MEASURE_NAME | Returns the name of the last selected measure. The format is $(MEASURE_NAME). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_NAME "None"). |
MEASURE_REFERENCE | Returns the reference document associated with the last selected measure. For example, UB-04 Specifications Manual. The format is $(MEASURE_REFERENCE). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_REFERENCE "None"). |
MEASURE_ SCOPE | Returns the measure scope for the last selected measure. For example, $(MEASURE_SCOPE "total admissions") returns Admissions. Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_SCOPE "None"). |
MEASURE_VALUE_TYPE | Returns the data type of the last selected measure. For example, string. The format is $(MEASURE_VALUE_TYPE). Optionally, you can specify a default value string to display when there have been no measures displayed in the portal yet. For example, $(MEASURE_VALUE_TYPE "None"). |
MF_COLUMN_LABEL |
Returns the column label of a specified measure. The format is $(MF_COLUMN_LABEL <measure_name>). Optionally, you can specify basic time series variation or date rollup variation information.
NOTE: This macro corresponds to COLUMN_LABEL. |
MF_FIRST_VALUE_IN_COLUMN | Returns the first non-blank value in
the specified measure column, regardless of which row the macro is being executed for, and optionally taking into account a specified time series or date rollup variation. . The format is $(MF_FIRST_VALUE_IN_COLUMN <measure_name>). Optionally, you can specify basic time series variation or date rollup variation information.
NOTE: This macro corresponds to FIRST_VALUE_IN_COLUMN. |
MF_ROW_DATA |
Returns the unformatted value for the specified measure, optionally taking into account a specified time series or date rollup variation.
NOTE: This macro corresponds to ROW_DATA. |
MF_ROW_PERCENTAGE |
Returns the percentage value for the specified measure, optionally taking into account a specified time series or date rollup variation.
NOTE: This macro corresponds to ROW_PERCENTAGE. |
MF_ROW_STRING |
Returns the formatted value for the selected measure, optionally taking into account a specified time series or date rollup variation. You can use MF_ROW_STRING to define Title or Subtitle options of indicator and marker portlets, as well as with row-scoped click actions in chart and map portlets. MF_ROW_STRING formats as in the column definition in the marker (or underlying cPlan). Therefore, numbers and dates are formatted. The DivePort user selects the row.
NOTE: This macro corresponds to ROW_STRING. |
STAMP_FACTORY |
Applies to stamp templates only. Returns the name of the project specified (by the DivePort developer) to be the data source for the stamp. In the case of Self Service stamps, this is the default factory project set for the environment. The format is $(STAMP_FACTORY). There are no arguments. |
STAMP_ FILENAME |
Applies to stamp templates only. Returns the name of the file used as the template for the stamp (*.json or *.stamp, including any containing folders within the stamps directory). The format is $(STAMP_FILENAME). There are no arguments. |