> For the complete documentation index, see [llms.txt](https://doc.moost.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.moost.io/platform-manual/rules/rule-language/data-structures.md).

# Data Structures

When having a look at some previous examples, it might not be directly obvious, but we are actually not always working just with single values, such as a number. We also had a look at examples which are actually working with a multi-value set, such as when calculating an *average*.&#x20;

So each literal has not only a [Data Type](/platform-manual/rules/rule-language/data-types.md), but also a [Data Structure](/platform-manual/rules/rule-language/data-structures.md). Here you see the full list:

## Scalar

A single value is stored in a *Scalar* data structure.&#x20;

Generally all [values](/platform-manual/rules/rule-language/syntax.md#values) are Scalars, but you typically also get Scalars when evaluating boolean or arithmetic operations.

### Examples

```java
99.5
```

Example with `$PowerConsumption` with dataset of name *PowerConsumption* of type Single Value:

```java
AVG($PowerConsumption)
```

## **Vector**

&#x20;A set of values is stored in a Vector data structure.

Generally only [variables](/platform-manual/rules/rule-language/syntax.md#variables), or operations and functions on top of [variables](/platform-manual/rules/rule-language/syntax.md#variables), may produce Vectors.

### Examples:

Example with `$PowerConsumption` with dataset of name *PowerConsumption* of type Time Series:

```java
SUBSET($PowerConsumption, now-24h)
```

## **GroupedScalar**

A list of single values, grouped by device or time.

Generally only [variables](/platform-manual/rules/rule-language/syntax.md#variables) in combination with a `GROUP_BY_DEVICE` or `GROUP_BY_TIME` function may produce a GroupedScalar.

### Examples

```java
AVG(GROUP_BY_DEVICE($PowerConsumption)) with Dataset of name PowerConsumption with type Time Series
```

## **GroupedVector**

A list of list of value sets, grouped by device or time.

Generally only [variables](/platform-manual/rules/rule-language/syntax.md#variables) in combination with a `GROUP_BY_DEVICE` or `GROUP_BY_TIME` function may produce a GroupedVector.

### Examples

```java
GROUP_BY_DEVICE($PowerConsumption) with Dataset of name PowerConsumption with type Time Series
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.moost.io/platform-manual/rules/rule-language/data-structures.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
