min(list)

Tinderbox Icon


Operator Type:   Function
Operator Scope of Action:   List
Operator Purpose:   Mathematical

min(list)

The min() operator returns the largest item in a List or Set data type attribute. Prior to v5.6.0, this operator required Set data.

Both the operators max() and min() use lexical comparison in most cases, but numeric comparison if the context is numeric, e.g.:

$Width=min("100;2;70") 

Since "Width" is numeric, min() will be return 2.

$Name=min("100;2;70") 

Since the attrbute "Name" is a string, mix() will return 100.

If you don't have a set, create one on the fly:

$MyMin = min(collect_if(all,$MyNum>0,$MyNum)) 

$MyMin = min(collect(descendants,$Modified)) 

This allows export via ^value^:

^value(min(collect(descendants,$Modified)))^ 

When using Date-type data bear in mind that the unset Date default is "never" and that "never' is always before (i.e. less than) any set date. So to use min() with dates, filter out the unset values:

$MyMin = min(collect_if(descendants,($Modified!="never"),$Modified)) 


Possible relevant notes (via "Similar Notes" feature):

Up: List-based operators

A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Scope : List-based operators : min(list)

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox