---
title: "Token Functions in WHERE Clause"
component: "gsql-ref"
version: "4.3"
module: "ddl-and-loading"
html_url: "/gsql-ref/4.3/ddl-and-loading/functions/token_where/"
canonical_url: "https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/"
markdown_url: "https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/index.md"
---

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

# Token Functions in WHERE Clause

The token functions in this section can only be used in the `WHERE` clause of a `LOAD` statement.

> [!NOTE]
> Besides the functions in the following table, all [token functions for attribute expressions](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token/index.md) can also be used in the `WHERE` clause, including [user-defined functions](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/add-token-function.md).

| Function name | Output type | Description of function |
| --- | --- | --- |
| [to\_int( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/to_int.md) | `INT` | Converts _main\_string_ to an integer value. |
| [to\_float( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/to_float.md) | `FLOAT` | Converts _main\_string_ to a float value. |
| [concat( _string1, string2_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/concat.md) | `STRING` | Returns a string which is the concatenation of _string1_ and _string2_ . |
| [token\_len( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/token_len.md) | `INT` | Returns the length of _main\_string._ |
| [gsql\_is\_not\_empty\_string( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/gsql_is_not_empty_string.md) | `BOOL` | Returns true if _main\_string_ is not empty after removing white space. Returns false otherwise. |
| [gsql\_token\_equal( _string1, string2_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/gsql_token_equal.md) | `BOOL` | Returns true if _string1_ is exactly the same (case-sensitive) as _string2_ . Returns false otherwise. |
| [gsql\_token\_ignore\_case\_equal( _string1, string2_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/gsql_token_ignore_case_equal.md) | `BOOL` | Returns true if _string1_ is exactly the same (case-insensitive) as _string2_. Returns false otherwise. |
| [gsql\_is\_true( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/gsql_is_true.md) | `BOOL` | Returns true if _main\_string_ is either "t" or "true" (case-insensitive). Returns false otherwise. |
| [gsql\_is\_false( _main\_string_ )](https://www.tigergraph.com/docs/gsql-ref/4.3/ddl-and-loading/functions/token_where/gsql_is_false.md) | `BOOL` | Returns true if _main\_string_ is either "f" or "false" (case-insensitive). Returns false otherwise. |

## Examples

### Single token function

These functions can be used as part of expression in the `WHERE` clause. For example, the following statement only loads a record if the `score` column of a record is greater than 95.5:

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

### Token functions with logical operators

You can use logical operators such as `AND`, `OR`, `NOT`,`IN`, `IS NUMERIC`, `IS EMPTY`, and `BETWEEN …​ AND` in the `WHERE` clause with token functions.

```gsql
CREATE LOADING JOB load_token FOR GRAPH Example_Graph {
    LOAD "data/data.csv"
    TO VERTEX vertex_1 VALUES($0, $1, $2, $3, $4, $5)
    WHERE gsql_token_equal($1,"DHB09")
      OR  token_len($2) > 15
      AND gsql_substr($2, 0, 3) == “DHB”
      OR  to_int($2)  IN (1,10)
      OR  to_float($5) BETWEEN 1 AND 100.5
      AND $4 == “12”
    USING SEPARATOR=",", HEADER="true", EOL="\n";
}
```
