Topics: |
Using an expression, you can create virtual columns and store calculations and selection criteria in a synonym. For example, using the Revenue measure, you can create a calculation for Revenue per Square Foot. This is saved in the synonym as an object and is available for use in all subsequent reports derived from the synonym.
How to: |
You may create a DEFINE field as a custom field in a synonym. A custom field can be used in a request as though it is a real data source field. Virtual columns (DEFINE fields) are available when the data source is used for reporting.
A virtual column can contain an expression, a constant, or a column name.
The Metadata canvas opens.
The Define Calculator opens, as shown in the following image.
Tip: From the Metadata canvas, click the browse (...) button at the right of the TITLE and DESCRIPTION value fields to specify multiple language titles.
or
Use the Relational Expression tab to build the expression.
Note: Parameters are not supported.
The Value Selection dialog box opens.
The expression is added to the value field.
Note: To edit the Define, Title, or Expression, you may do so directly from the Metadata canvas, or you may click the browse (...) button at the right of the EXPRESSION value field to relaunch the Define Calculator.
Tip: You can click and drag the DEFINE field and move it to a different segment in the Tree View tab, which also changes the segment association.
How to: |
You may create a Computed field as a custom field in the Metadata canvas. The procedure for adding a custom field is similar to the procedure used to add a Defined field. The Computed field is identified as the Master File Computed field and is differentiated from the Defined fields and the other Computed fields.
To create a computed column in a synonym
The Metadata canvas opens.
The Compute Calculator opens.
Tip: From the Metadata canvas, click the browse (...) button at the right of the TITLE and DESCRIPTION value fields to specify multiple language titles.
or
Use the Relational Expression tab to build the expression.
Note: Parameters are not supported.
The expression is added to the value field.
The filter is added to the Relational Expression tab, where you can add the expression value.
Note: To edit the Compute, Title, or Expression, you may do so directly from the Properties section of the Metadata canvas or you may click the browse (...) button at the right of the EXPRESSION value field to relaunch the Compute Calculator.
For more information about expressions and COMPUTE attributes, see Defining Attributes and Creating Expressions for Custom Fields.
How to: |
Filters are created in the Master File through the Metadata canvas and can be used in a Business View file or in reporting tools. You can also use filters to perform other data checking and validation, and sort data based on the conditions that you create.
Filters are created under a specific segment and, by default, they have association with the selected segment. Filters can also be created without segment association.
The Metadata canvas opens.
The Filter Calculator opens, as shown in the following image.
Note: It is recommended that filters have a descriptive name to help identify the filter action during reporting.
Note: The Format field cannot be changed. Values for filters return 0 for false and 1 for true.
Tip: From the Properties panel in the Metadata canvas, click the browse (...) button at the right of the TITLE and DESCRIPTION value fields to specify multiple language titles.
or
Use the Relational Expression tab to build the expression.
Note: Parameters are not supported with Master File Filters.
The Value Selection dialog box opens.
The expression is added to the value field.
The filter is added to the Relational Expression tab where you can add the expression value.
The expression is removed from the Relational Expression tab.
Note: To edit the Filter, Title, or Expression, you may do so directly from the Properties panel in the Metadata canvas or you may click the browse (...) button at the right of the EXPRESSION value field to relaunch the Filter Calculator.
Filters are created under a specific segment and by default they have association with the selected segment. Filters can also be created without segment association.
Note: If you are using a field that appears in multiple segments, the WITH segment associated should be the lowest level segment or it should be left empty to prevent errors.
In addition, if no fields from the synonym are used in the expression or have not been computed, you can use the WITH option to identify the logical home of the filter calculation. You can also use the WITH option to move the logical home for the filter field to a lower segment than it would otherwise be assigned (for example, to count instances in a lower segment).
The filter is saved as part of the synonym.
Reference: |
A custom field is a field whose value is not stored in the data source but can be calculated from the data that is there. You can create a custom field in your synonym by adding a virtual column (DEFINE), a Computed Field (COMPUTE), and a Master File filter (FILTER). The fields are available whenever you access the corresponding data source in a reporting tool.
You can define attribute values and create expressions for custom fields using the Metadata canvas.
The following attributes may be available for custom fields (DEFINE, COMPUTE, and FILTER) in the Metadata canvas.
Note: The attributes available depend on the type of synonym and the type of custom field selected.
Custom fields (DEFINE, COMPUTE, and FILTER) typically have the following attributes:
General
Is the name of the virtual column.
Note: This attribute only appears when a virtual column (DEFINE) is selected.
Is the name of the computed field.
Note: This attribute only appears when a virtual computed field is selected.
Is the name of the Master File Filter field.
Note: This attribute only appears when a virtual filter field is selected.
Is the expression that creates the virtual column.
Supplies a title to replace the column name that is normally used in reports and enables you to specify multiple language titles for the virtual column.
Describes the data type and format for the virtual column.
Note: This attribute only appears for DEFINE and COMPUTE custom fields.
Allows missing data. If not, the transaction value is supplied.
Note: This attribute only appears for DEFINE and COMPUTE custom fields.
Miscellaneous
A DEFINE expression may not contain qualified field names. REDEFINES enables you to redefine or recompute a column whose name exists in more than one segment.
Note: This attribute only appears for DEFINE custom fields and cannot be used by WebFOCUS.
If no columns from the synonym are used in the expression or have been defined, you can use the WITH option to identify the logical home of the defined calculation. You can also use the WITH option to move the logical home for the virtual column to a lower segment than it would otherwise be assigned (for example, to count instances in a lower segment).
Note: This attribute only appears for DEFINE and FILTER custom fields.
Contains a description or comments about the virtual column.
Specifies access options for the column data.
INTERNAL defines a column that does not appear in sample data or in the list of available columns. Restricts the field from showing in any of the Field Lists.
NEED_VALUE defines a column that requires a value to access the data. Indicates that a selection is needed in the report request (WHERE condition).
Select By defines a column by value, range, or multivalues:
Defines the geographic role of the column.
Contains the name of a field to be included in a dimension.
These WITHIN statements are added to the synonym through the Dimension Builder to OLAP-enable WebFOCUS files and relational tables.
Note: This attribute only appears for DEFINE and FILTER custom fields.
Inserts virtual fields in the Master File to show how selected totals progressed through a time period for specified intervals.
Are the styles (for example, font and color) to apply to the field.
Note: The attributes available depend on the type of synonym.
The Define Calculator, Compute Calculator, and Filter Calculator have the following fields and options:
Is the name of the object being created (virtual field (DEFINE), filter, computed field).
Is the field format.
Is the title of a new target table created by a data flow. The title will be included in the synonym that is created.
Indicates if missing (null) values are allowed in this field. The following options are available:
Location for typing an expression. You can add data source fields from the Columns/Variables tab, functions from the Functions tab, and numbers and operators from the calculator as you type.
Displays the expression building window from which you can add and delete columns, choose the relation and type, and select values for your filter.
Displays a hierarchical list of available source columns and System Variable folders that you can use in creating an expression.
A function is a program that returns a value. This tab lists the built-in functions that you can use to derive the value of a temporary field.
Enables you to specify parameters for the function through a dialog box when creating or editing a transformation.
Enables you to insert numbers and operators.
The following operators are available:
Concatenates two values, retaining any trailing blanks after the first one. For example, if FIRST_NAME and LAST_NAME were both in A15 format, the expression
FULL_NAME = FIRST_NAME | LAST_NAME
would produce a column like the following:
MICHAEL SMITHSONJ ANE JONES . . .
Concatenates two values, suppressing any trailing blanks in the first. For example, to construct the full name and insert a comma (,), the syntax
FULL_NAME = LAST_NAME || (', ' | FIRST_NAME)
would produce a column like the following:
SMITHSON, MICHAEL JONES, JANE . . .
The concatenation in the parentheses is done first (preserving the blank space after the comma), and the result is then concatenated to LAST_NAME, suppressing the trailing blanks of LAST_NAME.
Establishes a conditional test.
Specifies the action to perform if the result of a conditional test is TRUE.
Specifies the action to perform if the result of a conditional test is FALSE.
Returns the value TRUE if the value on the left is less than the value on the right.
Returns the value TRUE if the operand is false.
Returns the value TRUE if the value on the left is less than or equal to the value on the right.
Returns the value TRUE if the value on the left is equal to the value on the right.
Returns the value TRUE if both operands are true.
Returns the value TRUE if the value on the left is greater than the value on the right.
Returns the value TRUE if the value on the left is greater than or equal to the value on the right.
Returns the value TRUE if the value on the left is not equal to the value on the right.
Returns the value TRUE if either operand is true.
Raises a value to the specified power.
Adds parentheses.
Inserts two single quotation marks. Enter alphanumeric test values between the quotation marks.
Converts selected text to uppercase.
Converts selected text to lowercase.
Opens the Date dialog box, where you can change the format for the Date field.
Opens the Date Time dialog box, where you can change the format for the Datetime field.
Verifies the validity of the expression.
Produces sample data for the expression.
WebFOCUS | |
Feedback |