6 Replies Latest reply on Nov 21, 2017 4:50 PM by Toby Erkson

    Using environmental variables in extract properties?

    Rebecca McKinney

      Hola - I'm a new Tableau Server admin, and cannot find any reference to using env variables rather than host in extract properties?  Here's the scenario:

       

      1. Installed v10.4 on a new server, and restored backup from old v9.2 server as per vendor documentation to get our content

      2. Data sources include Extracts located on old server, therefore content on new v10.4 server is pointing to data sources on old server

      3. When we move extracts to new server, I need to mass update data sources to look at new location - is there a good way to do this?

      4. If there is no good way to do this, I'd like to use an env variable on the server, so that if we move servers again, I can use same variable from server to server - has anyone done this?

       

      Thanks for your help!

      Rebecca

        • 1. Re: Using environmental variables in extract properties?
          Toby Erkson

          Rebecca McKinney wrote:

           

          ...

          2. Data sources include Extracts located on old server, therefore content on new v10.4 server is pointing to data sources on old server

          ...

          This is no bueno.  Extracts (I'm assuming you mean .tde files) should be moved off the Tableau Server.  Disk space on the TS is for TS-use only, not as someone's personal data store.  Actually, extracts can be published into the TS using tabcmd publish...a much better solution.

          • 2. Re: Using environmental variables in extract properties?
            Rebecca McKinney

            No, the extracts are, e.g., csv, files in a particular folder on the d: drive.  We cannot connect tableau to many production dbs, so we run batch jobs to get the data, and the results, such as csv files, are saved in a folder on the server and used as a data source.

            • 3. Re: Using environmental variables in extract properties?
              jegan.sivaraj

              We hold all CSV/Excel/Text sources in a separate server. Like Toby said the same location as the prod Tableau server is not a good solution.

              • 4. Re: Using environmental variables in extract properties?
                Toby Erkson

                Rebecca McKinney , follow Jegan Sivaraj's advice.  Nothing should be on the Tableau Server except "Tableau Server stuff".  Data source output that has not been processed by Tableau directly is not considered "Tableau Server stuff".

                • 5. Re: Using environmental variables in extract properties?
                  Rebecca McKinney

                  So does no one use environmental variables for \\fileserver\ when using a UNC path for publishing with "Include external files"?

                   

                  We don't have another server to host the external files other than the Tableau server, unfortunately.

                  • 6. Re: Using environmental variables in extract properties?
                    Toby Erkson

                    First -- and I know I'm being petulant but I gotta say it -- send this to your IT server person so they can use it to help them with their request:  2017 Guide: The Best External SSDs - ComputerShopper.com  They are dirt-cheap. People (managers, exec. staff) need to understand that Tableau is an enterprise application and needs to be treated as such.

                     

                    Second, I've never heard of someone wanting to do this nor actually doing it, so you're the first, woo-hoo!   However, I'm going to say that it won't work and here's why:

                    The environmental variable (EV for short) on the Tableau Desktop computer would need to be exactly the same on the Tableau Server.  Too risky to trust [non-IT] end users to do.

                    There is nothing in the Tableau Server documentation nor Desktop documentation about setting and using EVs.

                    Tableau Server is not designed to hold EVs in the file path.  What happens is the EV gets replaced with the actual file path and saved as such in the workbook.  That really is the main reason.

                    I just confirmed this:

                    Here I display what the TEMP EV is:

                    TEMP = C:\Users\terkson\AppData\Local\Temp

                    When I type in the EV in the Open dialog to connect to Excel, it DOES read the EV and display the proper files (Excel):

                    My test file is "zzzzzz9.xlsx".  I connected to it and the data does display.  I then save the workbook (.twb) and when I open it in a text editor I see this:

                    (Note:  It doesn't matter which Excel driver, excel-direct or legacy, is used as the outcome is the same.)

                    Notice that Tableau saves the file location with the EV fully expanded -- it replaces the %TEMP% with its value of C:\Users\terkson\AppData\Local\Temp.

                    Even when I typed in the EV and the file name, bypassing the drop-down, and clicked on the Open button...

                    ...the end result was the same.

                     

                    Not the news you wanted but there it is.