5 Replies Latest reply on Sep 5, 2018 1:15 PM by Deepak Rai

    Totals of Totals

    morton hsiao

      I have this table:

      where totalone and totaltwo are totals for all of measure one and two regardless of which table or pane its in.  They should be the same number anywhere and they are.  I made it with total(sum(one)).  Then I had a function total_delta which is [totalone]-[totaltwo].  I figured it was straight forward, but no matter the choices, I can' t get [totalone]-[totaltwo] to equal -135, which is the real answer and should be the same across all the panes etc.  I've attached my workbook.  Please help.  Also, so I understand this better, what features are tableau enabling with the across adn then down vs down and then across calculation order?

        • 1. Re: Totals of Totals
          Deepak Rai

          How are you expecting -135 and where?

          • 2. Re: Totals of Totals
            morton hsiao

            I did this quickly, sorry, I actually meant -225 everywhere 15-240.  Sorry, I'm actually having an even bigger problem connecting to postgres views.  The tables are fine, views, not so much.

            • 3. Re: Totals of Totals
              morton hsiao

              No, solved the view issue.  Still haven't solve the functions on table functions

              • 4. Re: Totals of Totals
                morton hsiao

                Holy good gravy!  I must be the only one in America with these questions.  Anyway, I found the solution.  It is the realization that a table function of a table function are called nested table functions and when you have a table function of table functions, the "direction" of the inside table function has to be set on the outside table function

                I have this:

                total_delta = [total_actual] - [total_bc]

                total_actual = total(sum(actual))

                total_bc = total(sum(bc))


                BUT if you put total_delta in the table with total_actual and total_bc, the computer does not look at the total_actual and total_bc values in table to calculate delta like it would a window function.  It's like DAX.  It recalculates total_delta from scratch even after it calculated total_actual and total_bc elsewhere in the table.  Thus, you must set the directoin of both total_actual and total_bc individually here:

                It used to be that words mean something, but in tableau, apparently variables do not.  These aren't really variables, they're labels for underlying calculations.  Stil

                • 5. Re: Totals of Totals
                  Deepak Rai

                  I was getting -225 , but you said -135 so I asked you that question earlier. But anyway, you got the answer through your efforts.