---
title: "e-conomic Chart of Accounts"
description: "Every account in the chart with its type, the chart's own section heading, the P&L section Gatlas suggests for P&L accounts and the current balance."
url: https://www.gatlas.ai/docs/datasets/catalog/economic/chart-of-accounts
markdown_url: https://www.gatlas.ai/docs/datasets/catalog/economic/chart-of-accounts.md
---

# e-conomic Chart of Accounts

Every account in the chart with its type, the chart's own section heading, the P&L section Gatlas suggests for P&L accounts and the current balance.

Template id: economic/chart-of-accounts. Added for a company when it connects e-conomic. The dataset is named "{Company} Chart of Accounts".

## Questions it answers
- Which accounts does the company post to, and under which heading?
- What is the balance on each account this year?

## Columns
- connection_label: The e-conomic agreement the row comes from; a company can hold several.
- account_number: Account number in the chart.
- account_name: Account name.
- account_type: heading, headingStart, profitAndLoss, status, totalFrom or sumInterval.
- debit_credit: The account's normal side: debit or credit.
- chart_section: Name of the nearest heading account at or above this account in the company's chart.
- section: Classifier guess for P&L accounts (null on others). A guess, not the company's own grouping.
- vat_code: Default VAT code on the account, if any.
- block_direct_entries: True when e-conomic blocks direct postings to the account.
- balance: Current accounting year balance in base currency, as e-conomic reports it.
- data_as_of: When this row was last synced.

## AI context

__ENTITY__'s chart of accounts from e-conomic, one row per account and agreement (connection_label).
account_type: heading and headingStart are section titles, profitAndLoss and status (balance sheet) carry postings, totalFrom and sumInterval are subtotal lines.
chart_section is the nearest heading at or above the account in the company's own chart; it works on any chart.
section is a GUESS from the shared classifier, on P&L accounts only; prefer chart_section when they disagree.
balance is the current accounting year's balance as e-conomic reports it. Posted movements are in the Ledger and Monthly Trial Balance datasets.

## SQL

__SCHEMA__ stands for the company's schema (schema_name in list_companies), and __ENTITY__ for its name.

```sql
SELECT
  a."_gatlas_connection_label" AS connection_label,
  a."accountNumber" AS account_number,
  a."name" AS account_name,
  a."accountType" AS account_type,
  a."debitCredit" AS debit_credit,
  (SELECT h."name"
     FROM __SCHEMA__.economic_accounts h
    WHERE COALESCE(h."_gatlas_connection_label", '') = COALESCE(a."_gatlas_connection_label", '')
      AND h."accountType" IN ('heading', 'headingStart')
      AND h."accountNumber" <= a."accountNumber"
    ORDER BY h."accountNumber" DESC
    LIMIT 1) AS chart_section,
  CASE WHEN a."accountType" = 'profitAndLoss'
       THEN public.gatlas_classify_account(a."accountNumber", a."name", a."debitCredit")
  END AS section,
  NULLIF(a."vatAccount"::text, '')::jsonb ->> 'vatCode' AS vat_code,
  a."blockDirectEntries" AS block_direct_entries,
  a."balance" AS balance,
  a."_gatlas_synced_at" AS data_as_of
FROM __SCHEMA__.economic_accounts a
ORDER BY 1, 2
```

Link: https://www.gatlas.ai/docs/datasets/catalog/economic/chart-of-accounts.md
