---
schema_version: "1"
id: 45b6710759d1b5a461ad0f9988353aca371d53e675ba5de17acb22b73a2e190d
title: Flatten Hierarchical Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_batch_transform_flatten.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_batch_transform_flatten.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 698744c462aad3dbaf91bc43b1de69a9ba75bd3101e99c496d8e9306b9bad3db
description: Use the flatten transformation to simplify nested, hierarchical data by converting it to a list. The list tracks where each node and the ones preceding it (referred to as its ancestors) appear within the hierarchy. To flatten data, specify the field that contains every node in the hierarchy and the field that contains their corresponding parent. After you run the transform, each record contains the list of ancestors.
products:
  - Data 360
release: "264"
---
# Flatten Hierarchical Data

Use the flatten transformation to simplify nested, hierarchical data by converting it to a list. The list tracks where each node and the ones preceding it (referred to as its ancestors) appear within the hierarchy. To flatten data, specify the field that contains every node in the hierarchy and the field that contains their corresponding parent. After you run the transform, each record contains the list of ancestors.

The number of hierarchical levels that you can flatten in a data source depends on the number of rows that it contains.

- 300 levels for over 1 million rows
- 100 levels for 15 million rows
- 50 levels for 20 million rows (the maximum)

1. In a transform node, click the Flatten button (![Flatten button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_button_flatten.png)).
2. For Record ID Column, select the column that contains all the nodes in the hierarchy.
3. For Parent ID Column, select the column that contains the parent of each node in the hierarchy.
    
    To include the record ID in the generated column that contains the hierarchy nodes, select **Include Record ID Column Value**.
4. For Hierarchy Column Label, enter a name for the generated column of hierarchy nodes.
5. Preview the transformation results.
    
    Preview shows only the record ID and its parent in the hierarchy column. You see all ancestors when you run the data transform.
6. Click **Apply**.
    
    To collapse the view and see the canvas, click the Collapse button (![Collapse button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_button_collapse.png)).
7. To generate the hierarchy column, run the data transform.