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

# aggregate_unpivot

### aggregate\_unpivot

<ul>
  <li>
    aggregate\_unpivot(\
    &#x20;table\_name: string,\
    &#x20;column\_names: string\[],\
    &#x20;variable\_column\_name: string | undefined,\
    &#x20;value\_column\_name: string | undefined,\
    &#x20;pivoted\_columns: string\[],\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[AggregateUnpivotResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotResponse.md)>

    Rotate the column values into rows values.For unpivot details and examples, see Unpivot. For limitations, see Unpivot Limitations.Unpivot is used to normalize tables that are built for cross tabular reporting purposes. The unpivot operator rotates the column values for all the pivoted columns. A variable column, value column and all columns from the source table except the unpivot columns are projected into the result table. The variable column and value columns in the result table indicate the pivoted column name and values respectively.The response is returned as a dynamic schema. For details see: dynamic schemas documentation.

    #### Parameters

    <ul>
      <li>
        table\_name: string

        Name of the table on which the operation will be performed. Must be an existing table/view, in \[schema\_name.]table\_name format, using standard name resolution rules.
      </li>

      <li>
        column\_names: string\[]

        List of column names or expressions. A wildcard '\*' can be used to include all the non-pivoted columns from the source table.
      </li>

      <li>
        variable\_column\_name: string | undefined

        Specifies the variable/parameter column name.
      </li>

      <li>
        value\_column\_name: string | undefined

        Specifies the value column name.
      </li>

      <li>
        pivoted\_columns: string\[]

        List of one or more values typically the column names of the input table. All the columns in the source table must have the same data type.
      </li>

      <li>
        `Optional`options: Record\<string, string>

        Optional parameters.
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[AggregateUnpivotResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotResponse.md)>

    Promise\<Types.AggregateUnpivotResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:3987](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L3987)</li>
    </ul>
  </li>
</ul>

### aggregate\_unpivot\_request

<ul>
  <li>
    aggregate\_unpivot\_request(\
    &#x20;request: [AggregateUnpivotRequest](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md),\
    ): Promise\<[AggregateUnpivotResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotResponse.md)>

    Rotate the column values into rows values.For unpivot details and examples, see Unpivot. For limitations, see Unpivot Limitations.Unpivot is used to normalize tables that are built for cross tabular reporting purposes. The unpivot operator rotates the column values for all the pivoted columns. A variable column, value column and all columns from the source table except the unpivot columns are projected into the result table. The variable column and value columns in the result table indicate the pivoted column name and values respectively.The response is returned as a dynamic schema. For details see: dynamic schemas documentation.

    #### Parameters

    <ul>
      <li>
        request: [AggregateUnpivotRequest](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotRequest.md)

        Request object containing the parameters for the operation
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/javascript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[AggregateUnpivotResponse](https://docs.kinetica.com/content/api/javascript/interfaces/AggregateUnpivotResponse.md)>

    Promise\<Types.AggregateUnpivotResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:3938](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L3938)</li>
    </ul>
  </li>
</ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.