---
title: "to_int()"
component: "gsql-ref"
version: "4.2"
module: "ddl-and-loading"
html_url: "/gsql-ref/4.2/ddl-and-loading/functions/token_where/to_int"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/4.2/ddl-and-loading/functions/token_where/to_int"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/4.2/ddl-and-loading/functions/token_where/to_int.md"
---

[View as HTML](https://www.tigergraph.com/docs/gsql-ref/4.2/ddl-and-loading/functions/token_where/to_int)

# to_int()

Converts the string token to an integer. This is a token function for the `WHERE` clause of a `LOAD` statement only. It cannot be used in a destination clause.

This function is necessary when you need to filter integer values during loading, as all tokens are treated as strings.

## Syntax

`to_int( token )`

## Return value

`INT`. The integer converted from the input token.

## Example

If we have the following data in a CSV file of the different scores of test takers, and we want to load a record if their score is higher than 95:

| name | score |
| --- | --- |
| Tommy | 95 |
| Amy | 99 |
| Amy | 93 |

```gsql
LOAD f TO VERTEX Person
  VALUES ($"name", $"score")
  WHERE to_int($"score") > 95
```

After loading, only the second row in the provided data is loaded, as it is the only record where the score is greater than 95.
