4 Replies Latest reply on Dec 21, 2016 1:48 PM by Pascual Bayo

    Calculate variance of quick table calculation

    Pascual Bayo

      Hi,

       

      I've got a quick table calculation field where I show the percentage a measure represents against the total of the month (it's called the Split field).

      For example, having 10 items sold one month and 500 items sold over the year, that month would represent a 2% (=Split).

      I need to add another field to show how this Split changes over months.

      As the Split is a quick table calculation, I cannot create another quick table calculation over it, so I cannot get the desired field.

       

      Any idea on how to achieve this would be appreciated.

       

      Regards,

      Pascual

        • 1. Re: Calculate variance of quick table calculation
          Joe Oppelt

          Make your own table calculation that does the same thing as the quick table calc.  To get the code for the quick table calc, right click on that table calc in the shelf where you currently have it (whether ROW, COLUMN, Detail, whatever.)  That will put a little calc editor right in the pill you are looking at.  Select-all (Control-A) and CUT.  Then create your own calc and PASTE into the body of that calc.  Now you have your own calc instead of relying on Tableau's calc.  Then you can do another table calc using it.  (WINDOW_AVG, WINDOW_SUM, etc.)

          • 2. Re: Calculate variance of quick table calculation
            Pascual Bayo

            Thanks for your response Joe, but I couldn't achieve what I needed. Please check this image. Some rows have been hidden to ease readability. This is why grand totals may seem they don't match with summatory of rows.

             

            Captura.PNG

             

             

            For example, speaking of "Noviembre 2016", I need a third column which would be calculated as November's split / Octobers split. So, in numbers: 4.87/66.67 = 0.073

            The problem I'm facing has to do with reading previous month split. If I use lookup with -1, it gives me the previous row, nothing to do with previous month.

             

            Any idea?

             

            Thank you so much for your time!!

            • 3. Re: Calculate variance of quick table calculation
              Joe Oppelt

              You can tell a table calc how to "walk" along the table.

               

              You can specify "across" or "down".  You can specify particular dimension(s).

               

              Tableau just picks "Across" or "Down" as a default, but many times you have to override it.  And what you will need to do will be specific to your sheet, so I can't just say, "Choose MONTH as your 'compute using' setting."  (That might very well be the answer, BTW, but I really need to have a workbook to play with to know for sure.)

              • 4. Re: Calculate variance of quick table calculation
                Pascual Bayo

                Wow, you saved my life!!

                I saw the "compute using" section, but I didn't understand it worked this way. but yes, that's what I really needded.

                Thank you!!