Use the Sort operator to sort the entries in a feed on a specific element or value within each entry. You can specify multiple sort conditions.
The text to display on the Sort operator image on the canvas.Sort Value
A value you want to sort on. You can specify one of the following as a value:
- Specify a function value.
- Specify a value from the Input tree.
The order that you want the entries sorted by. You can specify either an ascending or descending sort order.
You can specify more than one value to sort on. The entries are sorted by the first condition in the table. Where there are duplicate entries, the entries are then sorted by the second condition in the table.
The information coming into the Sort operation is from a news service. Each news item contains a publication date and a title that you sort by. You want the most recent articles to appear first. The parameters that you set for the Sort operator are:
|Sort Value||Sort Order|
element is actually a text value. To sort the date properly, you must cast the value as a date value. Click the Sort Value
drop-down and expand the pubDate
element to display the actual date. Right-click on the date value, and select Date
from the list. This casts a text value as a date value. You must then click the pubDate
element to select it as your Sort Value.
The Sort operator is used in the Expiring Policies
data mashup examples. The examples are available in the IBM® Mashup Center information center
Parent topic: Operators: imc3
Tips for better performance in the data mashup builder: imc3
Filtering by node position or by element attribute value: imc3
Extract operator: imc3