====== MIN() Function ====== The MIN() function can be used in a variety of ways to get the minimum value of a variable. Usage: ''MIN(variable, options, threshold)'' - see below for description. ===== Generic Variables (per device type) ===== ''MIN('INC1_AE', 5, 0)'' Get the minimum value for the selected period ===== Device - Specific Variables ===== For device specific variables use a . to separate the device name: ''MIN('My Device.My Value',1)'' Get the minimum value of the variable for the current day. ===== Option Parameters ===== The second parameter, [options] is a number and can be any of the following |0 | latest value (Default) | |1 | DAY - Minimum value for current day | |2 | WEEK - Minimum value for current week | |3 | MONTH - Minimum value for current month | |4 | YEAR - Minimum value for current year | |5 | PERIOD - Minimum value for the selected range | |6 | SLICE - Minimum value for the slice in the range (i.e. in a graph segment) | The third option parameter allows you to set a threshold value other than 0. This is useful when you are trying to calculate values in expressions such as MAX('var') - MIN('val') on data may be zero at midnight. Leaving the third parameter at 0 would mean the expression would result in the maximum value. ===== Example ===== Get the miminum value of a variable for a day: ''MIN('delta0_kwh',1)''