SortedEntityClass
SortedEntityClass [class,prop]
represents an entity class derived from class by sorting according to the values of the property prop.
SortedEntityClass [class,prop"order"]
sorts according to prop in the order specified.
SortedEntityClass [class,{prop1,prop2,…}]
breaks ties by successively using the values of the property specifications propi.
SortedEntityClass [class,sortspec,n]
represents the first n entities of class when sorted by sortspec.
SortedEntityClass [class,sortspec,{m,n}]
represents the entities m through n of class when sorted by sortspec.
Details
- In SortedEntityClass [class,sortspec,n], when class contains fewer than n entities, all entities are used.
- In SortedEntityClass [class,{prop1,prop2,…}], propi can be given as EntityProperty , EntityFunction or string.
- SortedEntityClass [class,prop,-n] is effectively equivalent to SortedEntityClass [class,prop->"Descending",n].
Examples
open allclose allBasic Examples (5)
Use SortedEntityClass to sort a class of entities:
Change the direction of the order:
Take only the first 10 entities:
Sort by multiple criteria:
When used with relational-database-backed entities, SortedEntityClass is equivalent to an ORDER BY statement:
Scope (1)
The second argument of SortedEntityClass can be an EntityFunction :
Properties & Relations (1)
When SampledEntityClass is applied to SortedEntityClass :
The same class can be more simply expressed by using SortedEntityClass with three arguments:
Neat Examples (1)
Make a map of the 10 largest countries by population:
Tech Notes
History
Text
Wolfram Research (2019), SortedEntityClass, Wolfram Language function, https://reference.wolfram.com/language/ref/SortedEntityClass.html.
CMS
Wolfram Language. 2019. "SortedEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SortedEntityClass.html.
APA
Wolfram Language. (2019). SortedEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SortedEntityClass.html
BibTeX
@misc{reference.wolfram_2025_sortedentityclass, author="Wolfram Research", title="{SortedEntityClass}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SortedEntityClass.html}", note=[Accessed: 12-April-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_sortedentityclass, organization={Wolfram Research}, title={SortedEntityClass}, year={2019}, url={https://reference.wolfram.com/language/ref/SortedEntityClass.html}, note=[Accessed: 12-April-2025 ]}