Description:
This function returns the character specified by a number. Use CHAR to translate code page numbers you might get from files on other types of computers into characters.
Syntax: CHAR (Number)
Remarks
Example
The CHAR function can be used in any database where you have stored values for a number you want to return the corresponding characters for those numbers and return these values to another member. In this case it's possible to access this value with the help of this function.
This function displays the number as a character after the function computes the parameter supplied to this function and determines which character corresponds with the given specified number.
=CHAR (65) |
-equals "A" |
=CHAR (33) |
-equals "!" |
=CHAR (122) |
-equals "z" |
Let us take the example of a database in PowerOLAP where we have certain text values for name, last name, city, country etc., and we need to manipulate these text values and arrive at results with different permutations and combinations. We shall use this example in this case to ascertain the character value based on the information provided by the "Serial Number" parameter that is supplied to the function. In this case, we have written a formula in the appropriate cube in PowerOLAP, pulling in the value from the "Serial Number" field and then writing that value to this formula in order to calculate the result of the "CHAR' function. The formula then calculates the "Char" element as a character that corresponds to the numbers supplied as the parameter and which are translated using the ASCII standard.
The formula above writes values into the "StringDataFunctions" cube to the "String Data Manipulations" dimension into the member named "Char" by calculating the appropriate value for this member, deriving the base from the "Serial Number" member in the "String Values" dimension which forms the parameter supplied to this function and its for this parameter that the corresponding character value is returned.