0 Replies Latest reply on Dec 5, 2018 8:25 AM by Elif Evyapan

    Getting Column Grand Total on Calculated Field

    Elif Evyapan

      I've read through some of the issues of grand totals when aggregating calculated fields, and how tableau struggles with averages, mins, and maxes since it calculates across and not strictly the total of all values below.

      The solutions did not work for me (window_sums, TOTAL() function, etc) since I am using blended data. My calculation contains a min nested within a max, based on several other columns. Below is my function. How can I get the correct column total?

       

      MAX(0,

       

       

          MIN(

              SUM(ZN([Supply (Receipts)].[Supply  Qty End])),

             

              ZN([Inv 2 Start Qty]) +

              SUM(ZN([Supply (Receipts)].[Supply  Qty End])) +

              SUM(ZN([Demand (ASCP)].[Demand Qty End])) +

              SUM(ZN([Demand (ASCP)].[Manual Demand & Fcst MDS Qty End])) -

              SUM(ZN([Safety/Minimum Stock]))

              )

          )

       

      Elif