Decode

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.

  1. 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).
  2. Press the Functions… button on right in dialog box.
  3. Select Conditional from the Function List Categories window in the Database Functions dialog box.
  4. Select Decode from the Functions available in the window to the right.
  5. 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.
  6. Click OK in the Database Functions dialog box.
  7. Click OK in the Item dialog box.
  8. To review/modify the computed item double click on the item name on the Request Line.

Last updated: October 15, 2013

Last updated: October 15, 2013