# Ord - script and chart function

Ord() returns the Unicode code point number of the first character of the input string.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.

Syntax:

Ord(text)

Return data type: integer

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions/Ord.htm)

#### Examples and results:

Example: Chart expression

| Example | Result |
| --- | --- |
| `Ord('A')` | Returns the integer 65. |
| `Ord('Ab')` | Returns the integer 65. |

Example: Load script

```
//Guqin (Chinese: 古琴) – 7-stringed zithers
T2:
Load *, 
ord(Chinese) as OrdUnicode,                  
ord(Western) as OrdASCII;                    
Load * inline [
Chinese, Western
古琴, Guqin ]; 
 
```

Result:

| Chinese | Western | OrdASCII | OrdUnicode |
| --- | --- | --- | --- |
| 古琴 | Guqin | 71 | 21476 |