Skip to content

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)
Basic MathsSubtractSUB(a, b,..., n)Evaluated right to left (n - … b - a)
Basic MathsMultiplyMUL(a, b,..., n)
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

All calculation functions accept a constant value or any valid timeseries source as an input.

A valid timeseries source in Eigen Ingenuity is anything of the form

historian/id
enterprise historian:ip21/21PI1234.val
an open source historian:influx/kitchen_temp
a calculation:calc/ADD(15,24,35)
signal generator outputs:siggen/rand10\~5@3600000
constant values:value/10

Constant values are a special case in that there is no need to prefix them with “value/” as the system will do that automatically.

Many of the calculation functions accept units of time input. The following are valid in all cases:

s: seconds

m: minutes

h: hours

d: days

w: week

mo: months

y: year

1 second:1s
1 minute:1m or 60s
7 days:7d or 1w
1 calendar month:1mo
6 hours:6h

Where a calculation is stated as accepting Relative Time Expressions, both offsets and timestamps can be specified. For example:

Supported Expressions
in 2 days
5 days ago
2 days and 5 seconds
in 2 days at the same time
2 days and 5 minutes ago
last moment of yesterday
in 3 days at midnight
now

The following are not supported:

UnsupportedExample
Day names”last moment of last Sunday”
Vague time expressions”yesterday at lunchtime”
Partial day references”morning”
Holiday names”Christmas day”

In the following descriptions, reference is often made to Raw and Interpolated points.

Raw points are real data points that have been stored in the underlying data historian.

Interpolated points are virtual data points calculated from the raw points.

By default Interpolated points are used in charts and KPIs but the user can change this to Raw points. The reason for this is that the User Interface has no awareness of the number of raw points in a tag before it queries it. If the tag has very high frequency data (for example one point per second) then the returned dataset will be very large and could take a long time to load, or worse, crash the users browser. Conversely, if the underlying tag is very sparse, for example a safety valve position which only moves occasionally, there may be no data within the window requested.

To overcome this issue, Ingenuity 7 will default to 10001 interpolated points on a trend (this can be changed in the trend configuration) to ensure that a trend will always load and then the user can decide to switch to raw points.