Element8
Filtering out bad data in event attribute enumerations
By Tebello Masedi
Customer Success Engineer

Filtering out bad data in event attribute enumerations

Enumerations allow Flow to translate an event attribute from a numeric value to a human-readable string value. It does this by looking up a tag value against a lookup value called enumeration ordinal, associated with a string value. On a successful match, the event attribute value replaced with the String. An enumeration ordinal can only be of type integer, which implies that the source tag cannot be a floating-point number.

1. Introduction

Flow returns a null instead of an Enumeration ordinal value for a retrieved event attribute when a historian returns a bad quality tag. This technote walks through filtering out invalid data using a custom expression for a retrieved event attribute segment.

2. Solution

  1. Open the enumeration.
  2. Add a new ordinal that represents the invalid data.

3. Open the event and navigate to the retrieved attribute’s retrieval properties.
4. Change the Type to Custom Expression.

5. Open the Custom Expression Editor and add the tag/s from the Namespace to the Items list.

6. Select Row-based Lookup under Event Attribute from the Example Menu.

7. The expression automatically populates in the editor with the tag where applicable.

8. Adjust the ternary condition so that you compare the tag value to the expected enumeration ordinal.

9. Add a case for every enumeration ordinal if necessary. Use MS Excel to generate a list of the string results where the number of ordinals is excessive.

NB: An Event Attribute has a data type of String, while the Enumeration Ordinal is or type Integer. Flow automatically handles the two types internally when comparing the tag value to the ordinal.

10. Validate the expression, deploy the event, and backfill the attribute. The event attribute values are now populated, and the enumeration replaces null/invalid data.

3. Downloads