- Getting Started
- Administration Guide
- User Guide
- Developer Guide
Functions
You can use a function in an expression to perform actions on data in data regions, groups, and datasets. You can access these functions under the Functions node within the Expression Editor dialog. In any property that accepts expressions, you can drop down the property and select <Expression> to open the dialog.
Refer to the following tables that contain details about each of the functions included in Wyn Enterprise for use in property expressions.
Note: The Date & Time functions used to define the date and time values display the date in MM/DD/YYYY and the time in HH:mm:ss format.
Date & Time
Function | Description | Syntax (S) and Example (E) |
---|---|---|
DateAdd | Returns a date and time value that is the result of adding the interval to the date and time field of the specified unit. | S: E: |
DateDiff | Returns the difference between the start date and time and end date and time of the specified unit. | S: E: |
DatePart | Returns the Integer value that represents the specified part of the given date. | S: E: |
DateSerial | Returns a Date value that represents a specified year, month, and day, with the time information set to midnight (00:00:00). | S: E: |
DateString | Returns the String value that represents the current date in your system. | S: E: |
DateValue | Returns a Date value that contains the information on date represented by a string, with the time set to midnight (00:00:00). | S: E: |
Day | Returns an Integer value from 1 through 31 that represents the day of the month. | S: E: |
Hour | Returns an Integer value from 0 through 23 that represents the hour of the day. | S: E: |
Minute | Returns an Integer value from 0 through 59 that represents the minute of the hour. | S: E: |
Month | Returns an Integer value from 1 through 12 that represents the month of the year. | S: E: |
MonthName | Returns the name of the month specified in the date as a String. | S: E: |
Now | Returns the current date and time in your system. | S: E: |
Second | Returns an Integer value from 0 through 59 that represents the second of the minute. | S: E: |
TimeOfDay | Returns a Date value containing the current time of day in your system. | S: E: |
Timer | Returns a Double value that represents the number of seconds elapsed since midnight. | S: E: |
TimeSerial | Returns a Date value that represents a specified hour, minute, and second, with the date information set relative to January 1 of the year 0001. | S: E: |
TimeString | Returns the String value that represents the current time of day in your system. | S: E: |
TimeValue | Returns a Date value that contains the information on time represented by a string, with the date set to January 1 of the year 0001. | S: E: |
Today | Returns a Date value that contains the current date in your system. | S: E: |
Weekday | Returns an Integer value that contains a number representing the day of the week. | S: E: |
WeekdayName | Returns a String value that contains the name of the specified weekday. | S: E: |
Quarter | Returns an Integer value from 1 through 4 that represents the quarter of the year. | S: E: |
QuarterName | Returns a String value that represents the quarter of the year. | S: E: |
Year | Returns an Integer value from 1 through 9999 representing the year. | S: E: |
AddYears | Returns a date and time value that is a result of adding the date interval in years. The specified date interval can be negative. | S: E: |
AddMonths | Returns a date and time value that is a result of adding the date interval in months. The specified date interval can be negative. | S: E: |
AddDays | Returns a date and time value that is a result of adding the date interval in days. The specified date interval can be negative. | S: E: |
AddHours | Returns a date and time value that is a result of adding the time interval in hours. The specified time interval can be negative. | S: E: |
AddMinutes | Returns a date and time value that is a result of adding the time interval in minutes. The specified time interval can be negative. | S: E: |
AddSeconds | Returns a date and time value that is a result of adding the time interval in seconds. The specified time interval can be negative. | S: E: |
AddMilliseconds | Returns a date and time value that is a result of adding the time interval in milliseconds. The specified time interval can be negative. | S: E: |
DateTime.Parse | Converts the specified string value to a date and time value. | S: E: |
Math
Function | Description | Syntax (S) and Example (E) |
---|---|---|
Abs | Returns the absolute or positive value of a single-precision floating-point number. | S: E: |
Acos | Returns the angle whose cosine is the specified number. | S: E: |
Asin | Returns the angle whose sine is the specified number. | S: E: |
Atan | Returns the angle whose tangent is the specified number. | S: E: |
Atan 2 | Returns the angle whose tangent is the quotient of two specified numbers. | S: E: |
BigMul | Returns the multiplication of two 32-bit numbers. | S: E: |
Ceiling | Returns the smallest integer greater than or equal to the specified double-precision floating-point number. | S: E: |
Cos | Returns the smallest integer greater than or equal to the specified double-precision floating-point number. | S: E: |
Cosh | Returns the hyperbolic cosine of the specified angle. | S: E: |
E | Returns the value of E, which is 2.71828182845905. | S: E: |
Exp | Returns e raised to the specified power, where e is Euler's number. It is the inverse of the Log function. | S: E: |
Fix | Returns the integer portion of a number. | S: E: |
Floor | Returns the largest integer less than or equal to the specified double-precision floating-point number. | S: E: |
IEEERemainder | Returns the remainder after division of one number by another according to IEEE standards. | S: E: |
Log | Returns the logarithm of the specified number. | S: E: |
Log10 | Returns the logarithm of the specified number to the base 10. | S: E: |
Max | Returns the maximum non-null value from the specified expression. | S: E: |
Min | Returns the minimum non-null value from the specified expression. | S: E: |
PI | Returns the value of PI, which is 3.14159265358979. | S: E: |
Pow | Returns one number raised to the power of another number. | S: E: |
Round | Returns the round-off of a decimal number to the nearest integer or to the nearest decimal number up to the specified digits. | S: E: |
Sign | Returns a value indicating the sign of an 8-bit signed integer. | S: E: |
Sin | Returns the sine of the specified number. | S: E: |
Sinh | Returns the hyperbolic sine of the specified angle. | S: E: |
Sqrt | Returns the square root of the specified number. | S: E: |
Tan | Returns the tangent of the specified number. | S: E: |
Tanh | Returns the hyperbolic tangent of the specified angle. | S: E: |
Truncate | Removes the digits after decimal point without rounding-off, and returns the integer value. | S: E: |
Text
Function | Description | Syntax (S) and Example (E) |
---|---|---|
Contains | Returns True if the string contains the specified substring. | S: E: |
EndsWith | Returns True if the string ends with the specified substring. | S: E: |
IndexOf | Returns the index of the first occurrence of the specified substring within the string. | S: E: |
InStr | Returns the start position of the first occurrence of the specified substring within the string. | S: E: |
LastIndexOf | Returns the index of the last occurrence of the specified substring within the string. | S: E: |
Replace | Replaces all the occurrences of the first specified substring with the second specified substring within the string. | S: E: |
StartsWith | Returns True if the string starts with the specified substring. | S: E: |
Substring | Returns the substring at the specified position (zero-based) of the specified length. | S: E: |
ToLower | Returns the specified string in lower case. | S: E: |
ToUpper | Returns the specified string in upper case. | S: E: |
Trim | Returns the string after removing all the white-space characters from both the start and the end of the specified string. | S: E: |
TrimEnd | Returns the string after removing all the white-space characters from the end of the specified string. | S: E: |
TrimStart | Returns the string after removing all the white-space characters from the start of the specified string. | S: E: |
Inspection
Function | Description | Syntax (S) and Example (E) |
---|---|---|
IsArray | Returns True if the expression can be evaluated as an array. | S: E: |
IsDate | Returns True if the expression represents a valid Date value. | S: E: |
IsDBNull | Returns True if the expression evaluates to a null. | S: E: |
IsError | Returns True if the expression evaluates to an error. | S: E: |
IsNothing | Returns True if the expression evaluates to nothing. | S: E: |
IsNumeric | Returns True if the expression can be evaluated as a number. | S: E: |
DBNull.Value | Allows checking whether a value is a DBNull value. | S: E: |
Program Flow
Function | Description | Syntax (S) and Example (E) |
---|---|---|
Choose | Returns a value from a list of arguments. | S: E: |
IIF | Returns the first value if the expression evaluates to True, and the second value if the expression evaluates to False. | S: E: |
Partition | Returns a string (in the form x : y) that represents the calculated range based on the specified interval containing the specified number. | S: E: |
Switch | Returns the value of the first expression that evaluates to True among a list of expressions. | S: E: |
Aggregate
Function | Description | Syntax (S) and Example (E) |
---|---|---|
AggregateIf | Calculates the aggregate of the values from the specified expression if the Boolean expression meets the given condition. | S: E: |
AggregateIf (with scope) | Calculates the aggregate of the values from the specified expression if the Boolean expression meets the given condition, within the specified scope. | S: E: |
Avg | Calculates the average of all non-null numeric values from the specified expression. | S: E: |
Avg (with scope) | Calculates the average of all non-null numeric values from the specified expression within the specified scope. | S: E: |
Count | Calculates the number of non-null values from the specified expression. | S: E: |
Count (with scope) | Calculates the number of non-null values from the specified expression within the specified scope. | S: E: |
CountDistinct | Calculates the number of non-repeated values from the specified expression. | S: E: |
CountDistinct (with scope) | Calculates the number of non-repeated values from the specified expression within the specified scope. | S: E: |
CountRows | Calculates the number of rows. | S: E: |
CountRows (with Scope) | Calculates the number of rows within the specified scope. | S: E: |
CrossAggregate | Calculates the specified function with specified expression as an argument in the cross of specified row and column. | S: E: |
CumulativeTotal | Calculates the sum of page-level aggregates returned by the expression for current and previous pages. | S: E: |
DistinctSum | Calculates the sum of values from the specified expression when the value of the other expression is not repeated. | S: E: |
DistinctSum (wih scope) | Calculates the sum of values of the specified expression when the value of the other expression is not repeated, within the specified scope. | S: E: |
First | Returns the first value from the specified expression. | S: E: |
First (with scope) | Returns the first value from the specified expression within the specified scope. | S: E: |
Last | Returns the last value from the specified expression. | S: E: |
Last (with scope) | Returns the last value from the specified expression within the specified scope. | S: E: |
Max | Returns the maximum non-null value from the specified expression. | S: E: |
Max (with scope) | Returns the maximum non-null value from the specified expression within the specified scope. | S: E: |
Median | Returns the value that is the mid-point of the values in the specified expression. Median is the center value in a sequence of values. | S: E: |
Median (with scope) | Returns the value that is the mid-point of the ordered values in the specified expression, within the specified scope. Median is the center value in a sequence of values. | S: E: |
Min | Returns the minimum non-null value from the specified expression. | S: E: |
Min (with scope) | Returns the minimum non-null value from the specified expression within the specified scope. | S: E: |
Mode | Returns the most frequently occurring value from the specified expression. | S: E: |
Mode (with scope) | Returns the most frequently occurring value from the specified expression, within the specified scope. | S: E: |
RunningValue | Calculates a running aggregate of all non-null numeric values from the specified expression, using another aggregate function as a parameter. | S: E: |
RunningValue (with scope) | Calculates a running aggregate of all non-null numeric values from the specified expression, using another aggregate function as a parameter, within the specified scope. | S: E: |
StDev | Calculates the standard deviation of all non-null values of the specified expression. | S: E: |
StDev (with scope) | Calculates the standard deviation of all non-null values of the specified expression, within the specified scope. | S: E: |
StDevP | Calculates the population standard deviation of all non-null values of the specified expression. | S: E: |
StDevP (with scope) | Calculates the population standard deviation of all non-null values of the specified expression within the specified scope. | S: E: |
Sum | Calculates the sum of the values of the specified expression. | S: E: |
Sum (with scope) | Calculates the sum of the values of the specified expression within the specified scope. | S: E: |
Var | Calculates the variance (standard deviation squared) of all non-null values of the specified expression. | S: E: |
Var (with scope) | Calculates the variance (standard deviation squared) of all non-null values of the specified expression. | S: E: |
VarP | Calculates the population variance (population standard variation squared) of all non-null values of the specified expression. | S: E: |
VarP (with scope) | Calculates the population variance (population standard variation squared) of all non-null values of the specified expression, within the specified scope. | S: E: |
Conversion
Function | Description | Syntax (S) and Example (E) |
---|---|---|
ToBoolean | Converts the specified value to Boolean. | S: E: |
ToByte | Converts the specified value to Byte. | S: E: |
ToChar | Converts the specified value to Char. | S: E: |
ToDateTime | Converts the specified value to a Date and Time value. | S: E: |
ToDecimal | Converts the specified value to Decimal. | S: E: |
ToDouble | Converts the specified value to Double . | S: E: |
ToInt16 | Converts the specified value to a 16-bit signed Integer. | S: E: |
ToInt32 | Converts the specified value to a 32-bit signed Integer. | S: E: |
ToInt64 | Converts the specified value to a 64-bit signed Integer. | S: E: |
ToSingle | Converts the specified value to a single-precision floating-point number. | S: E: |
ToString | Converts the specified value to String. | S: E: |
.ToString | Converts the value to String in the specified format. | S: E: |
ToUInt16 | Converts the specified value to a 16-bit unsigned Integer. | S: E: |
ToUInt32 | Converts the specified value to a 32-bit unsigned Integer. | S: E: |
ToUInt64 | Converts the specified value to a 64-bit unsigned Integer. | S: E: |
Format | Converts the specified value to rmat. | S: E: |
NumberToWords | Converts the specified value to words. Single argument function uses the current language from the portal. A function with two arguments uses the language passed by the second argument(Supported cultures: "zh-cn", "en-us", "ja-jp"). | S: E: |
Function | Description | Syntax (S) and Example (E) |
---|---|---|
GetFields | Returns an IDictionary<string,Field> object that contains the current contents of the Fields collection. Only valid when used within a data region. This function makes it easier to write code that deals with complex conditionals. To write the equivalent function without GetFields() would require passing each of the queried field values into the method which could be prohibitive when dealing with many fields. | S: E: |
InScope | Evaluates to true or false depending on whether the current value is in the specified scope. | S: E: |
Level | Returns a zero-based integer representing the current level of depth in a recursive hierarchy in the current scope. The first level in the hierarchy is 0. | S: E: |
Level (with scope) | Returns a zero-based integer representing the current level of depth in a recursive hierarchy in the specified scope. The first level in the hierarchy is 0. | S: E: |
Level (with scope) | Returns a zero-based integer representing the current level of depth in a recursive hierarchy in the specified scope. The first level in the hierarchy is 0. | S: E: |
Lookup | Returns the first matching value for the specified name from the dataset with name and value pairs. | S: E: |
LookupSet | Returns the set of matching values for the specified name from the dataset that contains name/value pairs. | S: E: |
Previous | Calculates the value of the expression for the previous row of data. | S: E: |
Previous (with scope) | Calculates the value of the expression for the previous row of data within the specified scope. | S: E: |
RowNumber | Returns the running count of all the rows. | S: E: |
RowNumber (with scope) | Returns the running count of all the rows in the specified scope. | S: E: |
GetLength | Returns the number of elements in the specified array. | S: E: |
Item | Returns an item by its name from Fields/Parameters/ReportItems. | S: E: |
Join | Returns a string that is a result of joining the elements of an array, using the specified delimiter between elements. | S: E: |
GetUserValue | Displays the user context value for specified property, e.g. "name","email". | S: E: |
UserContext.T | Displays the user translation for specified key. | S: E: |
UserContext.GetRenderMode | Returns the render mode: "preview", "print" or "export". | S: E: |