1 Reply Latest reply on Jul 9, 2018 4:33 AM by kumar bharat

    Aggregate data in a case function

    Alex Martino

      Steve Martin gave me the instructions below for a waterfall chart. He is summing columns essentially. In my data set, I need to have measures that are calculated FROM columns (so they are already aggregated).

       

      Will it work the same way if I just remove the (SUM)?

       

       

      // Now we have some fields, uses the index() function to plot our values against

      // We need to use the Total() function to ensure all values in the set are brought through otherwise

      // Tableau would break these values down to those of a non-existent set

       

       

      Case Index()

          When 1 Then Total(Sum(Sales))

          When 2 Then Total(Sum(Profit))

          When 3 Then Total(Sum([Unit Price]))

          When 4 Then Total(Sum([Shipping Cost]))

      End