You can create a file with JavaScript functions and add
them to QMF for Workstation and QMF for WebSphere®.
Use the functions for building different expressions, for example,
when you add a calculated column or create a dynamart filter.
About this task
To create and add a custom function:
Procedure
- Create a file called functions.js with the description
of JavaScript functions and their implementation.
- Start each function with the keyword
'function'
. For details about syntax, see Syntax for custom
functions.
- Add a comment before each function.
The
application interprets this comment as the description of the function.
- Optional: Define a category to which
you add a new function.
Use the '@category'
tag
in the comments to add it. If there is no such category, it will be
created.
Note: The following categories already exist in the application:
- Columns
- Aggregation
- Conversion
- Date and Time
- Information
- Logical
- Math and Trigonometric
- Misc
- Text
- Objects
- Place the
functions.js
file in the QMF for Workstation or QMF for WebSphere user
home directory. If you want to share functions.js
with
other users, they will have to copy the functions.js file to
their home directories.
- Launch or restart your application.
Results
The function is added to the defined category and can be
used for building expressions for calculated columns, dynamart filters,
and scheduler.
This allows you to implement
various features in other QMF objects
such as visual dashboards. For example, you can display data retrieved
from a table on a map according to address information from that table.
For more information, see Displaying data on a map according to address information retrieved from a query.