Skip to content

2.1 Calculations Summary

The table below is a quick reference for all the calculations. All calculations must be preceded by “calc/”, for example calc/ADD(a,b). This prefix will be added automatically by the UI but should be remembered if typing a calculation manually. The placeholders a, b etc. can be a constant value or another timeseries source, or another calculation.

Basic Maths:

CategoryNameSyntaxNotes
Basic MathsAddADD(a, b,..., n)See section 2.6
Basic MathsSubtractSUB(a, b,..., n)Evaluated right to left (n - … b - a)
Basic MathsMultiplyMUL(a, b,..., n)See section 2.6
Basic MathsDivideDIV(a, b,..., n)Evaluated right to left (n / … b / a)
Basic MathsPercent DeviationPERCENTDEV(a, b)Evaluated as 100*(a-b)/b
TotalisersTotaliseTOTALISE(a, window, starttime, rate)See section 2.7
TotalisersTotalise RawTOTALISERAW(a, window, starttime, rate)See section 2.7.3
FunctionExponentialEXP(input)See section 2.8.1
FunctionNatural LogLN(input)See section 2.8.2
FunctionSquare RootSQRT(input)See section 2.8.3
FunctionLogLOG(input, b)See section 2.8.4
FunctionPowerPOWER(input, b)See section 2.8.5
Sliding AggregatesAverageSLIDINGAGG(input, AVG, window)See section 2.9.1
Sliding AggregatesCountSLIDINGAGG(input, COUNT, window)See section 2.9.2
Sliding AggregatesNumber of Bad PointsSLIDINGAGG(input, NUMBAD, window)See section 2.9.3
Sliding AggregatesNumber of Good PointsSLIDINGAGG(input, NUMGOOD, window)See section 2.9.4
Sliding AggregatesStandard DeviationSLIDINGAGG(input, STDDEV, window)See section 2.9.5
Sliding AggregatesVarianceSLIDINGAGG(input, VAR, window)See section 2.9.6
Sliding AggregatesMinimumSLIDINGAGG(input, MIN, window)See section 2.9.7
Sliding AggregatesMaximumSLIDINGAGG(input, MAX, window)See section 2.9.8
Sliding AggregatesSumSLIDINGAGG(input, SUM, window)See section 2.9.9
Sliding AggregatesDIFFSLIDINGAGG(input, DIFF, window)See section 2.9.10
Windowed AggregatesSame functions as SLIDINGAGGWINDOWAGG(input, function, window)See section 2.10
StatisticsMaximumMAX(a, b,.., n)See section 2.11.1
StatisticsMinimumMIN(a, b,.., n)See section 2.11.2
StatisticsMeanMEAN(a, b,.., n)See section 2.11.3
StatisticsMedianMEDIAN(a, b,.., n)See section 2.11.4
StatisticsStandard DeviationSTDDEV(a, b,.., n)See section 2.11.5
StatisticsVarianceVAR(a, b,.., n)See section 2.11.6
LogicalIf Tag ExistsIFTAGEXISTS(a, ifFalse)See section 2.12.1
LogicalIf EqualsIFEQUALS(a, b, ifTrue, ifFalse, <precision>)See section 2.12.2
LogicalThresholdTHRESHOLD(a, b, ifaboveorequal, ifbelow)See section 2.12.3
Series ConditioningSteppedSTEPPED(tag)See section 2.13.1
Series ConditioningStepped RawSTEPPEDRAW(tag)See section 2.13.2
Series ConditioningNo BADNOBAD(tag)See section 2.13.3
Series ConditioningTimeshiftTIMESHIFT(a, offset)See section 2.13.4
Series ConditioningHighpassHIGHPASS(a, time-constant)See section 2.13.5
Series ConditioningLowpassLOWPASS(a, time-constant)See section 2.13.6
DateEpoch MillisecondsEPOCH_MS(tag)See section 2.15.1
OtherPoint in TimePOINTINTIME(a, timereference)See section 2.16.1
OtherCurrent Epoch Millisecondsdates/CURRENT_EPOCH_MSReturn wall clock time in epoch ms
DatesDaydates/DAYReturn number of day in month. Points returned at midnight of configured timezone
DatesDay UTCdates/DAY_UTCReturn number of day in month. Points returned at midnight UTC
DatesDay of Weekdates/DAY_OF_WEEKReturn number of day in week. Monday is 1, Sunday is 7. Points returned at midnight of configured timezone
DatesDay of Week UTCdates/DAY_OF_WEEK_UTCReturn number of day in week. Monday is 1, Sunday is 7. Points returned at midnight UTC
DatesDay of Monthdates/DAY_OF_MONTHReturn number of day in month. Points returned at midnight of configured timezone
DatesDay of Month UTCdates/DAY_OF_MONTH_UTCReturn number of day in month. Points returned at midnight UTC
DatesDays in Monthdates/DAYS_IN_MONTHReturn number of days in month
DatesDay of Yeardates/DAY_OF_YEARReturn number of day in year. Points returned at midnight of configured timezone
DatesDay of Year UTCdates/DAY_OF_YEAR_UTCReturn number of day in year. Points returned at midnight UTC
DatesIs Todaydates/IS_TODAYReturn 1 if given timestamp is today
DatesIs Before Todaydates/IS_BEFORE_TODAYReturn 1 if given timestamp is before midnight of today
DatesMonthdates/MONTHReturns number of month in local timezone. January is 1
DatesMonth UTCdates/MONTH_UTCReturn number of month. Points returned at midnight UTC. January is 1
DatesYeardates/YEARReturn number of year. Points returned at midnight of configured timezone
DatesYear UTCdates/YEAR_UTCReturn number of year. Points returned at midnight UTC