String functions
This section describes functions for handling and manipulating strings.
All functions can be used in both the data load script and in chart expressions, except for Evaluate which can only be used in the data load script.
Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.
Capitalize() returns the string with all words in initial uppercase letters. Capitalize() function converts the first character of each word in a text string to uppercase and converts all other characters to lowercase.
Capitalize(text)
Chr() returns the Unicode character corresponding to the input integer, also known as a code point.
Chr(int)
Evaluate() finds if the input text string can be evaluated as a valid Qlik Sense expression, and if so, returns the value of the expression as a string. If the input string is not a valid expression, NULL is returned.
Evaluate(expression_text)
FindOneOf() searches a string to find the position of the occurrence of any character from a set of provided characters. The position of the Nth occurrence of any character from the search set is returned where N is the optional third parameter of the function. If no third parameter is supplied, the first occurrence is returned. If no match is found, 0 is returned.
FindOneOf(text, char_set[, count])
Hash128() returns a 128-bit hash of the combined input expression values. The result is a 22-character string.Hash128() returns a 128-bit hash value of the combined input expression values. The result is a 22-character string.
Hash128(expr{, expression})
Hash160() returns a 160-bit hash of the combined input expression values. The result is a 27-character string. Hash160() returns a 160-bit hash value of the combined input expression values. The result is a 27-character string.
Hash160(expr{, expression})
Hash256() returns a 256-bit hash of the combined input expression values. The result is a 43-character string. Hash256() returns a 256-bit hash value of the combined input expression values. The result is a 43-character string.
Hash256(expr{, expression})
Index() searches a string to find the starting position of the nth occurrence of a provided substring. An optional third argument provides the value of n, which is 1 if omitted. A negative value searches from the end of the string. The positions in the string are numbered left to right from 1 and up.
Index (text, substring[, count])
IsJson() tests whether a specified string contains valid JSON (JavaScript Object Notation) data. You can also validate a specific JSON data type.
IsJson(json [, type])
JsonGet() returns the path of a JSON (JavaScript Object Notation) data string. The data must be valid JSON but can contain extra spaces or newlines.
JsonGet(json, path)
JsonSet() modifies a string containing JSON (JavaScript Object Notation) data. It can set or insert a JSON value with the new location specified by the path. The data must be valid JSON but can contain extra spaces or newlines.
JsonSet(json, path, value)
KeepChar() returns a string consisting of any of the characters in the first string that match the characters in the second string. This function is case-sensitive.
KeepChar(text, keep_chars)
Left() returns a string consisting of the first (leftmost) characters of the input string, where the number of characters is determined by the second argument.
Left(text, count)
Len() returns the length of the input string.
Len(text)
LevenshteinDist() returns the Levenshtein distance between two strings. It is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. The function is useful for fuzzy string comparisons.
LevenshteinDist(text1, text2)
Lower() converts all the characters in the input string to lower case.
Lower(text)
LTrim() returns the input string trimmed of any leading spaces.
LTrim(text)
Mid() returns the part of the input string starting at the position of the character defined by the second argument, 'start', and returning the number of characters defined by the third argument, 'count'. If 'count' is omitted, the rest of the input string is returned. The first character in the input string is numbered 1.
Mid(text, start[, count])
Ord() returns the numeric (ASCII or Unicode) value of the first character of a string. This function is useful to evaluate or compare strings based on their underlying character codes, for example, when sorting or filtering strings with non-standard characters.
Ord(text)
PurgeChar() returns a string consisting of the characters contained in the input string ('text'), excluding any that appear in the second argument ('remove_chars').
PurgeChar(text, remove_chars)
Repeat() forms a string consisting of the input string repeated the number of times defined by the second argument.
Repeat(text[, repeat_count])
Replace() returns a string after replacing all occurrences of a given substring within the input string with another substring. The function is non-recursive and works from left to right.
Replace(text, from_str, to_str)
Right() returns a string consisting of the last (rightmost) characters of the input string, where the number of characters is determined by the second argument.
Right(text, count)
RTrim() returns the input string trimmed of any trailing spaces.
RTrim(text)
SubField() is used to extract substring components from a parent string field, where the original record fields consist of two or more parts separated by a delimiter.
SubField(text, delimiter[, field_no ])
SubStringCount() returns the number of occurrences of the specified substring in the input string text. If there is no match, 0 is returned.
SubStringCount(text, substring)
TextBetween() returns the text in the input string that occurs between the characters specified as delimiters.
TextBetween(text, delimiter1, delimiter2[, n])
Trim() returns the input string trimmed of any leading and trailing spaces.
Trim(text)
Upper() converts all the characters in the input string to upper case for all text characters in the expression. Numbers and symbols are ignored.
Upper(text)