Example

An example Data Stream can be found below that demonstrates how to use this Transformation to add two new fields: a conversion to Fahrenheit and a 'hot' indicator.

Refer to configuration to understand all configuration options of this Agent.

Files

See the Import, Export, and Clone - XMPro article for steps to import a Data Stream.

Example Expressions

Country, Location, Unit and Vibration in the examples below are attribute names.

Strings

Create a new string using data points from the stream

"Request from " + Country + ", " + Location + " for unit: " + Unit

Add a "+" sign to add string values together.

Create a hard-coded new string value

"Demonstration Unit #A2"

If-statement

Using the short-hand If-statement the following reads “If the vibration is larger than 9000 then value is High otherwise it’s Medium

Vibration > 9000 ? "High" : "Medium"

Date and Time

Current date and time

DateTime.UtcNow

Add two days to the current date and time

DateTime.UtcNow.AddDays(2)

Larger than

This will return true or false. Please note that the Data Type needs to be set to Boolean.

Vibration > 9000

Math Library

Any C# Math library function can be used to alter data as needed. Any method within the library can be used without issue.

Square Root

Math.Sqrt(Vibration) 

Power of 3

Math.Pow(Vibration, 3)

Round to 4 decimal Places

Math.Round(Vibration, 4)

Supported Operators

Operators precedence is respected following C# rules (Operator precedence and associativity).

Last updated