> For the complete documentation index, see [llms.txt](https://docs.gaiodataos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gaiodataos.com/gaio-dataos-spanish/herramientas/tareas/etl/tabla-dinamica.md).

# Tabla Dinámica

<figure><img src="/files/AlQYQ5pADy61jWbTT85u" alt=""><figcaption></figcaption></figure>

La tarea **Pivot Table** en Gaio DataOS permite transformar un conjunto de datos desde un formato largo (filas) a un formato ancho (columnas), convirtiendo valores categóricos en nuevas columnas. Es ideal para crear reportes tipo tabla cruzada, comparaciones por categoría y resúmenes listos para dashboards.

{% hint style="warning" %}
Esta tarea solo puede utilizarse cuando una tabla está seleccionada en el flujo.
{% endhint %}

***

### Cómo usar

#### 1. Abrir la tarea Pivot Table

En el menú lateral izquierdo, ve a:\
**Tasks > ETL > Pivot Table**

***

#### 2. Definir nombre de la tarea y tabla de salida

* **Task label:** (opcional) Nombre para identificar esta tarea en el flujo.
* **Result table:** Nombre de la nueva tabla que se creará a partir de la transformación pivot.

***

#### 3. Seleccionar la columna a pivotar

* **Column to pivot:** Elige la columna cuyos valores únicos se convertirán en nuevos encabezados de columna (ej.: `product_category`).
* **Sort values:** Define el orden de las nuevas columnas: Ascending (ascendente) o Descending (descendente).

***

#### 4. Configurar valores pivotados

Aparecerá una lista con los valores únicos de la columna seleccionada.

* Puedes renombrar cada valor en la columna **Transpose** para personalizar los nuevos encabezados.

***

#### 5. Seleccionar el valor a agregar

* **Value to pivot:** Elige la columna numérica que deseas resumir (ej.: `sales_amount`, `units_sold`).
* **Aggregation values:** Selecciona el método de agregación:
  * Sum (Suma)
  * Average (Promedio)
  * Count (Conteo)
  * etc.

***

#### 6. Opcional: Agregar columnas adicionales

* **Extra columns:** Selecciona columnas que deben mantenerse en el resultado (ej.: `region`, `date`).
* **Position of extra columns:** Define si aparecerán:
  * **At start** (al inicio)
  * **At end** (al final) de la tabla resultante.

***

#### 7. Guardar y ejecutar

* **Save:** Guarda la tarea para su uso posterior en el flujo.
* **Run:** Ejecuta la tarea en el flujo.

***

### Casos de uso

* Comparar categorías de productos lado a lado.
* Resumir métricas por región, tiempo o estado.
* Crear vistas pivot personalizadas para dashboards.
* Transformar datos transaccionales en formatos listos para reportes.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.gaiodataos.com/gaio-dataos-spanish/herramientas/tareas/etl/tabla-dinamica.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.
