Uma função de teste realiza comparações de dados. Use uma função de teste para identificar o tipo de dados de um valor ou determinar se um valor existe. Você pode usar funções de teste com todos os Tipos de dados compatíveis .
Nota
Not all functions are supported between Standard mode and Cloud Native mode tools. For a list of supported functions, go to the respective Standard mode and Could Native mode function lists found on the Formula tool page.
CompareDictionary(a,b)
: Compares 2 strings ignoring case differences, and compares text that appears to consist of numbers, in numerical order. The function returns -1 if a < b, 0 if a==b, and 1 if a > b.
This function is not exactly in the same order as a dictionary compare, in that it does not handle diacritical marks the same way the Sort tool does when configured to do a dictionary sort using the conventions of a particular language.
CompareDictionary("apples","bananas")
returns -1.
CompareDictionary("APPLES","bananas")
returns -1.
CompareDictionary("apples","BANANAS")
returns -1.
CompareDictionary("Cherries","Bananas")
returns 1.
CompareDictionary("Bananas","bananas")
returns 0.
CompareDictionary("2","10")
returns -1 (2 is less than 10, even though the character '2' is greater than the character '1').
CompareDictionary("minus -2","minus -10")
returns 1 (-2 is greater than -10. Minus signs are only recognized at the beginning or after white space).
CompareDictionary("minus-2","minus-10")
returns -1 (2 is less than 10. The minus sign, not being after a space, was not counted as part of the number).
CompareDictionary("pi 3.14","pi 6.28e-1")
returns 1 (Yes, it recognizes floating-point number syntax, and 3.14 is greater than 0.628).
CompareDictionary("12.00","12.0")
returns 1 (When numbers have the same value, the longer string of digits is considered greater).
CompareDictionary("a", "À")
returns -1.
CompareDictionary("n","ñ")
returns -1 (letters with marks are larger in the Latin alphabet than all the unmarked letters).
CompareDictionary("o","ñ")
returns -1 (In a Spanish Dictionary compare the Ñ should be less than O. This is not a linguistic dictionary comparison).
CompareDictionary("ñ","Ñ")
returns 0 (marked characters compare ignoring case, too).
CompareDigits(a, b, nNumDigits)
: Compares 2 numbers and determines if they are the same to the given number of digits (nNumDigits).
The comparison finds the difference between the numbers and reports A and B the same when the leading digit of the difference is nNumDigits or more places to the right of the digits of the larger of A and B.
The nNumDigits
parameter must not be null and must be between 1 and 19. Otherwise, an error occurs. If a non-integer is given, it's rounded to the nearest integer (nNumDigits
can be between 0.5 and 19.499).
CompareDigits(12345, 12444, 3)
returns "True" (because the difference is 99, and its leading digit is 3 places to the right of the leading digit of A).
CompareDigits(12345, 12445, 3)
returns "False" (because the difference is 100, and its leading digit is only 2 places to the right of the leading digit of A).
CompareDigits(12.345, 12.347, 3)
returns "True" (because the difference is 0.002, and its leading digit is 4 places to the right of the leading digit of A).
CompareDigits(12.345, 12.435, 3)
returns "True" (because the difference is 0.09, and its leading digit is 3 places to the right of the leading digit of A).
CompareDigits( .91234, .91334, 3)
returns "False" (because the difference is .001, and its leading digit is only 2 places to the right of the leading digit of A).
CompareEpsilon(a, b, epsilon)
: Compares 2 floating-point numbers and returns True if they are within epsilon.
CompareEpsilon(123.456789101112, 123.456789101114, 0.0001)
returns "True."
CompareEpsilon(123.456, 123.456789101112, 0.0001)
returns "False."
EqualStrings(a,b)
: Compares string (a) to string (b) to determine if they are an exact match. The function returns True if all characters in both a and b are identical and False if 1 or more characters are not identical.
Note that this function is case-sensitive.
EqualStrings('Hello','Hello')
returns True.
EqualStrings('Hello','hello')
returns False.
EqualStrings('happy birthday','happy birthday')
returns True.
EqualStrings('happy birthday','happy birthday')
returns False.
EqualStrings('Happy 10th birthday!', 'Happy 10th birthday')
returns False.
EqualStrings('Hello','')
returns False.
EqualStrings('Hello', Null)
returns False.
EqualStrings(Null(), Null())
returns True.
EqualStrings('Hello')
returns an error. The function requires exactly 2 parameters.
IsEmpty(v)
: testa se v é nulo (NULL) ou igual a "".
Nome (v) | IsEmpty |
---|---|
John | Falso |
Verdadeiro | |
Mary | Falso |
[Null] | Verdadeiro |
IsInteger(v)
: testa se v contém um valor que pode ser convertido em um número inteiro. Caso afirmativo, retorna verdadeiro.
Valor (v) | IsInteger |
---|---|
1 | Verdadeiro |
1.23 | Falso |
B | Falso |
IsLowerCase(String)
: Returns True if all (1 or more) alphabetic characters in a string are lowercase and False if 1 or more alphabetic characters are uppercase. The function ignores non-alphabetic characters. Note that this function only applies to characters with a case distinction and might not apply to characters in all languages.
This function works with string data types only.
This function returns True only if there is at least 1 lowercase character and no uppercase characters.
This function returns True only for characters that have a case distinction. It might not be applicable to characters in all languages (for example, Japanese).
If you pass in numeric data as a string, the function returns False because, in this case, there are no alphabetic characters to evaluate. The string must contain at least 1 alphabetic character for the function to evaluate it as lowercase.
This function ignores spaces as they are non-alphabetic characters. If the expression contains only spaces, it evaluates as False because spaces don't have a case distinction.
If you pass in a Null value, the function returns False.
IsLowerCase('nicole')
returns True.
IsLowerCase('happy birthday!')
returns True.
IsLowerCase('niCOLE')
returns False.
IsLowerCase('2023')
returns False. The function ignores non-alphabetic characters, so it evaluates this value as an empty field, for example: ('').
IsLowerCase(nicole)
returns an error.
IsLowerCase(2023)
returns an error.
IsLowerCase(null)
returns False.
IsLowerCase(' ')
returns False. Spaces don't have a case distinction.
IsNull(v)
: testa se v é nulo. Retorna verdadeiro se v for nulo; caso contrário, retorna falso.
Para preencher uma linha com um valor NULO, use a função
NULL()
.
Nome (v) | IsNull |
---|---|
John | Falso |
[Null] | Verdadeiro |
Mary | Falso |
IsNumber(v)
: testa se o tipo de campo para v é numérico ou não.
IsString(v)
: testa se o tipo de campo para v é de cadeia de caracteres ou não.
IsUpperCase(String)
: Returns True if all (1 or more) alphabetic characters in a string are uppercase and False if 1 or more alphabetic characters are lowercase. The function ignores non-alphabetic characters. Note that this function only applies to characters with a case distinction and might not apply to characters in all languages.
This function works with string data types only.
This function returns True only if there is at least 1 uppercase character and no lowercase characters.
This function returns True only for characters that have a case distinction. It might not be applicable to characters in all languages (for example, Japanese).
If you pass in numeric data as a string, the function returns False because, in this case, there are no alphabetic characters to evaluate. The string must contain at least 1 alphabetic character for the function to evaluate it as uppercase.
This function ignores spaces as they are non-alphabetic characters. If the expression contains only spaces, it evaluates as False because spaces don't have a case distinction.
If you pass in a Null value, the function returns False.
IsUpperCase('NICOLE')
returns True.
IsUpperCase('HAPPY BIRTHDAY!')
returns True.
IsUpperCase('NicOLE')
returns False.
IsUpperCase('2023')
returns False. The function ignores non-alphabetic characters, so it evaluates this value as an empty field, for example: ('').
IsUpperCase(NICOLE)
returns an error.
IsUpperCase(2023)
returns an error.
IsUpperCase(null)
returns False.
IsUpperCase(' ')
returns False. Spaces don't have a case distinction.