title: Aggregate an Running Sum in Tableau?
body: <p>I have a simple data set showing the number of points scored by a player.  It is plotted across a [Week Number] x-axis.  I added a Running Sum calculation, as a Line, split by Player (color).<br>
  <a href="https://i.stack.imgur.com/7H3Ys.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7H3Ys.png" alt="Running Sums by Week"></a></p>
  
  <p>For each week, I would like to identify the top player, by total points achieved to-date.<br>
  For example, in Week 3, the top player was GREEN with a running total of 8 points.</p>
  
  <p>I tried creating a LOD function <code>{FIXED [WEEK]: MAX(RunningSum)}</code> but it complains that I cannot aggregate an aggregate.<br>
  I tried WINDOW_MAX(), RANK(), and tried adjusting the Table Calc, Advanced, Partitioning and Addressing feature.</p>
  
  <p>Is there no way to identify the MAX of a collection of running totals, by discrete [Week Number]?</p>
  
  <p>This can be done fairly easily in TSQL by wrapping a query in outer queries and applying Window functions with partitions defined.</p>