---
title: Quantities
summary: Quantity sets and quantities — quantity.Qset.Name, wildcards, the fields of a quantity, units, aggregating quantities, and quantity.meta.
order: 130
terms: [quantity-set]
see-also: [reference/bql/properties, reference/bql/unit, reference/bql/calculated-values, reference/bql/group-by]
---

# Quantities

A quantity is a measured value in a quantity set ([[term:quantity-set]]): `Qto_WallBaseQuantities.NetSideArea`, `Qto_DoorBaseQuantities.Width`, `Qto_SpaceBaseQuantities.NetFloorArea`. Quantities are addressed like properties and always carry a unit.

## quantity.Qset.Name {#quantity}

```text {#quantity-syntax}
quantity.<Qset>.<Name>
quantity.*.<Name>            // the quantity in any set
quantity.<Qset>.*            // every quantity of the set
quantity.*                   // every quantity of the object
quantity.<Qset>.<Name>.<field>
```

Names follow the same quoting rules as properties. A quantity path needs a quantity name.

```bql {#quantity-basic}
GET qid, attribute.Name, quantity.Qto_WallBaseQuantities.NetSideArea, quantity.Qto_WallBaseQuantities.NetVolume WHERE type = IFCWALL
```

```bql {#quantity-wildcard}
GET qid, quantity.*.Width, quantity.*.Height WHERE type IN (IFCDOOR, IFCWINDOW)
```

## In WHERE {#where}

Quantities are numbers: compare them with `<`, `<=`, `>`, `>=`, `=`, `!=` (with `WITHIN` tolerances), `BETWEEN` and `IN`, with unit literals on the right-hand side, or against another feature or expression.

```bql {#quantity-where}
GET qid, quantity.Qto_DoorBaseQuantities.Width UNIT mm WHERE type = IFCDOOR AND quantity.Qto_DoorBaseQuantities.Width < 0.85 m
```

```bql {#quantity-compare}
GET qid, quantity.Qto_WallBaseQuantities.NetVolume, calculated.quantity.volume
WHERE type = IFCWALL AND quantity.Qto_WallBaseQuantities.NetVolume != calculated.quantity.volume WITHIN 2 %
```

## Units {#units}

A quantity value carries the model's unit for its dimension (`unit`, with an SI `symbol`). Convert one quantity with `UNIT` ([[bql:unit]]) or every value of a dimension with `USING` ([[bql:using]]).

```bql {#quantity-unit}
GET qid, quantity.Qto_SpaceBaseQuantities.NetFloorArea UNIT m2 AS FloorArea WHERE type = IFCSPACE ORDER BY quantity.Qto_SpaceBaseQuantities.NetFloorArea DESC
```

## Aggregates {#aggregates}

Quantities are the usual argument of `SUM`, `AVG`, `MIN`, `MAX` and the other numeric aggregates ([[bql:group-by#aggregates]]).

```bql {#quantity-sum}
GET buildingStorey.attribute.Name, SUM(quantity.Qto_SpaceBaseQuantities.NetFloorArea) AS FloorArea WHERE type = IFCSPACE GROUP BY buildingStorey.attribute.Name
```

## Fields {#fields}

A quantity in the result has `name`, `quantitySetName`, `type`, `value`, `classType` (`IFCQUANTITYLENGTH`, `IFCQUANTITYAREA`, `IFCQUANTITYVOLUME`, `IFCQUANTITYCOUNT`, `IFCQUANTITYWEIGHT`, …), an optional `description`, and `unit`/`symbol`. The selectable fields are `.name`, `.description`, `.value`, `.type`, `.classType`, `.quantitySetName` and `.oid`.

## Calculated alternatives {#calculated}

When a model has no quantities, or to check the ones it has, BIM.works derives floor areas, volumes and bounding boxes from the geometry: [[bql:calculated-values]].

## quantity.meta {#meta}

`quantity.meta` lists the quantity sets and quantities an object has ([[bql:meta]]).

```bql {#quantity-meta}
GET quantity.meta, COUNT(qid) WHERE type = IFCWALL GROUP BY quantity.meta
```

## Used in {#used-in}

- [[page:tutorials/bql/properties-and-quantities]] — quantities and `UNIT`.
- [[page:tutorials/bql/grouping-and-aggregates]] — floor area per storey.
