> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Sort Transformation

> Use the Sort transformation to order records by one or more fields in ascending or descending order in your Integrate.io ETL data pipeline.

<Frame>
  <img src="https://mintcdn.com/integrateio/HSGmKiO3soPLENmi/images/creating-packages/using-components-sort-transformation/image-1.png?fit=max&auto=format&n=HSGmKiO3soPLENmi&q=85&s=6f03e8acff06fd61a9f9857a0b60f78d" alt="Sort component in the pipeline designer" width="1200" height="828" data-path="images/creating-packages/using-components-sort-transformation/image-1.png" />
</Frame>

## Sort data by one or more fields:

<Steps>
  <Step>
    Add a sort component where required in your package.
  </Step>

  <Step>
    Open the component and name it.
  </Step>

  <Step>
    Add the first field you want to sort by, and define the sort order (ascending or descending).

    <Frame>
      <img src="https://mintcdn.com/integrateio/HSGmKiO3soPLENmi/images/creating-packages/using-components-sort-transformation/image-2.png?fit=max&auto=format&n=HSGmKiO3soPLENmi&q=85&s=39fc59dc7150fae22fc1bb540b5533a8" alt="Adding a sort field with ascending or descending order" width="1200" height="828" data-path="images/creating-packages/using-components-sort-transformation/image-2.png" />
    </Frame>
  </Step>

  <Step>
    If required, add additional fields to sort by and define their sort order.
  </Step>

  <Step>
    Change the field order as required.

    <Frame>
      <img src="https://mintcdn.com/integrateio/HSGmKiO3soPLENmi/images/creating-packages/using-components-sort-transformation/image-3.png?fit=max&auto=format&n=HSGmKiO3soPLENmi&q=85&s=58dc6b349b6ba0876ab2fe8d4f36627f" alt="Reordering multiple sort fields" width="1200" height="828" data-path="images/creating-packages/using-components-sort-transformation/image-3.png" />
    </Frame>
  </Step>
</Steps>

## Known Limitation

Since Integrate.io ETL offers parallel processing out of the box on some components, Sort is not guaranteed by default and single-threaded processing needs to be enforced. To do so, add a package variable **\_EXEC\_TYPE** with value **'local'** so that the records are sorted properly. Note that selecting "Merge output to single file" in File Storage destination can also affect proper record sorting.

<Frame>
  <img src="https://mintcdn.com/integrateio/HSGmKiO3soPLENmi/images/creating-packages/using-components-sort-transformation/image-4.png?fit=max&auto=format&n=HSGmKiO3soPLENmi&q=85&s=756463fa5426f282af86c9860f19bcf0" alt="Package variable _EXEC_TYPE set to local for single-threaded sorting" width="1982" height="420" data-path="images/creating-packages/using-components-sort-transformation/image-4.png" />
</Frame>
