> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/row-denormaliser.md).

# Row Denormaliser

The Row denormaliser step can be used to try to improve performance either by adding redundant copies of data values or by grouping data. You can also use this step to convert data types.

{% hint style="info" %}
You must normalize the data before you can denormalize it.
{% endhint %}

For example, consider the following set of normalized data:

| Produce Category | Delivery Time       | Produce Type |
| ---------------- | ------------------- | ------------ |
| fruit            | 2018/01/05 08:00:00 | apples       |
| fruit            | 2018/01/05 08:10:00 | oranges      |
| fruit            | 2018/01/05 08:20:00 | apples       |
| fruit            | 2018/01/05 08:30:00 | oranges      |

The data can be denormalized by grouping on the type of fruit:

| Produce Category | Apples              | Oranges             |
| ---------------- | ------------------- | ------------------- |
| fruit            | 2018/01/05 08:00:00 | 2018/01/05 08:10:00 |
| fruit            | 2018/01/05 08:20:00 | 2018/01/05 08:30:00 |

### General tab

Enter the following information in the transformation step fields:

| Field         | Description                                                                                                                                                                                                      |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Step name** | Specify the unique name of the transformation step on the canvas. The default is Row denormaliser.                                                                                                               |
| **Key field** | Define the key of the output row. The available fields come from the incoming PDI data stream. Another step with output data must be connected to the Row denormaliser step for options to appear in this field. |

### The fields that make up the grouping

![Group field table in Row denormaliser](https://773338310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYwnJ6Fexn4LZwKRHghPK%2Fuploads%2Fgit-blob-382e95037763890b9d4f8c78310cf9f28847a153%2FPDITransStep_RowDenormaliser_GroupFieldTable.png?alt=media)

Use the **The fields that make up the grouping** table to specify which fields from the incoming PDI data stream define the grouping for the denormalization process.

You can click **Get Fields** to automatically fill the table with all fields from the incoming PDI data stream.

For more information, see [Understanding PDI data types and field metadata](/pdia-data-integration/understanding-pdi-data-types-and-field-metadata.md).

### Target fields

![Target fields table in Row denormaliser](https://773338310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYwnJ6Fexn4LZwKRHghPK%2Fuploads%2Fgit-blob-35f77795ff50e8ade8681bbddb535ee1beeb28fa%2FPDITransStep_RowDenormaliser_TargetFieldsTable.png?alt=media)

Use the **Target fields** table to select the fields to denormalize by specifying the string value for the **Key field**.

Options are provided to convert data types. Strings are most common as key-value pairs, so you often convert to Integer, Number, or Date.

If you get key-value pair collisions (the key is not unique for the specified group), specify the aggregation method to use.

You can click **Get lookup fields** to retrieve fields from the PDI data stream.

### Examples

The `data-integration/samples/transformations` directory contains the following example KTRs that show how to use this step:

| Example KTR file                                     | Description                                                        |
| ---------------------------------------------------- | ------------------------------------------------------------------ |
| `Denormaliser – Simple Example.ktr`                  | Converts a ‘month’ row in a record to multiple ‘month’ columns.    |
| `Denormaliser – Data Conversion and Aggregation.ktr` | Converts data values by ‘month’.                                   |
| `Denormaliser – 2 Series of Key-Value Pairs.ktr`     | Converts ‘name’ and ‘ID’ rows to multiple ‘name’ and ‘ID’ columns. |
| `Denormaliser – Capturing Last State Timestamp.ktr`  | Aggregates data values by ‘state’.                                 |

### Metadata injection support

All fields of this step support metadata injection. You can use this step with [ETL metadata injection](/pdia-data-integration/pdi-transformation-steps-reference-overview/etl-metadata-injection.md) to pass metadata to your transformation at runtime.


---

# 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://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/row-denormaliser.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.
