Data Set

The Data Set components allow you to work on sets of data as opposed to single data points.

Σ (SUM)

The Σ (SUM) component calculates the sum of the data points in the input data set and forwards the result to the output pin.

Properties

This component has no additional properties.

Inputs

Flow

The component that acts as a trigger for this component should be connected to this pin.

Data Set

The set of data points to calculate as a sum. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The sum of the data points in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, an hour's worth of data is retrieved and the data point values are summed. If the resulting sum is greater than 60, an event is raised and the state of the entity changes to High. Otherwise, an event is raised and the state of the entity changes to Default.

Average

The Average component calculates the arithmetic mean of the input data set and forwards the result to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The set of data points for which to calculate the average. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The average of the data points. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the Daily Oil data for the first week of the year is retrieved. The values obtained over that first week are averaged. If the average is greater than 100,000, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Count

The Count component retrieves the number of data points in the data set and forwards it to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The number of data points in the data set. Not connecting this pin will produce a warning.

Example

In the following example, the number of data points are retrieved for the previous 7 days. If the number of data points is greater than 7, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Get First

The Get First component retrieves the first data point from the input data set and forwards it to the appropriate output, depending on the data type.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

If the data point retrieved is a number value, the process follows this path. Not connecting this pin will produce a warning.

Text

If the data point retrieved is a text value, the process follows this path. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the input data is compared with the data from the previous day to see if it is above or below the previous day's value. We use the Get Window From component to retrieve the previous day's data, ending at the current timestamp.

The previous day's value is obtained by using the Get First component to retrieve the first value in the data set supplied by Get Window From.

We then compare that value with the current value obtained by the Get Single component.

Get Index

The Get Index component retrieves the data point at the specified index from the input data set. It forwards the data point to the appropriate output, depending on the data type.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

idx 

The index from which to retrieve the data point, with 0 being the first data point, 1 being the next, and so on. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The numerical value of the data point at the specified index. Not connecting this output pin will produce a warning.

Text 

The text value of the data point at the specified index. Not connecting this pin will produce a warning.

err 

If no data exists in the data set or the index is out-of-range (0 ≤ index < count), the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, a set of data points is retrieved from the past day. The Get Index component needs an index in order to retrieve the value that is to be evaluated. The process flows backwards to retrieve the user's selection (A-D), which is used to provide the index number. The value is retrieved from the data set for processing. If the value is greater than a maximum value, an event is raised and the state of the entity changes to Above.

Get Last

The Get Last component retrieves the last data point from the input data set and forwards it to the appropriate output, depending on the data type.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

If the data point retrieved is a number value, the process follows this path. Not connecting this pin will produce a warning.

Text 

If the data point retrieved is a text value, the process follows this path. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, a current data point is compared with the previous day's value of the same data point. Rather than retrieving the entire 24-hour period of data, it only retrieves data for the minute before the start of that time period. It then takes the last value of that minute of data, and compares it with the current value.

Get Subset

The Get Subset component retrieves part of an input data set, starting and ending at the specified indexes.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

start 

The index that corresponds to the start of the subset, with 0 being the first data point, 1 being the next, and so on. This input is required. Not connecting this pin will produce an error.

end 

The index that corresponds to the end of the subset, with 0 being the first data point, 1 being the next, and so on. This must be of a higher index than the start index. This input is required. Not connecting this pin will produce an error.

Outputs

Data Set 

The resulting subset of data. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the Get Subset component receives 31 days of data. The user is asked to selected the start and end point to obtain the desired subset. The subset of data is then averaged and compared with a target, and events are raised accordingly.

Integral

The Integral component calculates an approximation of the integral of the input data set over or under a value.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

value 

The value over which the integral will be calculated. Not connecting this pin will produce a warning.

over

If true, the integral over a specified value is calculated. If false, the integral under a specified value is calculated. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The integral value in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the integral value of a data set is calculated. If the Primary Input is greater than the Primary Limit, the Integral component calculates the integral of the Primary Input over the value of 3; otherwise the component calculates the integral of the Primary Input under the value of 3. If the value of the integral is greater than 5, an event is raised and the state of the entity changes to True. Otherwise, an event is raised and the state of the entity changes to False.

Join Data Set

The Join Data Set component converts every data item in the data set to text, delimited by the text specified on the joiner pin. The resulting delimited output may also be prepended and/or appended with the joiner text.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

joiner 

The text that is used to delimit the text in the data set. Typically, you would use a constant consisting of a single character, such as a colon, comma, or hyphen. You can also specify a space character here.

prepen 

The text that is placed at the beginning of the output.

append 

The text that is placed at the end of the output.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Text 

The delimited text that is produced from the data set. For example, (1:2:3:4:5). Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the data set is split into two flows. The first flow takes the data set and delimits each data point with a colon. The resultant string has brackets placed before and after it. This is then recorded in the logging infrastructure, and the rest of the process proceeds as normal.

Maximum

The Maximum component retrieves the highest value of the data points in the data set and forwards it to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The maximum value in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the maximum value is calculated for the data retrieved from the previous 7 days. If the maximum is greater than 100,000, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Median

The Median component calculates the middle data point from the input data set and forwards it to the output pin. If the data set contains an even number of data points, the median is the arithmetic average of the two middle values.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The median value of the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the median value is calculated for the data retrieved from the previous 7 days. If the median is greater than 100,000, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Minimum

The Minimum component retrieves the lowest value of the data points in the data set and forwards it to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The minimum value in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the minimum value is calculated for the data retrieved from the previous 7 days. If the minimum is greater than 10,000, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Pearson

The Pearson component calculates the Pearson product-moment correlation coefficient of the two input data sets and forwards the result to the output pin. The result is a decimal value ranging from -1 to 1.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set X 

The X set of data points, used for the X array in the correlation calculation. This input is required. Not connecting this pin will produce an error.

Data Set Y 

The Y set of data points, used for Y array in the correlation calculation. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The Pearson calculation output of the two data sets. Not connecting this pin will produce a warning.

err 

If the number of data points is not the same in both data sets, the calculation fails and the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

div0 

If the calculation results in a divide by zero error, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, two input data sets (X Values and Y Values, each using 4 data points), are used as inputs in a Pearson component used to calculate their correlation (a value between -1 and 1). The process has a warning ‘Cannot divide by 0’ for a divide by zero error, and another warning, ‘Number of Data points are different’ if the number of data points differs between the two data sets.

If the calculated Pearson output is greater than the Max Limit value, an event is raised, with a Max Exceeded state. Otherwise, an event is raised, with a Default state. Both events include the Pearson value as metadata.

R Squared

The R Squared component calculates the square of the Pearson product-moment correlation coefficient of the two input data sets, and forwards the result to the output pin. The result is a decimal value ranging from 0 to1.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set X 

The X set of data points, used for the X array in the correlation calculation. This input is required. Not connecting this pin will produce an error.

Data Set Y 

The Y set of data points, used for the Y array in the correlation calculation. This input is required. Not connecting this pin will produce an error.

Outputs

Number

The R Squared calculation output of the two data points. Not connecting this pin will produce a warning.

err 

If the number of data points is not the same in both sets of data, the calculation fails and the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

div0 

If the calculation results in a divide by zero error, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, two input data sets (X Values and Y Values, each using 4 data points), are used as inputs to an R Squared component, used to calculate their R Squared value (Pearson correlation squared), which is a value between 0 and 1. The process has a warning ‘Cannot divide by 0’ for a divide by zero error, and another warning, ‘Number of Data points are different’ if the number of data points differs between the two data sets.

If the calculated output is greater than the Max Limit value, an event is raised, with a Max Exceeded state. Otherwise, an event is raised with a Default state. Both events include the R Squared value as metadata.

Slope

The Slope component calculates the slope (or gradient) of the linear regression line between two input data sets, and forwards the result to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set X 

The X set of data points, used for the X array in the slope calculation. This input is required. Not connecting this pin will produce an error.

Data Set Y 

The Y set of data points, used for the Y array in the slope calculation. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The calculated slope of the data points.

err 

If the number of data points is not the same in both sets of data, the calculation fails and the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

div0 

If the calculation results in a divide by zero error, the process follows this path. If this pin is not connected the process will abort if an error is encountered.

Example

In the following example, two input data sets (X Values and Y Values, each using 4 data points), are used as inputs in a Slope component used to calculate their slope, a decimal value. The process has a warning, ‘Different number of data points’ if the number of data points differs between the two data sets, and another warning, ‘Cannot divide by 0’ if a divide by zero error occurs.

If the calculated output is greater than the Slope Max Limit value, an event is raised, with a Max Exceeded state. Otherwise, an event is raised with a Default state. Both events include the Slope value as metadata.

Time Range

The Time Range component retrieves the period of time from the first data point in the input data set to the last point in the set, and forwards it to the output pin.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Time Period

The time period from the first data point to the last data point in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the time range value is calculated for the data retrieved from the previous 7 days. If the time range is greater than 7 days, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Time-Weighted Average

The Time-Weighted Average component calculates the time-weighted mean of the input data set. With a time-weighted mean, each number in the data set is multiplied by how long it is effective for before it is summed, and then divided by the total duration of the data points.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The time-weighted average value of the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the time-weighted average is calculated for the data retrieved from the previous 7 days. If the time-weighted average is greater than 100,000, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

To OaDate

The To OaDate component outputs a data set of OLE Automation Date equivalents of the input data set timestamps.

Note: The OLE Automation Date is implemented as a floating-point number whose integral component is the number of days before or after midnight, 30 December 1899. The fractional component represents the time on that day divided by 24.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Data Set 

The data set containing OLE Automation Date equivalents of the timestamps for each of the input data set’s data points.

Example

In the following example, an input data set (X Values) of 2 data points, is used as input to a To OaDate component, with an output data set of OLE Automation Date equivalents of the data points’ timestamps.

If the number of actual X value data points is not equal to 2, an event is raised, with a Default state.

If the number of actual X value data points is equal to 2, these data point values are used as the X inputs, while their corresponding timestamps (now in OLE Automation Date format) are used as the Y inputs to a Slope component. The Slope component has a warning ‘Cannot divide by zero’ for a divide by zero error, and another warning, ‘Number of Data points are different’ if the number of data points differs between the two data sets. If the calculated slope value is greater than the Slope Max Limit value, an event is raised with a Max Exceeded state. Otherwise, an event is raised,with a Default state. Both events include the Slope value as metadata.

Variance

The Variance component calculates the variance (mean of the squares) of the input data set.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number 

The variance of the values in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the variance is calculated for the data retrieved by the period specified in the Variance Time parameter. If the variance is greater than that specified by the Variance input, an event is raised and the state of the entity changes to Variance Exceeded.

σ (Std. dev)

The σ (Std. dev) component calculates the standard deviation of the input data set.

Properties

This component has no additional properties.

Inputs

Flow 

The component that acts as a trigger for this component should be connected to this pin.

Data Set 

The data set containing a number of data points. This input is required. Not connecting this pin will produce an error.

Outputs

Number

The standard deviation of the values in the data set. Not connecting this pin will produce a warning.

err 

If no data exists in the data set, the process follows this path. If this pin is not connected, the process will abort if an error is encountered.

Example

In the following example, the standard deviation is calculated for the data retrieved from the previous 7 days. If the standard deviation is greater than 500, an event is raised and the state of the entity changes to Above. Otherwise, an event is raised and the state of the entity changes to Below.

Related: Sentinel Studio PrimersCreating a User Process, Usage Examples

 

Comments are closed