2 Replies Latest reply on Jul 20, 2016 4:23 PM by Drew Pihlainen

    Create a calculated measure which is a sum by group

    Drew Pihlainen

      Hi All,

       

      I'm trying to do in Tableau what would be equivalent to the AGGREGATE with mode=addvariables in SPSS. A simple example is below:

       

      Original Dataset

      ID     Name     Income

      1     John          1000

      1     John          2000

      2     Cindy          500

      2     Cindy          1000

      3     Mel          3000

      3     Mel          0

      4     Raul          2000

      4     Raul          500

       

      I'd like to Create a new measure (call it, "Total Income"), which is a sum by ID, and would result in the following:

      ID     Name     Income     Total Income

      1     John          1000          3000

      1     John          2000          3000

      2     Cindy          500          1500

      2     Cindy          1000          1500

      3     Mel          3000               3000

      3     Mel          0                    3000

      4     Raul          2000          2500

      4     Raul          500               2500

       

      Any help is appreciated-- thanks!

       

      Cheers,

       

      Drew