Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is my input table :
for each row, i need to have 5 lines rows for 5 quarters .
quarter should be a column and it will have quarter info, Value should be another column which have corresponding values in it.
FLOCATION | TSIZE | DNUMBER | MNUMBER | BCODE | 1804 | 1901 | 1902 | 1903 | 1904 |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | - | - | - | - | - |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1,600 | 1,100 | 1,475 | 1,594 | 1,501 |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 650 | - | 455 | 787 | 716 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1,000 | 349 | 918 | 1,178 | 1,150 |
MI FB S2 | 20MN | 56745HYDAF9 | 56745HYDAF9 | 56745HYDAF9 | 300 | - | - | - | - |
MI FB S2 | 20MN | 56745HYDA1A | 56745HYDAF9 | 56745HYDAF9 | 25 | 100 | - | - | - |
TSMC FAB 12 | 30MN | 56745HYDQ | 56745HYDQ | 56745HYDQ | 75 | - | 21 | 274 | 249 |
Need out put table like this..
This is output for only 4 rows of the above table.
FLOCATION | TSIZE | DNUMBER | MNUMBER | BCODE | QTR | Value |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | 1804 | - |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | 1901 | - |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | 1902 | - |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | 1903 | - |
MI FB 1 | 10MN | 5618A2B | 5618A2B | 5618A2B | 1904 | - |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1804 | 1600 |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1901 | 1100 |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1902 | 1475 |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1903 | 1594 |
MI FB 2 | 20MN | 56745HYDAQ3 | 56745HYDAQ3 | 56745HYDAQ3 | 1904 | 1501 |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 1804 | 650 |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 1901 | - |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 1902 | 455 |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 1903 | 787 |
MI FB 2 | 20MN | 56745HYDAP4 | 56745HYDAP4 | 56745HYDAP4 | 1904 | 716 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1804 | 1000 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1901 | 349 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1902 | 918 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1903 | 1178 |
MI FB 2 | 20MN | 56745HYDAE4 | 56745HYDAE4 | 56745HYDAE4 | 1904 | 1150 |
yeah, Thanks, it worked.
I remember 'reshape' command in R, so asked a similar kind here, your solution worked anyway, Thanks again.