﻿ SERIES_FUNCTION_INFO

# SERIES_FUNCTION_INFO

EQuIS 7  >>  Live > Agents > Data Deriver > Examples >

# SERIES_FUNCTION_INFO { sourceSeriesId: , frequency: "dd", utcOffset: 0, startDate: "DATEADD(dd, -1, ?)", endDate: "DATEADD(mi, 6, ?)", dateOffset: -361, value: "MAX(CASE WHEN d.datum_value < 0 THEN NULL ELSE d.datum_value END) - MIN(CASE WHEN d.datum_value < 0 THEN NULL ELSE d.datum_value END)" }

See explanation here.

Using the given three input series, create an hourly sum and delete the original data after 168 hours (aka one week).

Using the given two input series, create a rolling 24-hour sum that is calculated each hour (deleteInputDataAfter is omitted, so never delete the input data).

Using the given input series, calculate a daily value that is the year-to-date (since 01-Jan) sum (never delete the input data).

{sourceSeriesId:,frequency:"hh",value:"SUM(?) + 16.1"}

Using the given input series, calculate an hourly value that applies a simple correction formula; startDate is omitted so it will default to each preceding hour.

{"sourceSeriesId":,"frequency":"15mi",startDate: "CASE WHEN DATEPART(mi, ?) = 0 THEN DATEADD(hh, -1, ?) ELSE DATEADD(mi, -DATEPART(mi, ?), ?) END","value":"SUM(?)"}

Using the given input series, calculate the sum of the 15 minute data for each whole hour cumulatively, then drop back to zero to start the next hour.

Using the given input series, calculate the sum over a 24-hour period from midday to midday.

{sourceSeriesId:,frequency:"hh", exportSQL:"INSERT dt_flow (measurement_start_date, instant_flow, facility_id, sys_loc_code) SELECT datum_utc_dt, datum_value, 1, 'Location1' FROM dt_logger_datum WHERE dt_logger_datum.logger_series_id = @deriver_logger_series_id AND dt_logger_datum.datum_utc_dt > @deriver_start_date"}

Using the given input series, calculate an hourly value and copy the data into DT_FLOW for FACILITY_ID=1 and SYS_LOC_CODE="Location1".

{sourceSeriesId:,frequency:"hh", exportSqlProcedure:"equis.my_custom_procedure"}

Using the given input series, calculate an hourly value, and then call stored procedure equis.my_custom_procedure (see Example: exportSqlProcedure:"equis.my_custom_procedure").

{ sourceSeriesId: , frequency: "hh", value: "AVG(CASE WHEN d.datum_qualifier = 'bad ' THEN NULL ELSE d.datum_value END)" }

Exclude source DATUM_VALUE from being used in the derivation, when its DATUM_QUALIFER = 'bad '.