Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Sorting is the process of ordering your data rows by a certain sequence. For each available data category, you can choose which data field should be used to sort the rows. Fields can be sorted in ascending or descending direction. The way in which rows are sorted depends on the type of value in the field:

Numeric

Asc custom.arrow_fore.png Lower values     Higher values custom.arrow_back.png Desc

Date

Asc custom.arrow_fore.png Past     Future custom.arrow_back.png Desc

Text

Asc custom.arrow_fore.png A     Z custom.arrow_back.png Desc

custom.DepartmentsUnsorted.png custom.DepartmentsSorted.png

Sorting a category by Department

A report can have multiple sorts. This can be useful when you want your highest precedence sort to affect a data field where the values for multiple rows may be the same.

For example, imagine a large company with many employees. There could be multiple people with the last name Buchanan. With only a sort on LastName, you do not know how all the people with the last name Buchanan will be ordered amongst themselves. If this matters, then you can add a second sort on, say, the FirstName field, so that people with the same last names will be ordered by their first names.


Adding Sorts

In the Sorts window, add data fields to sort. The precedence of the sorts starts with the highest row and moves down the list. Drag the rows up or down to change the precedence.

screen.reportwizard_drag_sort_field.png

Dragging a field to the Sort By pane


Relationship Between Sorts and Groups

Sorts are a prerequisite for making groups. Sorting puts data in order so that data rows which share common values for the sort field are next to each other. This is essentially what grouping does as well. Grouping simply takes those common values, pulls them out of the rows, and makes sections for each group of rows which share that value. Sorts tell the report how you want to your data to be grouped.

custom.DepartmentsSorted.png custom.DepartmentsGrouped.png

Grouping a category by the Department sort

Tip: Set the sort precedence so that nested groups are in order of their grouping level. The outermost group should have the highest precedence, with the next levels following in order. If the precedence is set incorrectly, it could result in inconsistent data groups.


Sort Formulas

Note: This information is intended for advanced users.

You can sort by a formula instead of a data field. This allows you to have finer and more specific control over your groups.

If you do not have a single data field as a unique key, you can use a sort formula to sort on a concatenation of two fields instead. For example, EmployeeId plus TerritoryId fields:

={EmployeeTerritories.EmployeeId} & {EmployeeTerritories.TerritoryId}

Or if your sort field would generate too many groups, you can sort on a piece of the field instead. For example, you could group on only the month and year component of a date field.

=Date(Year({Employees.HireDate}),Month({Employees.HireDate}),1)

To add a sort formula, click Add2.png Add Formula, then use the Formula Editor to make a composite field to sort on.

  • No labels