# Granular Library (PQL)

## Function Categories

These functions are used to set or change the aggregation logic for a measure column from the model |

## Overview

Granular or aggregate functions are a set of methods that are designed to operate on the **GRAIN** of the data feeding a data model. They are often also described as AGGREGATE functions, because they are about producing values from a table of data transactions by aggregating atomic results.

**Granular aggregations and querying are usually done with languages like SQL.**

As described in the PQL Calculation Overview, granular functions are part of a broad set of methods and capabilities for infusing your analytics with mathematical operations and logic. They can be used in conjunction with the Common function library to build deep, sophisticated methods to resolve data manipulation problems.

### Syntax

Click here to see more details on the syntax needed to build PQL statements .

## Adding Granular Calculations

There are 3 techniques for adding granular calculations in Pyramid:

1. Via the Data Model app, the calculation can be set as follows

2. Via the Discover app, the calculation can be built using the short-cut menus as follows:

3. Via the Formula tools in Formulate. The calculation can be added using the graphical formula builder, or directly via the script editor tool: