Running Sum of Filtered Rows in Tableau

I am proposing a solution/answer assuming a few things-

  • Challenge acceptance time ends at 17:00 everyday
  • Different lines represent different challenges

Step-1 Create a CF to adjust date/time by calendar date – adjusted date as

DATEADD('hour', 7, [Date])

Note that I have added 7 hours to make the last calendar date/time for submission as 00 AM next day.

Step-2 Create another CF win_loss as

If [Success]='W' then 1 ELSE 0 end 

step-3 create another CF game points as

[win_loss]*[Points (Points)]

Step-4 create another CF first win or loss as (don’t worry about loss here)

{FIXED [Player], [Challenge], [success] : MIN([Date])} = [Date]

Step-5 create a set on ‘players’ field with TOP-3 with this formula (select top 3) by

IF [first win or loss]= TRUE
then [game points] END)

Step-6 build your view by dragging

  • set, MDY(adjusted date) & first win or loss on filters shelf/card
  • add mdy filter to context
  • [date] with exact date and discreet to columns
  • sum(game points) to rows
  • adding table calculation on measure – running total
  • right click sum(game points) click edit in shelf and replace the existing calculation by this one-
RUNNING_SUM(ZN(SUM([game points])))

(Note this will ensure your lines start at f(x)=0 always)

  • challenge on colors in marks card
  • sum(game points) to text in marks card.

Note- filters on (i) Set will ensure the top 3 players are in view only (ii) adjusted date will ensure view for 24 hour challenge submission time (iii) first win or loss will eliminate second and subsequent win(s) by same player for same challenge

I hope this will also make things clear to you.

You should get your desired view

enter image description here

OR change the date field to seconds to get a view like this

enter image description here

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top