Calculated fields are a means of adding additional fields to a dataset based on fields that are returned in that dataset. All numeric columns in the dataset will be listed in the Field Name list in the bottom left corner where they can be double-clicked to include them in the formula. A subset of the supported functions are listed in the Functions dropdown.

Operators

+ Addition / Concatenation of a String
- Subtraction / Negation of a Numeral
* Multiplication
/ Division
% Modulo – the remainder when one number is divided by another
^ Power
<< Shift Left
>> Shift Right
= Equals Comparison
<> Comparison – Does Not Equal
< Comparison – Less Than
> Comparison – Greater Than
<= Comparison – Less Than OR Equal To
>= Comparison – Greater Than OR Equal To
AND Logical – AND
OR Logical – OR
XOR Logical – Exclusive OR
NOT Logical – NOT
If Conditional e.g. If([FIELD_A] > 100, “greater”, “less”)
Cast Cast and conversion e.g. CAST([FIELD_B],int]
String literal A literal string value e.g. [FIELD_C] = “hello world!”
True/False A literal boolean value e.g. [FIELD_C] = true

Mathematical Functions

Abs Returns the absolute value of a number.
Ceiling Returns the smallest integral value that is greater than or equal to the specified decimal number.
Clamp Returns value clamped to the inclusive range of min and max.
Floor Returns the largest integral value less than or equal to the specified decimal number.
IEEERemainder Returns the remainder resulting from the division of a specified number by another number.
Max(a, b) Returns the larger of two numbers a and b.
Min(a, b) Returns the smaller of two numbers a and b.
Pow(a, b) Returns a specified number raised to the specified power.
Round Rounds a decimal value to the nearest integral value, and rounds midpoint values to the nearest even number.
Round(a,b) Rounds a decimal value (a) to a specified number of fractional digits (b), and rounds midpoint values to the nearest even number.
Sign(a) Returns an integer that indicates the sign of a number.
Sqrt Returns the square root of a specified number.
Truncate Calculates the integral part of a specified decimal number.

String Functions

Concat(A, B) Concatenates two strings A & B.
Contains(A) Returns a value indicating whether a specified character or substring occurs within this string.
EndsWith(A) Determines whether the end of this string instance matches the specified character or string
IndexOf Reports the zero-based index of the first occurrence of the specified Unicode character or String in this string.
IsNullOrEmpty Indicates whether the specified string is null or an empty string (“”).
IsNullOrWhiteSpace Indicates whether a specified string is null, empty, or consists only of white-space characters.
LastIndexOf(a) Reports the zero-based index position of the last occurrence of the specified Unicode character or string (a) within this instance.
Normalize() Returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C.
PadLeft(a,b) Returns a new string that right-aligns the characters in this instance by padding them with spaces (or optional unicode character b) on the left, for a specified total length (a).
PadRight(a,b) Returns a new string that left-aligns the characters in this instance by padding them with spaces (or optional unicode character b) on the rogjt, for a specified total length (a).
Replace(a, b) Returns a new string in which all occurrences of a specified character or string (a) in the current instance are replaced with another specified string b.
StartsWith(a) Determines whether the beginning of this string instance matches the specified character or string a.
Substring(a, b) Retrieves a substring from this instance. The substring starts at a specified character position a and has an optional specified length of b
ToLower Returns a copy of this string converted to lowercase.
ToUpper Returns a copy of this string converted to uppercase.
Trim Removes all leading and trailing white-space characters from the current string.
TrimEnd Removes all the trailing white-space characters from the current string.
TrimStart Removes all the leading white-space characters from the current string.

Boolean Functions

ToString() Converts the value of this instance to its equivalent string representation (either “True” or “False”).

DateTime Functions

Date Gets the date component of this instance.
Day Gets the day of the month represented by this instance.
DayOfWeek Gets the day of the week represented by this instance.
DayOfYear Gets the day of the year represented by this instance.
Hour Gets the hour component of the date represented by this instance.
Millisecond Gets the milliseconds component of the date represented by this instance.
Minute Gets the minute component of the date represented by this instance.
Month Gets the month component of the date represented by this instance.
Now Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
Second Gets the seconds component of the date represented by this instance.
TimeOfDay Gets the time of day for this instance.
Today Gets the current date.
Year Gets the year component of the date represented by this instance.
AddDays(a) Returns a new DateTime that adds the specified number of days to the value of this instance.
AddHours(a) Returns a new DateTime that adds the specified number of hours to the value of this instance.
AddMilliseconds(a) Returns a new DateTime that adds the specified number of milliseconds to the value of this instance.
AddMinutes(a) Returns a new DateTime that adds the specified number of minutes to the value of this instance.
AddMonths(a) Returns a new DateTime that adds the specified number of months to the value of this instance.
AddSeconds(a) Returns a new DateTime that adds the specified number of seconds to the value of this instance.
AddTicks(Int64) Returns a new DateTime that adds the specified number of ticks to the value of this instance.
AddYears(Int32) Returns a new DateTime that adds the specified number of years to the value of this instance.
Compare(a, b) Compares two instances of DateTime and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.
CompareTo(a) Compares the value of this instance to a specified DateTime valuea and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
DaysInMonth(year,month) Returns the number of days in the specified month and year.
Equals(a) Returns a value indicating whether the value of this instance is equal to the value of the specified DateTime instance a.
IsDaylightSavingTime() Indicates whether this instance of DateTime is within the daylight saving time range for the current time zone.
IsLeapYear(Int32) Returns an indication whether the specified year is a leap year.
ToLongDateString() Converts the value of the current DateTime object to its equivalent long date string representation.
ToLongTimeString() Converts the value of the current DateTime object to its equivalent long time string representation.
ToShortDateString() Converts the value of the current DateTime object to its equivalent short date string representation.
ToShortTimeString() Converts the value of the current DateTime object to its equivalent short time string representation.

As a .NET based application, these functions are all inherited from the following .NET Classes and other functions are available however those listed above should cover the needs of most Nathean Analytics users.

Math – https://docs.microsoft.com/en-us/dotnet/api/system.math?view=net-5.0
String – https://docs.microsoft.com/en-us/dotnet/api/system.string?view=net-5.0
DateTime – https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0
TimeSpan – https://docs.microsoft.com/en-us/dotnet/api/system.timespan?view=net-5.0
Boolean – https://docs.microsoft.com/en-us/dotnet/api/system.boolean?view=net-5.0

Revision: 4
Last modified: Dec 11, 2020

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment