To get the output as your required format you can follow below procedure in data flow:
Setup the data source in dataflow and add windows function transformation to create `groupcs` column. Configure the transformation as follows:
- Over:`id`,`group`,
- Sort: `id`
- Window columns:
- `groupcs : concat({ group}, toString(rowNumber()) ) `
![enter image description here](https://i.imgur.com/AuOzWUJ.png)
Add pivot transformation to the windows transformation and configure the transformation as follows:
- Group by: `id`
- Pivot key: `groupcs`
- Pivoted columns :
- `stock: max({ stock})`
- `stockplace: max({ stockplace})`
![enter image description here](https://i.imgur.com/ffnKSw4.png)
The new columns will create according to the data as mentioned below:
![enter image description here](https://i.imgur.com/ao1W4Hn.png)
To get the output as your required format you can follow below procedure in data flow:
Setup the data source and add windows function transformation to create `row_index` column. Configure the transformation as follows:
- Over:`id`
- Sort: `id`
- Window columns:
- `row_index : rowNumber()`
![enter image description here](https://i.imgur.com/AWtwBCF.png)
Add pivot transformation to the windows transformation and configure the transformation as follows:
- Group by: `id`
- Pivot key: `row_index`
- Pivoted columns :
- `stocplace: max(stockplace)`
![enter image description here](https://i.imgur.com/Yo1HOo2.png)
The new columns will create according to the data as mentioned below:
![enter image description here](https://i.imgur.com/uZ1Nqrb.png)