Hi All, Need to convert row into column dynamically. We have table, which contains incoming file name, load date and number of records loaded. We have data since 01-JAN-2015 and need to put it into tabular format, so that we can share with business to have analysis. I thought of using DECODE and MAX function to convert row into column, but since time period is long, it will require me to write 300+ expression using DECODE and MAX. I need your help to get data in below format. Below is sample data.
Source:
| FILE_NAME | LOAD DATE | Record Loaded |
| TOPSAVEDONE | 03/12/2015 | 500 |
| TOPSAVEDONE | 04/12/2015 | 600 |
| TOPSAVEDONE | 05/12/2015 | 450 |
| TOPSAVEDONE | 06/12/2015 | 300 |
| TOPSAVEDONE | 07/12/2015 | 100 |
| LOWSAVEDONE | 03/12/2015 | 1000 |
| LOWSAVEDONE | 04/12/2015 | 8000 |
| LOWSAVEDONE | 05/12/2015 | 3000 |
| LOWSAVEDONE | 06/12/2015 | 6700 |
| LOWSAVEDONE | 07/12/2015 | 5555 |
Output:
| FILE NAME | 03/12/2015 | 04/12/2015 | 05/12/2015 | 06/12/2015 | 07/12/2015 | |
| TOPSAVEDONE | 500 | 600 | 450 | 300 | 100 | | | | |
| LOWSAVEDONE | 1000 | 8000 | 3000 | 6700 | 5555 | | | | |