3 Replies Latest reply on Sep 27, 2017 10:32 AM by Deepak Rai

    Summing Across Equivalent Dimensions

    Taylor Losi

      I am working with some data surrounding sports teams in a professional sports league. My data is set up by game, so each gameID has a corresponding home team and visiting team. For most of my analyses, I am using the home team as my indicator and summing my values, but for one of my metrics, I need the total for all games that the team played. For example, I need the total TV viewership for the Los Angeles Rams when they were playing at home and away. There is no overall variable for "Team," so I can't just sum by Los Angeles Rams. I would have to sum when the home team equals LA Rams OR the away team equals LA Rams. I would also like to compile all teams into one chart, so creating individual indicators won't really work.

       

      Is there a way for me to sum values (TV viewership) across equivalent dimensions (Home and Away team) without changing the data set? By equivalent dimensions, I mean two dimensions that contain the same values, so the Home and Away dimensions contain the same list of team names as potential values.

       

      Could I use a window sum somehow?