# Creating Expression Maps

{% embed url="<https://youtu.be/Xn1OyQRyT3w>" %}

Expression map defines an expression transforming the incoming value (or values) according to some logic, called expression. For example, you may use expressions like the following to get the expression result based on the input data:

Input.Amortization + 120

AddDays(Input.AccountFundingDate, 30)

Floor(Input.NoteRate)

If (Input.IsFunded = “True”, 1, 0)

Month(Input.DueDate)

Some expressions do not depend on any user-provided input data, for example Now().

All expressions return an output value of an appropriate data type. The output value is available under the Output node on the object box.

To add an Expression map, drag the *Expression* object from the *Maps* group in the Flow toolbox and drop it on the dataflow.

An example of what an *Expression Map* object might look like is shown below:

![](https://3768133094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4WCHHphSt0ALtMJlqot%2Fuploads%2Fw8Ljg3OWYDyEVnPQdjLp%2F0.jpeg?alt=media)

To configure the properties of an *Expression* object after it was added to the dataflow, right-click on it and select *Properties* from the context menu. The following properties are available:

* *Meta Object Builder screen:* Meta Object Builder screen allows you to add or remove fields in the field layout, as well as select their data type. The fields added in Meta Object Builder will show in the Input node of the Expression object. The Input node can be connected to upstream dataflow objects in order to supply the field values used by the expression.
* *Expression Map Properties* screen provides the interface to help you create your expression.
* *General Options screen:* This screen shares the options common to most objects on the dataflow.

## **Aggregates**

Aggregate functions are available in many places throughout Astera, including *Expression Maps, Data Quality Rules* and *Record Filter Expressions*. Using aggregate functions, for instance, you can calculate the maximum loan amount among all records in a given collection.

To make sure your aggregate functions are properly formed, you need to specify paths relative to the collection (as opposed to root based paths). For instance, if you have a structure like this:

*Customer(Id, Name)*

​ *SalesOrder(OrderId, Amount)*

​ *OrderDetail(Quantity, Price, Total)*

your aggregate functions would look like this:

Customer.SalesOrder.Sum(Amount)

Customer.SalesOrder.OrderDetail(Quantity), and not Customer.SalesOrder.OrderDetail(Customer.SalesOrder.OrderDetail.Quantity)

## **Usage**

A fragment of a dataflow with Expression objects is shown below:

![](https://3768133094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4WCHHphSt0ALtMJlqot%2Fuploads%2FnbvVj3CiPtNePlqX6aqi%2F1.png?alt=media)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.astera.com/astera-data-stack-v6/dataflows/maps/creating-expression-maps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
