3 Replies Latest reply on Feb 19, 2017 6:46 AM by Stephen Galluccio

    How to add the data source file name as a field

    john tilley



      I have 12 excel data files, each containing results from a test for a month of the year.  For example, the January data file might look like this:


      ID        Iterations       Successes

      A         10                  5

      B         8                    6

      C         11                  3


      I'd like to import all of the monthly files as one big data set, with an extra column showing the month that the test relates to, as follows:


      Month     ID        Iterations       Successes

      Jan         A         10                  5

      Jan         B         8                    6

      Jan         C         11                  3

      Feb         A         8                    6

      Feb         B         6                    4

      Feb         C         10                  4



      I have named each of my files after the months that they relate to.  A logical approach to get the data into the required format would therefore be to:


      1. Get Tableau to import the files one by one but as a single data source

      2. Get Tableau to add a field that shows the file name as it imports each row


      Can anyone help me to perform these two steps?  I want to avoid making any manual changes to my raw data.