Similar to the “find and replace” command in word processing, to search for particular values in the retrieved data element and replace with a specified value or a default, use the decode conditional function in the Query or Results section.
- In Query section, double click the intended item on the Request Line (or select item and select Modify) (In Results section, select Results menu, select Add Computed Item and name the new data item in the dialog box).
- Press the Functions… button on right in dialog box.
- Select Conditional from the Function List Categories window in the Database Functions dialog box.
- Select Decode from the Functions available in the window to the right.
- Complete the table by adhering to the “expression, search, result, default” format. Reference the data element you wish to decode as your expression followed by a comma, type the value you wish to search for followed by a comma, type the result (replacement) for such a value followed by a comma and a default value or data element to be returned in records that do not contain the value that was specified in the “search” criteria. Many search and result values can be nested within the Decode statement.
- Click OK in the Database Functions dialog box.
- Click OK in the Item dialog box.
- To review/modify the computed item double click on the item name on the Request Line.
Last updated: October 15, 2013