7 Replies Latest reply on Apr 21, 2016 6:27 AM by Simon Runc

    duplicate data sources and extracts

    Hannah Jensen

      Hi, all.  I'm new to Tableau and working on a dashboard in which I have a comparison between current year sales and prior year sales by month.  To create this visualization, I've duplicated the data source and blended it on a shifted year, as in this video:

       

      https://www.youtube.com/watch?v=CAZ3IAJEuCI

       

      In that tutorial, the presenter mentions that duplicating a data source in this way does not duplicate the data extract, it only creates a second set of metadata pointing to the original extract.  However, when I used this technique in my workbook and packaged it into a .twbx file, it did create a second .tde file for the copied data source, making the .twbx file very large.  How can I avoid this?  I tried removing the extract from the copied data source, but this results in a live connection to the underlying database, which is way too slow.  How do I set up the duplicated data source so that it uses the data extract for the original data source rather than creating a second extract file?

       

       

      Thanks very much,

      Hannah

        • 1. Re: duplicate data sources and extracts
          anoop.mohandas.0

          Hannah,

           

          So you have a data source # A and now you to do a comparison between current year sales and prior year sales by month you duplicated the data source which lets call B. If you do this and do an extract it willhave the data extracts of both A and B. Remember you would have duplicated the data but from a Tableau Perspective it's two data sources having same data. Now what's lingering in my mind is why do you duplicate the whole data source if you want to compare two or three fields? Just duplicate the fields instead of the whole data source. Again I may not be understanding the whole picture of what you are trying to achieve. But I am throwing my two cents.

          1 of 1 people found this helpful
          • 2. Re: duplicate data sources and extracts
            Hannah Jensen

            Thanks for your response, Anoop.  I used a duplicated data source to avoid having to create a number of calculated fields to achieve the same result.  My understanding was that it would only create additional metadata pointing to the original extract, not an additional extract.  But it sounds like I was incorrect, and an additional extract will always be created when a duplicate data source is used.  So perhaps I should work creating calculated fields in the original data source instead.

            • 3. Re: duplicate data sources and extracts
              anoop.mohandas.0

              Good Luck and let us know how it went.

              Do mark this thread answered once you have your answer. Thanks.

              • 4. Re: duplicate data sources and extracts
                Hannah Jensen

                I was able to use a table calculation, lookup([Sales], -12) to get the monthly sales from the prior year, but this is only useful without additional filters applied.  If I want to show prior sales for 2016 only, this approach won't work, since the table will be filtered before the calculation is done, and the lookup will return nothing.  Any ideas on how I can get around this? 

                 

                The only other approach I can think of is to do the prior year calculations in the SQL used to pull the data (data source is Oracle), but I'd love to know if there are better ways.

                 

                Thanks,

                Hannah

                • 5. Re: duplicate data sources and extracts
                  Simon Runc

                  hi Hannah,

                   

                  If you look at my response here

                   

                  Re: Year on Year % on Single Map

                   

                  there are 2 ways to achieve what you need (One is to hide, rather than filter the years, or the niftier use of a Table Calc filter, which requires less/no maintenance)

                   

                  Hope that helps.

                  2 of 2 people found this helpful
                  • 6. Re: duplicate data sources and extracts
                    Hannah Jensen

                    Hi, Simon.  I was not aware that data values could be hidden like that -- perfect!  And maybe I'll give the table calc filter a shot too.  Thanks very much for your help!

                    • 7. Re: duplicate data sources and extracts
                      Simon Runc

                      No problem...The reason I tend to use Table Calc filters for this, is that you are hiding, say, the year 2015...which means that next year you'll need to re-visit the model (..and more challenging...remember to re-visit the model!!) and hide 2016. The Table Calc filter lets it always just show, for example, the last year.