> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Functions

> Overview of built-in and Narrative-specific functions in NQL

NQL includes standard SQL functions plus Narrative-specific functions for data collaboration. Functions are organized by category.

<CardGroup cols={2}>
  <Card title="String Functions" icon="font" href="/nql/functions/string-functions">
    Text manipulation: UPPER, LOWER, CONCAT, SUBSTRING, TRIM, and more
  </Card>

  <Card title="Date & Time Functions" icon="clock" href="/nql/functions/date-time-functions">
    Temporal operations: DATE\_TRUNC, DATE\_ADD, FORMAT\_TIMESTAMP, and more
  </Card>

  <Card title="Numeric Functions" icon="hashtag" href="/nql/functions/numeric-functions">
    Math operations: ROUND, ABS, CEIL, FLOOR, SQRT, and more
  </Card>

  <Card title="Aggregate Functions" icon="chart-bar" href="/nql/functions/aggregate-functions">
    GROUP BY computations: COUNT, SUM, AVG, MIN, MAX, and more
  </Card>

  <Card title="Array & Map Functions" icon="brackets-curly" href="/nql/functions/array-map-functions">
    Collection operations: FILTER, TRANSFORM, SIZE, ELEMENT\_AT, and more
  </Card>

  <Card title="Window Functions" icon="window" href="/nql/functions/window-functions">
    Ranking and analytics: ROW\_NUMBER, RANK, LAG, LEAD, and more
  </Card>

  <Card title="Geospatial Functions" icon="map-location-dot" href="/nql/functions/geospatial-functions">
    Geographic calculations: ST\_GeoHash, ST\_Distance, and more
  </Card>

  <Card title="Narrative Functions" icon="gear" href="/nql/functions/narrative-functions">
    Platform-specific: DELTA, budget functions, and more
  </Card>

  <Card title="AI & ML Functions" icon="brain" href="/nql/functions/ai-functions">
    LLM inference and custom models: AI\_COMPLETE, CALL\_MODEL\_FUNCTION
  </Card>

  <Card title="Conditional Functions" icon="code-branch" href="/nql/functions/conditional-functions">
    Conditional logic: IF, COALESCE, NULLIF, CASE
  </Card>
</CardGroup>

## Related content

<CardGroup cols={2}>
  <Card title="Data Types" icon="shapes" href="/nql/data-types">
    Types accepted and returned by functions
  </Card>

  <Card title="Operators" icon="calculator" href="/nql/operators">
    Comparison, logical, and arithmetic operators
  </Card>

  <Card title="Common Query Patterns" icon="book" href="/cookbooks/nql/common-queries">
    Real-world examples using these functions
  </Card>
</CardGroup>
