---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/troubleshooting/errors/ERR-DS_API-FORMULA-PARSE-UNEXPECTED_TOKEN
  - ru/troubleshooting/errors/ERR-DS_API-FORMULA-PARSE-UNEXPECTED_TOKEN
  - href: en/troubleshooting/errors/ERR-DS_API-FORMULA-PARSE-UNEXPECTED_TOKEN.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/troubleshooting/errors/ERR-DS_API-FORMULA-PARSE-UNEXPECTED_TOKEN.html
title: DataLens On-premises error ERR.DS_API.FORMULA.PARSE.UNEXPECTED_TOKEN
description: This page describes the Formula syntax error DataLens On-premises error.
vcsPath: en/troubleshooting/errors/ERR-DS_API-FORMULA-PARSE-UNEXPECTED_TOKEN.md
---

# [DataLens On-premises] Formula syntax error

`ERR.DS_API.FORMULA.PARSE.UNEXPECTED_TOKEN`

This error occurs when a [calculated field](../../concepts/calculations/index.md) contains a formula with incorrect [syntax](../../concepts/calculations/formula-syntax.md). In the chart or dataset editing interface, such fields are highlighted in red. To fix this error, check all red marked fields and revise the formulas in them.

Here is an example:

* Invalid value list provided:

  * Incorrect formula: `[field] NOT IN {'value1', 'value2'}`.
  * Correct formula: `[field] NOT IN ('value1', 'value2')`.

* Unbalanced quotes:

  * Incorrect formula: `[field] = 'value`.
  * Correct formula: `[field] = 'value'`.

* Invalid comparison syntax:

  * Incorrect formula: `[field] == 'value'`.
  * Correct formula: `[field] = 'value'`.
