Query Formula Definition |
A formula is a PxPlus expression (numeric or string) consisting of any combination of variables, constants and functions, whose resulting value is displayed in a query column. Formulas that have been assigned a name can be used within other formulas, noting that the order of evaluation of formulas corresponds to the order in which they are defined in the query definition.
To invoke the Query Formula Definition window, click the Add Formula button on the Query Definition toolbar.
This window consists of the following:
(Optional) Enter a formula name to easily identify the formula throughout the Query Subsystem: • For new formulas, the formula name will be pre-loaded with FML_QueryName_N (where QueryName is the name of the query and N is a numeric identifier), which can be changed or deleted. • For existing formulas, the formula name will be blank until it is filled in. All formula names will be prefixed with FML_ and must adhere to the rules for naming variables. The first character must be alphabetic (A-Z or a-z), the remaining characters can be alphabetic, numeric (0-9), . (period), or _ (underscore). Naming a formula allows you to: • Use the evaluated result of the formula in another formula. Note:
| |||||||||||
Column Title |
Column heading that users will see at the top of the formula column at run time; e.g. Customer Name. Can be a Fixed value, string Expression, or Message Library Reference. | ||||||||||
Formula |
PxPlus expression (numeric or string) consisting of any combination of variables, constants and functions. In formulas, you can refer to an external key as PRIME_KEY$. Example: CVS(CST_NAME$,256) See Query Variables. | ||||||||||
Width |
Column width in columns. This can be adjusted as necessary, depending on the selected font. Column widths can also be adjusted in Query+ Toolbar, Hybrid, Menu and Drop Query views (see Query View option) by clicking the Test/Design toolbar button to display the query and dragging the column header to the desired size. Click the Save + Exit button to save and incorporate these settings into the query definition when exiting the query. (The ability to save query changes when in Test/Design mode was added in PxPlus 2023 Update 1.) | ||||||||||
Alignment |
(Query+ and Drop Query) Alignment of the value within the column. Settings include Default, Left, Center and Right justification. The Default setting for text values is Left justification and Right justification for numeric values. Note:
| ||||||||||
Format |
Can be either Mask or Program:
Note: | ||||||||||
Click the Define button to launch the Query Column Display window where you can assign visual attributes, such as bold text, text color, highlight color, or an image, to the column. See Query Column Display below. | |||||||||||
Sort Options |
(String Only, Query+, Drop Query and Classic Query with Sort by Column Option) The following sort options can be assigned to a column: Sort As Is, Use Sort Algorithm, Date Sort:
| ||||||||||
'Tip' Values |
(Numeric Only, Query+, Drop Query and Classic Query with Sort by Column Option) (Optional) Tip values to be displayed when the mouse is placed over the column heading. Values include Total, Average, Minimum and Maximum. | ||||||||||
Hotlink Logic |
(Query+ and Drop Query) Logic to execute when the column is double-clicked. Click the drop-down arrow for a list of event actions: Ignore, Link, Call and Execute. See Actions and Parameters. The specified logic overrides selecting the query record. Columns with a hotlink are displayed in the color defined by the 'OPTION'("StdLvueHotlinkClr",color$) setting and are underlined while hovering over the column. See OPTION mnemonic.
(The Hotlink Logic option was added in PxPlus 2018.) | ||||||||||
Initially Hide Column |
Selecting this check box initially hides the formula column at run time until the user selects it to be shown. When using Query+ Toolbar, Hybrid, Menu or Drop Query views, columns can be set to be initially hidden or shown by clicking the Test/Design toolbar button to display the query and selecting the Show/Hide/Reorder Columns item from the Columns run-time option to set the column visibility. Click the Save + Exit button to save and incorporate these settings into the query definition when exiting the query. (The ability to save query changes when in Test/Design mode was added in PxPlus 2023 Update 1.) | ||||||||||
Launches the Object Security Definition window for setting up column level security for the query. See Query Security. (The Security button was added in PxPlus 2021.) |