A Last node is a Calculation node that you can use in a policy model to retrieve the last row in a collectionA set of results from a Query node or a set of readings associated with input nodes such as Measurement Location, Health Indicator, or OPC Tag., whose fields you can then use in successor nodes to perform various calculations or actions.
Note: For reading collections that are associated with Measurement Location, Health Indicator, or OPC Tag nodes, the last row is the most recent reading. For collections that are associated with Query nodes, the last row depends on the order in which the query is sorted.
The input for a Last node must be a collection. The output for the Last node is any field in the row that the Last node retrieves.
The Properties window for a Last node contains the items that are described in the following table.
Item |
Description |
Notes |
---|---|---|
Collection section |
Specifies the collection from which you want to retrieve the last row. |
You can select |
The following example illustrates how you can use a Last node to retrieve the most recent reading associated with a Measurement Location record and use this value in a subsequent calculation. Consider the following nodes and connections.
As shown in the following image, you can use the Properties window for the Last node to select the Measurement Location node and the Readings option. When this option is selected, the Last node evaluates the readings that are associated with the Measurement Location record and returns the last row in the collection, which contains the most recent reading.
You can use the most recent reading in various subsequent calculations. In this example, the Greater Than node evaluates the value of the most recent reading to determine whether or not it is greater than 1,000.
Copyright © 2018 General Electric Company. All rights reserved.