---
schema_version: "1"
id: 0913479c3a8e55ef08842454826bd11282e7046ebe5380dd58dfb7b60ac1d828
title: ceil(n)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-functions-math-ceil.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-ceil.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2d53f2abdd81911096ce556c2387a6f4ae384626e981a9f073836496ac011007
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# ceil(n)

Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1e308 \<= n \<= 1e308. This function can only be used in a `foreach` statement.

## Example

```nolang
q = foreach q generate ceil(miles) as distance;
```
