Sorts

Sorts

Like many applications (Excel, for example), Mercury allows users to sort data. But sometimes you might want to sort not by the actual data-value, but some other way.

Example: Suppose the field Size contains text values (S, M, L, XL) that correspond to small, medium, large, and extra large. Sorting data by Size would result in an order of (L, M, S, XL) – probably not what you want.

A Sort in Mercury allows you to define a custom sort-order to handle situations like the above example. When you create (or edit) a report, you can associate a report field with your custom Sort. You can associate fields from different reports with the same Sort.

To open the Manage Sorts window:

  • Select the Tools > Tools ribbon at the upper right of the main Mercury window, and then click Sorts.


  • A window similar to the following is displayed:


To create a new sort method:

  • Select New from the Manage Sorts toolbar.


  • A new row will appear in the grid, with a red asterisk in the Name column. Enter values as described below.

                                                                                   Refer to the list below to know more about the columns in the grid.

    1. Name - A name that you make up for the sort method. When you create or edit a report, you can optionally associate a Sort with a report-field by choosing the sort-name from a list.
    2. Description - A brief description of the sort .
    3. Expression - The expression to be sorted. Use [Value] without quotes to refer to the report-field's value.

      Clicking in the Expression cell reveals a little […] button that will open an expression-editor to help you build a formula. If you're simply sorting on the field's value without any modification, all you need here is [Value].
When the Sort is actually used by a report at run-time, [Value] will be the value of the report-field associated with the Sort.
  1. Operator - Specifies how the Expression result will be compared to the list of possibilities in the detail area. Note that you can use inequalities (less than, greater-than-or-equal-to, etc) for comparison.
  • Define the list of possibilities (that is, the possible Expression results) in the detail area. The order of the Refer. Value ("reference value") items defines the ascending sort order. Depending on your Operator, you may not need a detail item for every distinct Expression result.                                                                                                                                               

    Control Description
    Creates a new reference value for sorting
    Deletes selected reference value
    Moves the selected item up
    Moves the selected item down
  • Click Save to create the sort method.


To edit an existing sort method:

  • Select Edit from the toolbar.

    Note: All the Sorts and their details will be editable, not just the selected one. You can also continue to add New ones.


  • Make changes as desired.

  • Click Save to save the edits. To discard all your changes, click Reset.

To clone an existing sort method

  • Select the Sort that you would like to clone and click Clone on the toolbar.                                                                                     

  • Your clone will appear at the end of the grid. The clone is identical to the original Sort except for the Name, which is blank.   

  • Provide a Name for the sort method.
  • Change anything else pertaining to the Sort and/or its details, as desired.

    Note: All of the Sorts and their details can be edited, not just the new clone.

  • Click Save to save the new Sort (and any other changes you have made). To discard all your changes (including the clone), click Reset.

To delete an existing sort:

  • Select the Sort that you want to remove.                                                                                                                                              

  • Click Delete on the toolbar. You will be prompted for confirmation. Click Yes to delete the Sort.

    Note: This operation cannot be undone. If you want your deleted Sort back, you must create it again as described above.

To discard changes in progress

To discard all unsaved changes (as part of New, Edit, and Clone), click Reset on the toolbar.


At the confirmation prompt, choose Yes to confirm; No to continue making changes. 

Using a Sort

To use a custom Sort in a report, you assign the sort to a specific field in a report. You can use the same Sort in multiple reports, and even multiple times in the same report. It's up to you to ensure that the Sort makes sense for the reports / fields to which it's assigned.

For details on how to assign a Sort to a report-field, see the documentation for Creating / Editing reports, and refer to the section on Fields.


    • Related Articles

    • Report List

      The Report List contains all the reports available to you. You can change its appearance in several ways. You can change how the list is presented To change the list appearance, use the small icons above the search box. Icon Description The pin ...
    • Right-Click Menus

      Right-click on a column header Sort Ascending - Sorts the column data in ascending order. See Searching and Sorting. Sort Descending - Sorts the column data in descending order. See Searching and Sorting. Clear Sorting - Removes sorting from ...
    • Calculated Fields

      Calculated fields (also called "unbound columns" or "unbound fields") are report fields that you create. A calculated field is not part of the report’s original data source but is derived from the data based on an expression (a formula) that you ...
    • Calculated Fields

      Calculated fields (also called "unbound columns" or "unbound fields") are the report fields that you create. A calculated field is not part of the report’s original data source, but can be derived from the data based on an expression (a formula) that ...
    • Right-Click Menus

      Right-click a filter-area icon Hide this Field - Removes the field. (To get it back, see the Field List below.) Order - Moves the field to a different location in the same area: Move to Beginning - Moves the field to the beginning of the list. Move ...