4 Replies Latest reply on Aug 31, 2017 8:57 AM by Larry Staley

    How to construct a tree map with time series based data

    Larry Staley

      First, I am new to the Tableau Community and delighted to have joined.  I am relatively new to learning Tableau currently completing a class in Santa Clara, CA.

       

      For my project I am using data based on one of the Makeover Monday studies, namely one from 2016, a study on Income Inequality in the United States. My data is essentially all year times series, some 60 years in a row of data starting in 1930s up to about 2012. For each year I have a wide variety of dimensions including Bottom 90% (by percentage share of wealth in US), Top 10% (by percentage share of wealth in US), Top 1% (by percentage share of wealth in US), Top 1% with offshore assets, Gini Coefficient (measure of wealth distribution in a nation), Per capita household income, savings rate (Bottom 90%), savings rate (Top 10%).

       

       

      The construction of a tree map depends on categories and classifications (as is true with the Tableau Superstore template, for example, stationary category and subcategories of stationary items).

       

       

      However, I am not sure the data I have is like that. Can the time series data I am using for my project still be applied to produce a tree map? Maybe there are some examples of producing tree maps from such time series based data, but I have researched and am not finding any. Maybe you can recommend for the kind of data I have, how to best approach a tree map, or maybe use some other related tool.

       

       

      Thanks again for taking my inquiry.

       

      Larry Staley

      larrystaley07@comcast.net

        • 1. Re: How to construct a tree map with time series based data
          Shaik H

          Hi Larry,

           

          Please find my approach

          1) Changed your % Difference (based on previous year) calc to be:

          (ZN(SUM([Population])) - LOOKUP(ZN(SUM([Population])), -1)) / ABS(LOOKUP(ZN(SUM([Population])), -1))

           

          2) Set the Compute Using for this % Difference Calc appropriately:

          PercentDiffCalc.png

           

          3) With YEAR on the filter shelf, you could not get accurate results since only one year was available to the calculation.  So, moving YEAR(Date) to the Pages shelf, which gives us the ability to "page through" the years and see the resulting values.  Version 8.1 Workbook is attached.  Note that 2010 will show all NULL values, since there is no previous year.  We could set this up to calculate the change from 2010 for each year as well.  I set up a separate calculation for this in the attached workbook, and created a sheet for each version.

           

          Thanks!!

          • 2. Re: How to construct a tree map with time series based data
            Larry Staley

            Hi Shaik,

             

            Thanks for responding.  Unfortunately, I really do not understand your response, including item 2 where you show a map and states as I currently have no geo information in my file.  I have gone ahead and attached the Inequality Excel file as basis for my project.  Again, you will see the first column represents all of the years with the corresponding columns for top 10% income, bottom 90% income, gini coefficient, household income, etc. as reported for each of these years.  So it is true time series data.  If you can better orient your response, specifically to the data here, and how it can help me construct a treemap that would be very much appreciated.  I also will want to construct a geo map; maybe use a US map with slider showing share of US household, each year changing, by ratio of bottom 90% to top 1%.  However, I would need help on how to construct that.

             

            Again, I am relatively new to Tableau.  I appreciate you having patience with me.

             

            Larry Staley

            • 3. Re: How to construct a tree map with time series based data
              Larry Staley

              Hi again Shaik,

               

              I attempted to create the treemap using my data and attached the result.  There are no labels showing.  However, I can click on a cell and shows year and bottom 10, top 10 in that particular cell (year is only dimension and bottom 90%, top 10% as two measures.  Perhaps you can provide input, first if these are correct categories, based on my data and how to get labels.  Maybe there is a way to add the calculated value to create categories, and show a real treemap, as I think you were getting at with your original response.  Again, I am new at learning Tableau.

               

              Larry Staley

              • 4. Re: How to construct a tree map with time series based data
                Larry Staley

                Hi Shaik,

                 

                Appears I got the issue resolved on producing a treemap as I created a new measure of discrete values.  I will work to get it perfected.

                 

                However, as you also appear to be an SME with geo mapping, I have a different question for you.  I would like to construct a geo map, also related to US Income Inequality, but only with modifying my current excel file.  Also, again this is time series driven data.  I would like to construct a geomap, that for each of my years, would show the three top states at the high 10% income level as well as the three highest states at the bottom 90% income level.  So am considering modifying my Excel data to add columns as follows (with year already in the database):

                 

                Year   State1 (high 10% income) State2 (10% income) State3 (10% income) State4 (high 90% bottom income) State5 (90% bottom) State6 (90% bottom)

                 

                2010 California  $580,000  Illinois  $565,000  Texas  $555,000 Missouri  $64,000  Florida $62,000 Minnesota $59,000

                2011  New York $620,000  California $605,000 Illinois $600,000  Massachusetts $65,000 Minnesota  $63,000 Colorado $62,500

                2012  California $645,000  New York $640,000 Maryland $635,000  Iowa $67,000

                Colorado $65,000  Arizona $64,000

                 

                So the geo map, for the year I display in the indicator would show these six states including income amounts.  In addition, I would like to apply coloring so say three highest at 10% highest income are shaded in green (from dark to light) and three at bottom 90% are shaded in orange (from dark to lightest, again in order of income amount.

                 

                Is it possible to construct such a geo map and just by my modifying, adding the columns I have noted?  Just was not sure.

                 

                Thanks again.

                 

                L. Staley