3 Replies Latest reply on Apr 19, 2013 1:58 AM by nathan comiskey

    How do I set my own table partitions?

    Ron Chipman

      I am trying to compare values for the same month (Jan vs Jan, Feb vs Feb) for year over year.  I want to simply show prior month's value onto the current month's row.

       

      My table is simply designed as:
      ROWS = MONTH , YEAR

      COLUMNS = Measure Names

       

      I thought that using LOOKUP(MeasureName, -1) would give me the prior row's data as it is the previous row in the same partition (i.e. MONTH).  Using LOOKUP and/or PREVIOUS_ROW gives me the same, incorrect results:  The data from previous MONTH of the same YEAR.

       

      Puzzled by this, I created a calc field called, INDEX, where it is just index.  I wanted to see what was happening under the covers.  Turns out, the INDEX for each row in the MONTH partition is the same.  It is as if Tableau is saying, "You really wanted YEAR first, so we partitioned by YEAR for you...your welcome!".

       

      I don't want it partitioned by YEAR, I want it partitioned by MONTH, so I can do same month comparisons.  I'm reading a lot from folks on changing partitions, but not how?  Or, how do we do table calcs across partitions.

       

      Thanks,

      Ron

        • 1. Re: How do I set my own table partitions?
          nathan comiskey

          Hi Ron,

           

          I am just starting out with Tableau as well and faced this problem.  This article explains how partitions are organised:

          http://onlinehelp.tableausoftware.com/v7.0/pro/online/en-us/calculations_tablecalculations_understanding_addressing.html

           

          So you need to choose your required method of partitioning that you are going to use prior to writing your table calculation.  The article gives a good schematic view of the options available.

           

          Hope that helps,

          Nathan

          1 of 1 people found this helpful
          • 2. Re: How do I set my own table partitions?
            Ron Chipman

            nathan,

             

            Thanks for that article.  Very helpful.  However,I don't think it solves the problem (not ruling out User Error quite yet)...

             

            I have attached two pages to a ppt for screen shots.  I have copied in my formula so you can see how I am trying to use look up.

             

            In the first, the table is set up with YEAR then MONTH, and if you look at the INDEX column as well as the output in the last column all is well in the land of table calculations.

             

            However, I don't want to compare MOM performance within a given year, I want to compare YOY performance for a given month.

             

            So, I swap MONTH and YEAR, see page two, and yet the table calculation returns the EXACT SAME values.  Looking at the INDEX column, you can see that the indexes are still traversing a single year, although the table is clearly partitioned by MONTH.

             

            IF, according to the link you sent, I go into advance and change the focus to MONTH, then I get NULL (I think they are NULLs) returned, as I see no data at all.  I have tried multiple combinations of things, and I cannot get one that gives me the answer that I want, which is the previous year's value for that month.

             

            Thanks again for your help, hopefully, there is an answer out there for me !

            • 3. Re: How do I set my own table partitions?
              nathan comiskey

              Hi Ron,

               

              If you take the table in the format on the first ppt slide and change the 'compute using' in the table calculation to 'YEAR' then the offset in your formula should apply correctly.

               

              Thanks,

              Nathan