Add a Prism Calculated Field to a Dataset
- Any of these security requirements:
- Prism Datasets: Managedomain in the Prism Analytics functional area.
- Dataset Editorpermission on the dataset
- Dataset Ownerpermission on the dataset.
You can transform data in a dataset by adding Prism calculated fields to the dataset. Prism calculated fields change the number of fields in a dataset, they don't change the number of records.
A Prism calculated field contains these components:
Component | Description |
|---|---|
Name | The name you specify is the field display name. |
Expression | The expression describes a processing step that you want to perform on the data in other fields in the dataset. Expressions can include:
For more information, see Concept: Prism Expression Language. |
Field type | The expression determines the return value field type.
If the expression includes a function, then the return value of the function determines the field type. If the expression doesn't include any function, then the operator determines the field type:
|
You might need to create several Prism calculated fields to achieve the result you want. You can use the result of a Prism calculated field in the expressions of other Prism calculated fields to define a chain of processing steps.
You might want to use a Prism calculated field to:
Field Purpose | Example |
|---|---|
Convert a field type to another field type. | Change an Integer field type to a Long field type, so that you can use the EPOCH_MS_TO_DATE function on it. Example:
|
Perform an arithmetic calculation. | Calculate the net profit based on the revenue and expenses. Example:
Calculate the percent of total revenue for a particular sale. Example:
|
Extract values from a different field. | Extract the currency codes from a currency field using the EXTRACT_CODE function. Example:
|
Combine the values from 2 Text fields into 1 Text field. | Combine separate fields consisting of Last Name and First Name into 1 field using the CONCAT function. Example:
|
Test for a particular condition. | Test whether the year is between 2019 and 2020, inclusive. Example:
|
Pad the beginning of a Text field with leading zeros. | The [EEID] is a Text field containing numeric data of varying lengths, and you want to create an [Employee ID] field that is always 7 characters long, including leading zeros where needed.
Create a calculated field called [PaddedID] that adds enough zeros to the beginning of [EEID] to create a full string, even if [EEID] is an empty string. Example:
Then create a calculated field called [Employee ID] that returns the last 7 characters of the [PaddedID] field. Example:
|
Return a particular date given a Date field. | The [EFF_Date] field is a Date field, and you want to calculate and return the last day of the current month.
|
To delete a Prism calculated field, access the
Edit Dataset Transformations
task, and select the menu for the Prism calculated field you want to remove and select Delete Field
. Deleting a field might cause errors if other Prism calculated fields refer to the deleted field.- Access theEdit Dataset Transformationstask for a dataset.
- Select a dataset pipeline (required for derived datasets) and stage into which to add the Prism calculated field.
- SelectAdd Field.
- Enter an expression in the expression editor.If you use Currency fields that contain different codes, Workday treats the result of those calculations as NULL.
- In the inspector panel, enter a name. Field names must follow naming validation rules.
- Save the Prism calculated field by clickingEnterorReturnon your keyboard.Clicking another field on the page also saves the changes to the Prism calculated field.
- (Optional) You can insert single and multiline comments into any location within a Prism expression. Workday treats all text between these characters as comments: /* */Workday won't consider the data values as comments if you enclose these characters and the comment within double quotation marks.