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. |
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 most recently 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 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 |
---|---|
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. |
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 |
---|---|
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 most recent complete 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") returns the last day of the current complete month. |
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_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_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"). |
MEASURE_VIEW |
Returns the measure view for the last selected measure. The format is $(MEASURE_VIEW "<measure>"). For example, $(MEASURE_VIEW "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_VIEW "None"). |
See also: