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.
File | Link | Security Key |
---|---|---|
Data Stream | Calculated Field Example.xuc | C0mp|ex123 |
Country, Location, Unit and Vibration in the examples below are attribute names.
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"
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"
Current date and time
DateTime.UtcNow
Add two days to the current date and time
DateTime.UtcNow.AddDays(2)
This will return true or false. Please note that the Data Type needs to be set to Boolean.
Vibration > 9000
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)
Category | Operators |
---|---|
Primary | x.y f(x) a[x] new typeof |
Unary | + - ! (T)x |
Multiplicative | * / % |
Additive | + - |
Relational and type testing | < > <= >= is as |
Equality | == != |
Logical AND | & |
Logical OR | | |
Logical XOR | ^ |
Conditional AND | && |
Conditional OR | || |
Conditional | ?: |
Assignment | = |
Null coalescing | ?? |
Last modified 1yr ago