I already issued my problem in this request and got it solved. Unfortunately my problem changed slightly and I needed support again 🙂
I have a table with 4 columns. ID, stock, warehouse, stockbin.
My table has multiple rows with the same ID, but different values for stock, warehouse and stockbin.
I want to transform the data so that only one row with the distinct ID remains.
For every value in stock, warehouse and stockbin I just want to have a new column with a rising counter.
Example:
id, warehouse, stock, stockbin
1, Berlin, 30, A5
1, Berlin, 20, A9
1, New York, 10, A16
2, Belgium, 5, A40
2, Spain, 10, A50
After transformation:
id, warehouse1, stock1, stockbin1, warehouse2, stock2, stockbin2, warehouse3, stock3, stockbin3
1, Berlin, 30, A5, Berlin, 20, A9, New York, 10, A16
2, Belgium, 5, A40, Spain, 10, A50
What would be a good way to solve? In my original request it only worked for 2 columns.
I changed it to three but then my stockbin is not stockbin1, stockbin2 and so on but stockbinA16, stockbinA50.
Any ideas?