Skip to main content
Administrator Guide
Last Updated: 2023-06-23
Example: Sort Fields by the Related Business Object

Example: Sort Fields by the Related Business Object

This example illustrates how to sort fields in your report by the related business object.
You want to change how your report that uses the Worker business object sorts data. Instead of sorting by the first column on the report, you want to sort by location. You create 2 calculated fields that use the Worker business object so that you can sort your data by the related business object, Location.
Security: These domains in the System functional area:
  • Custom Field Management
  • Custom Report Creation
  • Manage: All Custom Reports
  1. Access the
    Copy Standard Report to Custom Report
    task.
    Copy a Workday-delivered standard report that includes location data.
    1. Select
      Active Employees - Indexed
      from the
      Standard Report Name
      prompt.
    2. Click
      OK
      .
    3. Enter
      By Location - Active Employees - Indexed
      on the
      Name
      field.
    4. Click
      OK
      twice.
  2. Access the
    Create Calculated Field
    task.
    Create an extract single instance calculated field for the location data.
    1. Enter
      ESI Location
      on the
      Field Name
      field.
    2. Select
      Worker
      on the
      Business Object
      prompt.
    3. Select
      Extract Single Instance
      on the
      Function
      prompt.
    4. Click
      OK
      .
    5. Select these values on the
      Calculation
      tab:
      Prompt
      Value
      Source Field
      Locations
      Condition
      Is True
      Sort Field
      Location Name
      Sort Direction
      Ascending (A to Z)
      Instance to be Returned
      Last occurrence
    6. Click
      OK
      .
  3. Click
    Create Another Calculation
    .
    Create a lookup related value calculated field for the location data.
    1. Enter
      LRV Location
      on the
      Field Name
      field.
    2. Select
      Worker
      on the
      Business Object
      prompt.
    3. Select
      Lookup Related Value
      on the
      Function
      prompt.
    4. Click
      OK
      .
    5. Select these values on the
      Calculation
      tab:
      Prompt
      Value
      Lookup Field
      ESI Location
      Return Value
      Location
    6. Click
      OK
      .
    7. Click
      Done
      .
  4. Access the
    Edit Custom Report
    task.
    Add the
    LRV Location
    calculated field to your advanced report.
    1. Select
      By Location - Active Employees - Indexed
      from the
      Report Name
      prompt.
    2. Click
      OK
      .
    3. Access the
      Sort
      tab.
    4. In the
      Sort and Group
      section, clear the
      Sort by first accessible column
      check box.
    5. Add a row to the grid.
    6. In the grid, select
      LRV Location
      from the
      Field
      prompt.
    7. Click
      OK
      .
    8. Click
      Run
      .
The lookup related value calculated field sorts your data by the Location Name instead of the Employee ID.
You can create additional calculated fields that enable you to sort your data by fields on the related business object instead of the primary business object.