Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this example, we will pass a string value, not a real number, to the function transformation object using a Variables object.
Where,
value = -√5
In the output window, you can see that the Boolean value, False, has been returned as the specified value is not a real number, rather an irrational value.
Name
IsNotNull (Any Value)
Syntax
IsNotNull (Any Value)
Purpose
To check whether a given value is not null.
Description
Returns true if the specified parameter does NOT represent a null value. This function accepts values of all types.
Return Type
Boolean
Parameters
val [System.Object] – Expression that will be checked
Name
IsRealNumber (Any Value)
Syntax
IsRealNumber (Any value)
Purpose
To check whether a given value represents a real number.
Description
Returns true if the specified value is a real number. Otherwise returns false.
Return Type
Boolean
Parameters
Value [System.Object] – Value to be checked
We have a Customers dataset, with missing values in the Items and ShipCountry fields, which we will use for this function.
We will map these fields to value1 and value2 of the function transformation object.
Where,
value1 = Items
value2 = ShipCountry
Then, we will map the Output value field of the function transformation object and the remaining fields from our source file to an Excel Workbook Destination.
Right-click on the Excel Workbook Destination object and select Preview Output. You can see that Astera Data Stack has created a new column, and returned a value from either Items (value1), ShipCountry (value2), or null (if both specified parameters are null), in this particular order.
We have a Customers dataset which we will use to evaluate and transform the Items field.
In this example we will use the Expression object to define the condition, and a Variables object to define a real thenValue and a real elseValue.
Where,
Condition: Items = “1”
thenValue = 1.23
elseValue = 2.23
In the output, you can see that real values, 1.23 and 2.23, have been returned depending on whether the Items field condition was met.
Name
IsDate(Any Value)
Syntax
IsDate (Any value)
Purpose
To check whether a given value represents a valid date.
Description
Returns true if the given value represents a valid date time value. Otherwise returns false.
Return Type
Boolean
Parameters
Value [System.Object] – Value to be checked
Name
Coalesce
Syntax
Coalesce (Any value1, Any value2)
Purpose
To return first non-null value in order of the parameters specified.
Description
Returns the first non-null value from specified parameters. Returns null if both parameters are null.
Return Type
Object
Parameters
value1 [System.Object] – First expression
value2 [System.Object] – Second expression
Name | If (Double) |
Syntax | If (Boolean condition, Real thenValue, Real elseValue) |
Purpose | To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue. |
Description | Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition. |
Return Type | Double |
Parameters | Condition [System.Boolean] – Condition that is evaluated thenValue [System.Double] – This Parameter’s value is returned if the result of ‘condition’ parameter is true. elseValue [System.Double] - This Parameter’s value is returned if the result of ‘condition’ parameter is false. |
In this example, we will pass various SQL DateTime values to the function transformation object using a Variables object, along with the Normalize object so that different values can be passed to the function transformation object at once.
Where,
date1 = 1 January, 2003
date2 = January, 2003
date3 = 1/2/1991
date4 = 1991/2/4
date5 = 0000/00/00
Note: Valid SQL server DateTime range is “January 1, 1753” – “December 31, 9999”
In the output window, you can see that the Boolean value, True, has been returned for values that are present in the valid SQL server DateTime range, and the value, False, has been returned otherwise.
Name
IsValidSQLDate
Syntax
IsValidSqlDate (Date date)
Purpose
To check if a date time value is a valid SQL Date time value.
Description
Returns true if the specified date time value is within the range of a valid SQL Server date. Otherwise returns false.
Return Type
Boolean
Parameters
date [System.DateTime] – DateTime value to be checked
Example
In this example, we will pass a valid format parameter and a string date parameter to match the given format, to the function transformation object using a Variables object.
Where,
format = yyyy-MM-dd
str = 2023-09-23
In the output, you can see that the Boolean value, True, has been returned. This means the provided value represents a valid date which matches the provided date format.
We have a Customers dataset which we will use to evaluate and transform the ShipDate field.
In this example we will use the Expression object to define the condition, and a Variables object to define thenValue and elseValue.
Where,
Condition: ShipDate = “1”
thenValue = 1/2/2022
elseValue = 5/7/2023
In the output, you can see that DateTime values, 1/2/2022 and 5/7/2023, have been returned depending on whether the ShipDate field condition was met.
We have a Customers dataset which we will use to evaluate whether the Country field consists of the value “Germany”.
We will use the Expression object to give this condition, and a Variables object to define thenValue and elseValue.
Where,
Condition: Country = “Germany”
thenValue = True
elseValue = False
In the output, you can see that Boolean values, True and false, have been returned depending on whether the Country field condition was met.
In this example, we are passing the required parameters to the function transformation object using a Variables object.
Where,
LookFor = C
LookIn = A,B,C,D,E,F,G
Right-click on the function transformation object and select Preview Output. You can see that Astera Data Stack has returned the Boolean value, True, indicating that the LookFor value exists in the comma separated LookIn string.
Conversely, if we replace the lookFor value with “3”, you can see that Astera Data Stack has returned the Boolean value, False.
Example
We have a Customers dataset which we will use to evaluate and transform the Items field.
In this example we will use the Expression object to define the condition, and a Variables object to define thenValue and elseValue.
Where,
Condition: Items = “1”
thenValue = 100
elseValue = 200
In the output, you can see that Integer values, 100 and 200, have been returned depending on whether the Items field condition was met.
Name
IsDate (String)
Syntax
IsDate (String str, String format)
Purpose
To check whether a given value represents valid date in the given format.
Description
Returns true if the given value represents a valid date in the given format. Otherwise returns false.
Return Type
Boolean
Parameters
Str [System.String] – Value to be Checked
Format [System.string] – Format for parsing the string. Any valid .Net date format
Name
If (DateTime)
Syntax
If (Boolean condition, DateTime thenValue, DateTime elseValue)
Purpose
To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue.
Description
Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition.
Return Type
DateTime
Parameters
Condition [System.Boolean]
thenValue [System.DateTime] – This Parameter’s value is returned if the result of ‘condition’ parameter is true.
elseValue [System.DateTime] - This Parameter’s value is returned if the result of ‘condition’ parameter is false.
Name
If (Boolean)
Syntax
If (Boolean condition, Boolean thenValue, Boolean elseValue)
Purpose
To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue.
Description
Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition.
Return Type
Boolean
Parameters
Condition [System.Boolean]
thenValue [System.Boolean] – This Parameter’s value is returned if the result of ‘condition’ parameter is true.
elseValue [System.Boolean] - This Parameter’s value is returned if the result of ‘condition’ parameter is false.
Name
Exists
Syntax
Exists (String lookFor, String lookIn)
Purpose
To check whether a string exists within a comma separated string.
Description
Returns true if value 1 exists in value2, where value 2 is a comma separated list. Otherwise returns false.
Return Type
Boolean
Parameters
lookFor [System.String] – String to look for
lookIn [System.String] – A comma separated list of items that should be searched
Name
If (Int64)
Syntax
If (Boolean condition, Integer thenValue, Integer elseValue)
Purpose
To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue.
Description
Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition.
Return Type
Int64
Parameters
Condition [System.Boolean] – Condition that is evaluated
thenValue [System.Int64] – This Parameter’s value is returned if the result of ‘condition’ parameter is true.
elseValue [System.Int64] - This Parameter’s value is returned if the result of ‘condition’ parameter is false.
Example
We have a Customers dataset which we will use to evaluate and transform the Items field.
In this example we will use the Expression object to define the condition, and a Variables object to define a string thenValue and a string elseValue.
Where,
Condition: Items = “1”
thenValue = FirstItem
elseValue = SecondItem
In the output, you can see that string values, FirstItem and SecondItem, have been returned depending on whether the Items field condition was met.
Example
In this example, we will pass a numeric, real value to the function transformation object using a Variables object.
Where,
value = 3.123456789
In the output window, you can see that the Boolean value, True, has been returned as the specified value is numeric.
Similarly, the Boolean value, False, will be returned if the specified value is not numeric, as shown in the example below:
Name
If (String)
Syntax
If (Boolean condition, String thenValue, String elseValue)
Purpose
To evaluate a given condition and if true, return result of thenValue. Otherwise, to return the result of elseValue.
Description
Returns the value of ‘Then’ expression or ‘Else’ expression depending on the value of condition.
Return Type
String
Parameters
Condition [System.Boolean] – Condition that is evaluated
thenValue [System.String] – This Parameter’s value is returned if the result of ‘condition’ parameter is true.
elseValue [System.String] - This Parameter’s value is returned if the result of ‘condition’ parameter is false.
Name | Is Numeric (Any Value) |
Syntax | IsNumeric (Any value) |
Purpose | To check whether a given value represents an integer or a real number. |
Description | Returns true if the specified value is numeric. Otherwise returns false. |
Return Type | Boolean |
Parameters | Value [System.Object] – Value to be checked |
Example
In this example, we will pass a null value to the function transformation object using a Variables object.
In the output, you can see that the Boolean value, True, has been returned as the passed value was empty or null.
Example
In this example, we will first pass an integer value and then a non-integer value to the function transformation object using a Variables object, to see the different outputs
Where first,
value = 12345678
then,
value = ABCDEFG
In the output windows, you can see that Boolean values, True and False, have been returned, depending on whether the provided value was an integer or a non-integer value.
Name
IsNullOrEmpty (String)
Syntax
IsNullOrEmpty (String val)
Purpose
To determine whether a string is null or if its length is zero.
Description
Returns true if the specified parameter contains a null value or if string length is zero.
Return Type
Boolean
Parameters
val [System.String] – Expression that will be evaluated
Name | IsInteger (Any Value) |
Syntax | IsInteger (Any value) |
Purpose | To check whether a given value represents an integer. |
Description | Returns true if the specified value is an integer. Otherwise returns false. |
Return Type | Boolean |
Parameters | Value [System.Object] – Value to be checked |
Example
In this example, we will pass a NOT null value to the function transformation object using a Variables object.
Where,
val = ABCDEFG
In the output, you can see that the Boolean value, False, has been returned. This means the provided value is NOT null. There is data present in the Input field.
Name
Is Null (Any Value)
Syntax
IsNull (Any Value)
Purpose
To check whether a given value is null.
Description
Returns true if the specified parameter represents a null value. This function accepts values of all types.
Return Type
Boolean
Parameters
val [System.Object] – Expression that will be checked
Example
In this example, we will pass a whitespace value to the function transformation object using a Variables object.
In the output, you can see that the Boolean value, True, has been returned as the passed value consisted of whitespaces. If the same variable was passed through the IsNullOrEmpty function, The output would be false.
Name
IsNullOrWhitespace (String)
Syntax
IsNullOrWhitespace (String val)
Purpose
To determine whether a string is null, if its length is zero, or if it contains only white space characters.
Description
Returns true if the specified string contains null value, if string length is zero, or if a string contains only white space characters.
Note: White space characters are space, tab, return, and linefeed.
Return Type
Boolean
Parameters
val [System.String] – Expression that will be evaluated