Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to pull data from a data file which will have changing column names.
Example:
Name | Dept | Job | Jan 2018 | Feb 2018 | Mar 2018 | Apr 2018 | May 2018 | Jun 2018 |
---|---|---|---|---|---|---|---|---|
John | Finance | J1 | 100 | 20 | 213 | 122 | 121 | 213 |
Berry | Tax | J2 | 100 | 200 | 200 | 200 | 200 | 200 |
Charlie | IT | J3 | 200 | 120 | 200 | 200 | 250 | 120 |
Jack | Finance | J4 | 500 | 300 | 200 | 200 | 100 | 300 |
The first few column names will remain the same, but the Month-Year columns would keep changing because this is a rolling 12 or 15 month file.
What I am trying to achieve is to have a dynamic logic so I can pull all fields (with field names) and also derive month year values from the column headers, to later use them in the calendar & dates.
NOTE - CROSSTABLE might not be the answer, because the user wants to see a separate column for each month.
Any help is appreciated. Thanks
May be load using * instead of using the names of the field
LOAD *
FROM ....;