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

# Cumulative Probability (cumulative_probability)

[localhost link]: http://localhost:3000/docs/4/fusion-server/reference/fusion-sql/cumulative_probability

[mintlify link]: https://doc.lucidworks.com/docs/4/fusion-server/reference/fusion-sql/cumulative_probability.md

[old doc.lw link]: https://doc.lucidworks.com/fusion-server/4.2/3271.md

The `cumulative_probability` function calculates the probability that a value drawn from a numeric field will be less then or equal to a specific value. The `cumulative_probability` function takes three parameters:

1. The numeric field to compute the cumulative probability from
2. The specific numeric value to compute the cumulative probability for
3. The sample size

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Sample syntax

```sql wrap  theme={"dark"}
select cumulative_probability(sepal_length_d, 7.7, 150) as cumulative_prob
     from iris
```

## Result set

The result set for the `cumulative_probability` function contains a single record with the calculated cumulative probability. The `cumulative_probability` function returns the cumulative probability calculation.

Sample result set in Apache Zeppelin

![Sample result](https://mintcdn.com/lucidworks/iN-DD0xMOO3PKUmX/assets/images/5.2/udf/cumulative_probability1.png?fit=max\&auto=format\&n=iN-DD0xMOO3PKUmX\&q=85\&s=f13663508d1086457a47ba6347461a83)

## Visualization

Sample visualization of the `cumulative_probability` function using the Apache Zeppelin number visualization:

![Sample result](https://mintcdn.com/lucidworks/iN-DD0xMOO3PKUmX/assets/images/5.2/udf/cumulative_probability2.png?fit=max\&auto=format\&n=iN-DD0xMOO3PKUmX\&q=85\&s=7938d23d6fa8da2c4b733ae607a6cfe2)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.