9 Replies Latest reply on Apr 11, 2018 5:09 AM by Lee Forst

    Parameter Corruption from Published Data Source Containing a Parameter

    Lee Forst

      In an attempt to lessen the burden when working with published data sources that are an extract from a time consuming database query, I implemented the following tip.

       

      Easy Empty Local Extracts | Tableau Software

       

      I should have thought better to test this to make sure it wouldn't cause a problem.  But what I'm seeing is that after making this change, existing workbooks who had their own parameters are now corrupted.  In those workbooks, any calculated dims or measures that used "local" parameters are now replaced by the [Create Empty Extract] parameter.  And is a result, all views using those calculated dims\measures are broken.  I've recreated this scenario and I will submit an issue to Tableau once I have all the steps documented and reproducible.

        • 1. Re: Parameter Corruption from Published Data Source Containing a Parameter
          Lee Forst

          In hopes to help someone who runs into this problem, below is the information on how to reproduce this problem.  I've support a case to Tableau and I will update as I learn more from them.

           

          Issue: Workbook calculations corrupted by published data source parameters

           

          Description:

          When an existing publish data source with an extract has a new parameter added, the existing connected workbooks become corrupted with the newly added data source parameter after saving the workbook.  This was noticed when implementing the following workaround reducing the time it takes to modify an existing data source.  https://www.tableau.com/about/blog/2013/9/easy-empty-local-extracts-25152

           

          Desktop Version: 9.3.6

          Server Version: 9.3.0

           

          Steps to Reproduce Behavior

          1. Open Desktop and connect to a Microsoft SQL Server
          2. Select a database and a table.
          3. Change from Live to Extract.
          4. Switch to Sheet1 and save the TDE
          5. Publish the data source to Server
          6. Close Desktop and reopen
          7. Create a connection to Tableau Server and select the newly published data source
          8. Create 2 new parameters (Parm1 and Parm2); type of float
          9. Create a new calculated field (Test Parms) that has a calculation of [Parm1]+[Parm2]
          10. Drop new calculated field onto the rows shelf
          11. Save the workbook to your computer and close Desktop
          12. Go to Server and locate the published data source and download it opening it up in Desktop
          13. Create a new parameter called Bad Parm with a type of Boolean
          14. Show the parameter
          15. Create a new calculated field called Bad Calc with a calculation of [Bad Parm]
          16. Switch to the Data Source tab and add a filter to the Extract.
          17. Filter on Bad Calc excluding True value
          18. Change the value of the Bad Parm to False
          19. Publish data source to server overwriting the existing version and close Desktop
          20. On Server, locate the data source and Refresh Extracts and wait for completion
          21. In Desktop, open the workbook you saved.
          22. Notice the Bad Parm does not show up in Parameters, however the Bad Calc does under Dimensions.
          23. Immediately save it and close Desktop
          24. Open the workbook up again and notice the Test Parms calculated field is invalid.
          25. Edit the calculated field and you will see it’s calculation has been changed to [Bad Parm]+[Parm2].
          26. Also notice the Bad Parm now shows up in Parameters.
          • 2. Re: Parameter Corruption from Published Data Source Containing a Parameter
            Jamieson Christian

            Lee,

             

            I can confirm that the issue exists in Tableau Desktop/Server 10.1. It has triggered for me on a number of workbooks that (1) have parameters and (2) are being migrated to a new data source that has a parameter of its own.

             

            I have access to a 10.5 dev environment, so I will try to reproduce the issue there to see if it's still an outstanding bug in the latest version of Tableau.

             

            Did you submit a ticket with Tableau Support? If so, what did they conclude? I would be very interested to know what they said.

             

            Thanks,

            Jamieson

            • 3. Re: Parameter Corruption from Published Data Source Containing a Parameter
              Lee Forst

              Sorry you found this problem Jamieson.  It is a frustrating one.  The last response I got from Support was back on 2/14/2017 and it was

               

              "

              I am just following up on this support case.

               

              At this point, my Development team is working to incorporate a fix for the issue by changing the manner in which Metadata is handled.

               

              Though I cannot give a firm date, due to the many moving parts that go into a software release, Tableau maintains a frequent maintenance release cycle.

              "

               

              Given you are still seeing the behavior in 10.1, I suspect they've not fix it yet.  I'd be curious to see what you find in 10.5.  We're on 10.4.1 and I will see if I can find time to try producing it.

              • 4. Re: Parameter Corruption from Published Data Source Containing a Parameter
                Jamieson Christian

                Thanks for the update Lee. I confirmed that this issue still exists in 10.5. My steps to reproduce are below (slightly modified/simplified from your process):

                 

                Initial Data Source

                1. Create a new workbook "Corruption Test DS" (datasource) with some sample data. I used a few dozen rows from an Excel file.
                2. Make the data source an extract, then save the workbook. (Hint: save as TWBX to avoid an external TDE file.)
                3. Publish the data source to Tableau Server 10.5. Call it "Corruption Test".
                4. Close the "Corruption Test DS" workbook.

                 

                Initial Workbook

                1. Create a new workbook "Corruption Test WB" (workbook).
                2. Connect to the "Corruption Test" data source on Tableau Server 10.5.
                3. Create parameters [WB param 1] and [WB param 2], both type float.
                4. Create calculated field [WB param test]. Make the calculation [WB param 1]+[WB param 2].
                5. Put [WB param test] on the Marks shelf.
                6. Save and close the "Corruption Test WB"

                 

                Modify Data Source

                1. Open existing workbook "Corruption Test DS".
                2. Create parameter [DS param 1], type boolean.
                3. Create calculated field [DS param test]. Make the calculation simply equal to [DS param 1].
                4. Publish the data source to Tableau Server 10.5, using the same name "Corruption Test".
                5. Close the "Corruption Test DS" workbook.

                 

                Observe Corruption in Workbook

                1. Open existing workbook "Corruption Test WB".
                2. Observe the following:
                  • All 3 parameters are visible: [WB param 1], [WB param 2], and [DS param 1]
                  • The calculated field [DS param test] is visible and correct
                  • The calculated field [WB param test] is visible but marked as invalid.
                  • Inspection of [WB param test] shows that it now equals [DS param 1]+[WB param 2].
                3. Create a new calculated field. Start to type "WB". Observe that only [WB param 2] appears in the auto-lookup. [WB param 1] never appears.
                4. Note that if you fully type out "[WB param 1]" (including the brackets), the calculation editor will recognize it, syntax highlight it, and accept the calculation as valid.
                5. If you save the workbook again and reopen, and the issue persists.

                 

                 

                An inspection of the various files shows that, yes, the data source and the workbook both have a parameter that is internally named [Parameter 1].

                 

                From the TDS of the "Corruption Test" published data source:

                 

                From the TWB for the "Corruption Test WB" workbook:

                 

                 

                Note that, after the data source has been modified, you can open "Corruption Test WB" and re-save it, and the parameters will have been renamed to avoid a name conflict. Specifically, [DS param 1] was renamed from [Parameter 1] to [Parameter 3] to make way for the existing workbook parameters.

                 

                From the <datasources> section of the TWB for the "Corruption Test WB" workbook after the corruption:

                 

                However, in the worksheet <view> block, the parameters are cited using unmodified internal names. This seems to be where the issue lies.

                1 of 1 people found this helpful
                • 6. Re: Parameter Corruption from Published Data Source Containing a Parameter
                  Lee Forst

                  Thanks for all of the info.  And thanks for the KB article.  It is interesting they say it occurs because the internal ID given to the parms is the same.  One would think they would assign a GUID or something to avoid conflicts like this.

                  • 7. Re: Parameter Corruption from Published Data Source Containing a Parameter
                    Jamieson Christian

                    Lee,

                     

                    Totally agree. Using an internal name of "Parameter 1" is just asking for collisions.

                     

                    The use of a GUID would be consistent with how Tableau internally identifies calculations, e.g. "Calculation_1599059375666290688" in the screenshots I posted earlier. And even if the display name of the parameters is the same in a workbook and data source (which suggests that the two need to be merged), I reckon the same logic they use for calculations could be applied to parameters. The merge logic for calculations, at least, seems to behave exactly the way I would expect it to, each time I've done a merge.

                     

                    Anyway, I'll keep an eye on this and see if a fix is forthcoming in Tableau 11.

                    • 8. Re: Parameter Corruption from Published Data Source Containing a Parameter
                      Kevin Wiese

                      Lee,

                      You can work-around this issue if you're willing to edit the XML in your Tableau workbook before adding new parameters to your data source.  You just need to move your workbook parameters to higher unused parameter numbers so they don't collide with the data source.  I have used the following approach with success:

                      1. Create a blank workbook and add your Tableau data source.  Save the empty workbook as "Base DS".
                      2. Open the "Base DS" file in a text editor and search for the text "[Parameter ".  The first hit should be the block near the top of the file where all workbook parameters are defined.
                      3. Make note of the data source parameters by name and Parameter #.
                      4. Open a backup copy of your existing Tableau workbook in the text editor, search for "[Parameter " again and make note of any parameters in your workbook that don't match up with the data source parameters by Parameter #.  These are the local workbook parameters
                      5. Now you just want to move all of your local workbook parameters to higher numbers so they won't collide with the data source.  If your highest data source parameter is #5, then move all of your local workbook parameters up to numbers above 10 (higher if you want more room to grow).  Use Find/Replace in your text editor and replace all instances of each parameter name.  [Paramter 1] becomes [Parameter 10], [Parameter 2] becomes [Parameter 11], etc.
                      6. Save your workbook and re-open it just to make sure everything still works.
                      7. Now go back and add the new parameters to your data source.  If the highest was previously Parameter 5, the new ones will be created as Parameter 6, Parameter 7, ...  Re-publish your data source to the server.
                      8. Re-open your existing workbook and you should see all of the new parameters appear, and everything else should still work.

                       

                      Not an ideal, but I find it easier than adding parameters to your data source and then fixing all of the broken references in your existing workbooks.  Your mileage may vary.

                      1 of 1 people found this helpful
                      • 9. Re: Parameter Corruption from Published Data Source Containing a Parameter
                        Lee Forst

                        Thank you Kevin for the suggestion.  I will certainly take this into account the next time we experience this problem.