Functions
From the Expression Editor, you can choose any number of built-in functions to help construct your expression.
Functions are divided into categories as follows:
To locate the desired function, select a category and then browse through the list of functions within that category. You can also select (all) to view an alphabetical list of all available functions.
Selecting a function brings up the Construct Function dialog, where you can enter values to use in your function. You can also select the ellipsis button to embed another function inside of the current one.
Date & Time
Function | Description |
---|---|
DayOfWeek(D) | Returns the day of the week (1..7) for a given date. Ex: DayOfWeek("11/21/08"); Result = 6 |
DaysBetween(D1,D2) | Returns the number of days between two dates. Ex: DaysBetween('1/1/2012','1/10/2012'); Result = 9 |
DayString(D) | Returns the day name for the given day (1=Sunday,2=Monday). Often used with DayOfWeek. Ex: DayString(1) or DayString(DayOfWeek("11/16/08")); Result = Sunday |
ExtractDay(Date) | Returns the day of the month (1... 31) from a given date. Ex: ExtractDay("11/16/08"); Result = 16 |
ExtractHour(Time) | Extract and return the hour from a time Ex: ExtractHour('8:00'); Result = 8 |
ExtractMinute(Time) | Extract and return the minute from a time Ex: ExtractMinute('8:35'); Result = 35 |
ExtractMonth(Date) | Returns the month from a given date. Ex: ExtractMonth("11/16/08"); Result = 11 |
ExtractSecond(Time) | Extract and return the second from a time Ex: ExtractSecond('8:35:22'); Result = 22 |
ExtractYear(Date) | Returns the year from a given date. Ex: ExtractYear("11/16/08"); Result = 2008 |
FormatDate(Date) | Returns a date formatted using the format parameter. Ex: FormatDate("11/16/08", "mmm d, yyyy"); Result = Nov 16, 2008 |
IncDate(Date,d,m,y)) | Increments the date parameter by the specified number of days, months, and years. Ex: IncDate('6/1/2011',3,2,4); Result = 8/4/2015 |
IncDay(Date,d) | Increments the date parameter by the specified number of days. Ex: IncDate('8/1/2011',6); Result = 8/7/2011 |
IncHour(Time,h) | Increments the time parameter by the specified number of hours. Ex: IncHour('3::00 am',8); Result = 11:34:00 a.m. |
IncMinute(Time,m) | Increments the time parameter by the specified number of minutes. Ex: IncMinute('3:34:18',8); Result = 3:32:18 am |
IncMonth(Date,m) | Increments the date parameter by the specified number of months. Ex: IncMonth('4/23/1999',5); Result = 9/23/1999 |
IncSecond(Time,s) | Increments the time parameter by the specified number of seconds. Ex: IncSecond('2:34:33',18); Result = 2:34:51 |
IncTime(Time,s,m,h) | Increments the time parameter by the specified number of seconds, minutes, and hours. Ex: IncTime('3:32:12 am',22,10,7); Result = 10:42:34 am |
IncYear(Date) | Increments the date parameter by the specified number of years. Ex: IncYear('1/2/2011',5); Result = 1/2/2016 |
MonthString(M) | Returns the month name as a string, M (1..12). Often used with ExtractMonth. Ex: MonthString(11) or MonthString(ExtractMonth("11/16/08")); Result = November |
Now() | Returns the current system date and time. |
ShortDayString(D) | Returns the day of the week as a short string. Ex: ShortDayString(5); Result = Thu |
ShortMonthString(M) | Returns the month as a short string. Ex: ShortMonthString(6); Result = Jun |
WeekOfYear(Date) | Returns week number (1-52) from given a date. Ex: WeekOfYear("11/16/08"); Result = 46 |
Logical
Function | Description |
---|---|
IsNull() | Returns true if the expression being evaluated is null. Ex: IsNull(LastName) |
If(Exp,X,Y) | Returns X if expression Exp is TRUE. Returns Y otherwise. You can use database fields, other functions or plain text as your values for X and Y. IF statements can also be nested within other IF statements. Ex: If(DataField1 = 23, DataField2, Print this text) |
Math
Function | Description |
---|---|
Abs(xI) | Returns the absolute value of x. |
ArcCos(x) | Returns the inverse cosine of a number. |
ArcCosh(x) | Returns the inverse hyperbolic cosine of a number. |
ArcCot(x) | Returns the inverse cotangent of a number. |
ArcCoth(x) | Returns the inverse hyperbolic cotangent of a number. |
ArcCsx(x) | Returns the inverse cosecant of a number. |
ArcCsch(x) | Returns the inverse hyperbolic cosecant of a number. |
ArcSec(x) | Returns the inverse secant of a number. |
ArcSech(x) | Returns the inverse hyperbolic secant of a number. |
ArcSin(x) | Returns the inverse sine of a number. |
ArcSinh(x) | Returns the inverse hyperbolic sine of a number. |
ArcTan(x) | Returns the inverse tangent of a number. |
ArcTanh(x) | Returns the inverse hyperbolic tangent of a number. |
Cos(x) | Returns the cosine of an angle. |
Cosecant(x) | Returns the cosecant of an angle. |
Cosh(x) | Returns the hyperbolic cosine of an angle. |
Cotan(x) | Returns the cotangent of an angle. |
Coth(x) | Returns the hyperbolic cotangent of an angle. |
Csch(x) | Returns the hyperbolic cosecant of an angle. |
CycleToDeg(x) | Converts an angle from cycles to degrees. |
CycleToGrad(x) | Converts an angle from cycles to grads. |
CycleToRad(x) | Converts an angle from cycles to radians. |
DegToCycle(x) | Converts an angle from degrees to cycles. |
DegToGrad(x) | Converts an angle from degrees to grads. |
DegToRad(x) | Converts an angle from degrees to radians. |
Modulo(Dividend, Divisor) | Returns the remainder (modulus) of an integer division. Ex: Modulo(100,19); Result = 5 |
Power(Base, Exponent) | Raises 'base' to the power of 'exponent'. Ex: Power(2,4); Result = 16 |
RadToCycle(x) | Converts an angle from radians to cycles. |
RadToDeg(x) | Converts an angle from radians to degrees. |
RadToGrad(x) | Converts an angle from radians to grads. |
Round(X,Y) | Rounds X to the specified number of digits. Y is the number of digits to which you want to round the number. If Y is greater than zero, the number is rounded to the specified number of decimal places. If Y is zero, the number is rounded to the nearest integer. If Y is less than zero, the number is rounded to the left of the decimal point. Ex: Round(ArgosData.Some_Number,2) |
Secant(x) | Returns the secant of an angle. |
Sech(x) | Returns the hyperbolic secant of an angle. |
Sin(x) | Returns the sine of an angle. |
Sqrt(x) | Returns the square-root of x. |
Other (Extract reports only)1
Function | Description |
---|---|
GetExpr |
Returns the value of another expression used within the report. For example, this could be used in the conditional print field to print only if another expression does not evaluate to 0: Ex: GetExpr('Expression1') <> 0 |
ResetExpr |
Reset the value of another expression used within the report. Ex: ResetExpr('Expression2') |
String
Function | Description |
---|---|
Delete(string, index, count) | Deletes 'count' number of characters text from a string beginning at position 'index'. Ex: Delete('DeleteThis', 7, 4) |
EncodeURI(string) |
Encodes a Uniform Resource Identifier (or URL) which may contain characters that are not valid within URLs. It is mainly used for verifying that a URI is valid for the scheme, authority, and path portions of a URI. Here are the characters encoded by this function:
URI Reference foo://example.com:8042/over/there?name=ferret#nose
Ex: http://%%EncodeURI(:hostname)%% |
EncodeURI |
EncodeURIComponent encodes more characters than EncodeURI. It is useful for encoding characters that can appear in the query and fragment portions of a URI. Here are the characters encoded by this function:
Ex: http://evisions.com?param1=%%EncodeURIComponent(:edit1)%% |
IndexOf(string, substring) | Returns the starting index (1 based) of the specified substring. Ex: IndexOf('abcde','cd'); Result = 3 |
LeftStr(string, count) | Returns the requested number of characters from the left side of a string. Ex: LeftStr('abcde',4); Result = abcd |
Length(string) | Returns the length of a string. Ex: Length('abcde'); Result = 5 |
Lower(string) | Converts a string to lower case. Ex: Lower('ABCDE'); Result = abcde |
PadLeft(string, padstring, length) | Fills the input string from the left by repeating the pad string to reach the specified length. Ex: PadLeft('abcde','xy',20); Result = xyxyxyxyxyxyxyxabcde |
PadLeftZero(string, length) | Fills the string from the left with zeroes to the specified length. Ex: PadLeftZero('abcde',10); Result = 00000abcde |
PadRight(string, padstring, length) | Fills the input string from the right by repeating the pad string to reach the specified length. Ex: PadRight('abcde','xy',20); Result = abcdexyxyxyxyxyxyxyx |
Pretty(string) | Makes the first character of the string uppercase and the rest lowercase. Ex: Pretty('abcde'); Result = Abcde |
Replace(string, search string, replace string) | Replaces all occurrences of 'Search String' in 'String' with 'Replace String'. Ex: Replace('aabbccddeeffggaa', 'aa', 'zz'); Result = zzbbccddeeffggzz |
RightStr(string, count) | Returns the requested number of characters from the right side of a string. Ex: RightStr('abcde',3); Result = cde |
StretchStr(string, count) | Stretches a string by inserting the requested number of spaces between each character. Ex: StretchStr('abcde',2); Result = a b c d e |
Strip(string, substring) | Removes all occurrences of a sub string from the string. Ex: Strip('aaabbbcccdddaaaeee','aaa'); Result = bbbcccdddeee |
SubString(string, index, count) | Returns a substring (of length="count") beginning at position "index" . Ex: SubString('abcdefghijklmnopq',3,4); Result = cdef |
ToNumber(string, default) | Converts a string into a number with an optional default value. Ex: ToNumber('22',5); Result = 22 Ex: ToNumber('abc",5); Result = 5 |
ToString(x) | Converts a number into a string. Ex: ToString(123); Result = 123 |
Trim(string) | Trims whitespace from the front and back of a string. Ex: Trim (' abccde '); Result = abcde |
TrimL(string) | Trims whitespace from the front of a string. Ex: TrimL(' abcde '); Result = abcde |
TrimR(string) | Trims whitespace from the back of a string. Ex: TrimR(' abcde '); Result = abcde |
Upper(string) | Returns string in uppercase letters. Ex: Upper ('abcde'); Result = ABCDE |
Statistical (Extract reports only)
Function | Description |
---|---|
Average(x) | Returns the average of field 'x" for all records. Ex: Average(ArgosData.field) |
Count(x) | Increments for each iteration. |
Max(x) | Returns the maximum value of field 'x" for all records. Ex: Max(ArgosData.field) |
Min(x) | Returns the minimum value of field 'x" for all records. Ex: Min(ArgosData.field) |
Sum(x) | Returns the sum of field 'x" for all records. Ex: Sum(ArgosData.field) |
1 Added in version 5.4.