last
- Details
- Last Updated on Friday, 18 January 2013 09:58
syntax
- last(a)
- last(a, partioning)
definition
- last(a) results in a parameter with the last of the non null values of attribute a.
- last(a, partioning) results in an attribute with the last of the non null values of attribute a, grouped by the partitiong attribute. The domain unit of the resulting attribute is the values unit of the partioning attribute.
The values unit of the resulting data item should match with regard to value type and metric with the values unit of attribute a.
applies to
Attribute a with value types:
- groups: Numeric, Point
- string
- bool
conditions
Attributes a and partioning need to match with regard to their domain unit.since version
5.15
example
1. parameter<uint32> lastNrInh:
expr = "last(City/NrInhabitants)"; result = 175
2. parameter<string> lastCityName:
expr = "last(City/CityName)"; result = ‘Haarlem’
3. parameter<bool> lastIsCapital:
expr = "last(City/IsCapital)"; result = False
4. attribute<uint32> lastNrInhRegion (RegionDomain):
expr = "last(City/NrInhabitants, City/RegionNr)";
5. attribute<string> lastCityNameRegion (RegionDomain):
expr = "last(City/CityName, City/RegionNr)";
6. attribute<bool> lastIsCapital (RegionDomain):
expr = "last(City/IsCapital, City/RegionNr)";
| City/NrInhabitants | City/CityName | IsCapital | City/RegionNr |
| 550 | Amsterdam | True | 0 |
| 525 | Rotterdam | False | 1 |
| 300 | Utrecht | False | 2 |
| 500 | DenHaag | False | 1 |
| 200 | Eindhoven | False | 3 |
| 175 | Haarlem | False | null |
| null | null | False | 3 |
Table CityDomain, nr of rows = 7
| lastNrInhRegion | lastCityNameRegion | lastIsCapitalRegion |
| 550 | Amsterdam | True |
| 500 | DenHaag | False |
| 300 | Utrecht | False |
| 200 | Eindhoven | False |
| null | null | False |
Table RegionDomain, nr of rows = 5