11 Replies Latest reply on Nov 12, 2019 11:40 AM by swaroop.gantela

    Reuse and print out calcuated fields

    Jack Zhang

      Hi Folks,

       

      I have written few dedicated long calculated fields for my project. They are worth to keep and reuse in future project.

       

      Don't know if we are allowed to keep them in the function library to be reused. or how to print out all of them. The similar printing questions for prep flow chart.

       

      Cheers

       

      Jack

        • 1. Re: Reuse and print out calcuated fields
          Zhouyi Zhang

          Hi, Jack

           

          If you create the calculation field(s) before you publish the data source, then when you do the publish or extract, the calculation you created will be stored in within the data source, and for next project, when you connect to the same data source, they are reusable. But if it is not the case, you have to copy/paste every time you need use them in other projects. Hope this makes sense.

           

          ZZ

          1 of 1 people found this helpful
          • 2. Re: Reuse and print out calcuated fields
            Jack Zhang

            Hi ZZ,

             

            Thanks for your help. It looks these functions can only be reused for the same data source. Not working as function library.

             

            How about for printing them out?

             

            Jack

            • 3. Re: Reuse and print out calcuated fields
              Zhouyi Zhang

              Hi, Jack

               

              There isn't a concept of library for tableau than some other reporting tools.

               

              what do  you mean by printing them out? do you mean when tableau runs or you mean print it in paper?

               

              ZZ

              • 4. Re: Reuse and print out calcuated fields
                Jack Zhang

                printing out means printing out on paper. for some long and complicated functions, I prefer to print them out as the hard copy for future reference. If we have a batch of written functions, can we print out in the bulky way?

                • 5. Re: Reuse and print out calcuated fields
                  Zhouyi Zhang

                  it is better to use notepad++ or word to do the editing and print, make sure the basic calculation fields on top.

                   

                  ZZ

                  1 of 1 people found this helpful
                  • 6. Re: Reuse and print out calcuated fields
                    swaroop.gantela

                    Jack,

                     

                    My apologies if I misunderstood, but I think calculated fields can be copied across data sources.

                    For example if the field is

                    { FIXED [Dimension] : SUM( [Measure1] ) }

                     

                    one should be able to copy it over to a different datasource, but in the new datasource,

                    the names might be [Dimension1] and [Measure2], so the field definition needs to

                    be adjusted accordingly.

                     

                    If there are too many fields to adjust by hand,

                    one can create a calculated field crosswalk like:

                    [Measure1] of the old file that is just defined to redirect to  [Measure2] of the new file.

                     

                     

                    What cannot be done is copying a calculated field to a lower version workbook,

                    like trying to copy from a 2019.3 workbook to a 2018.3 workbook.

                    1 of 1 people found this helpful
                    • 7. Re: Reuse and print out calcuated fields
                      Jack Zhang

                      Hi Swaroop,

                       

                      Thanks for your reply which is helpful.

                       

                      At the moment, I work on the survey which has 20 questions. On Tableau, I have to defined 14 calculated fields as their measures, the structure of each is exactly the same. Do you think I can use the technique you mentioned here?

                      • 8. Re: Reuse and print out calcuated fields
                        swaroop.gantela

                        Jack,

                         

                        Yes, I think it should work.

                         

                        But if you are working with surveys,

                        then I have some further questions.

                         

                        Apologies in advance if you've already worked through the below.

                         

                        Is your data arranged as:

                         

                        PersonID     Question 1     Question  2  … etc?

                        ID001          A                      B

                         

                        If so, it may help to pivot all the questions into one column so that it is

                        Person ID     Question     Response

                        ID001            Question 1    A

                        ID001            Question 2   B

                         

                        Then there would only be once calculated field to evaluate all the questions.

                         

                        Apologies further if you are already using these methods and have seen this link,

                        but I would highly recommend Steve Wexler's methods for analyzing survey data:

                        How to Visualize Sentiment and Inclination | Tableau Software

                        • 9. Re: Reuse and print out calcuated fields
                          swaroop.gantela

                          Jack,

                           

                          And please feel free to post some fake sample data in a format

                          similar to your own, and we can try and work through it.

                          • 10. Re: Reuse and print out calcuated fields
                            Jack Zhang

                            hi there,

                             

                            thanks for your help. Pivot table might be a solution, but it won't work for a few reasons: the dimensions of the table will significantly increased. i.e. 10K cases for 75 questions/case; in essence, I need to use the question as the field name to work out the question score for each case. So pivot table would not work.

                             

                            I can see the point you ask for demo or mock workbook data. but my questions are relative to the general data preparation. Not specific for presentation.

                             

                            Anyway, I am grateful for your kindness response, very helpful indeed.

                             

                            Best regards

                             

                            Jack

                            • 11. Re: Reuse and print out calcuated fields
                              swaroop.gantela

                              Jack,

                               

                              Happy to help if there are further questions.

                               

                              Just to clarify, the multiplication of rows should not be an issue with respect to database size

                              or with respect to duplication of information.

                               

                              The duplicated information can be reduced using Level of Detail calculations.

                              For example, if age is on every row, one would just use {FIXED [PersonID]: MAX([Age])}.

                              And place that on the Row Shelf as a Max([PersonIDAge]).