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()) ) `

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})`

The new columns will create according to the data as mentioned below:

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()`

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)`

The new columns will create according to the data as mentioned below:
