Functions

The following functions are also supported:

CONVERT: Converts particular expression to a specified .NET Framework Type.

Convert(expression, type) 

where:

expression – The expression to convert.

type – .NET type to which the value will be converted.

Example:
myDataColumn.Expression="Convert(total, 'System.Int32')" 

All conversions are valid with the following exceptions: Boolean can be coerced to and from Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, UInt64, String and itself only. Char can be coerced to and from Int32, UInt32, String, and itself only. DateTime can be coerced to and from String and itself only. TimeSpan can be coerced to and from String and itself only.

LEN: Gets the length of a string.

LEN(expression) 

where: expression – The string to be evaluated.

Example:
myDataColumn.Expression="Len(ItemName)" 

ISNULL: Checks an expression and either returns the checked expression or a replacement value.

ISNULL(expression, replacementvalue) 

where:

expression – The expression to check.

replacementvalue – If expression is null, replacementvalue is returned.

Example:
myDataColumn.Expression="IsNull(price, -1)" 

IIF: Gets one of two values depending on the result of a logical expression.

IIF(expr, truepart, falsepart) 

where:

expr – The expression to evaluate.

truepart – The value to return if the expression is true.

falsepart – The value to return if the expression is false.

Example:
myDataColumn.Expression = "IIF(total>1000, 'expensive', 'dear') 

TRIM: Removes all leading and trailing blank characters like \r, \n, \t, ' '

TRIM(expression) 

where: expression – The expression to trim.

SUBSTRING: Gets a sub-string of a specified length, starting at a specified point in the string.

SUBSTRING(expression, start, length) 

where:

expression – The source string for the substring.

start – Integer that specifies where the substring starts.

length – Integer that specifies the length of the substring.

Example:
myDataColumn.Expression = "SUBSTRING(phone, 7, 8)" 

Note:    You can reset the Expression property by assigning it a null value or empty string. If a default value is set on the expression column, all previously filled rows are assigned the default value after the Expression property is reset.



Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.