4 Replies Latest reply on Jun 21, 2016 7:54 AM by Pierre-Marie Airiau

    Aggregate rows in a time interval to the last date of the interval

    Pierre-Marie Airiau



      I have a question about something that seems quite simple for the human point of vue, but that I just cannot find how to do in Tableau.


      I have a table in a relational database linked to Tableau, whose lines describe contracts signed at a certain date. Each line has a timestamp attribute of the type "year-month-day" for the date of the contract, and an integer attribute with the expected profit.

      What I want to do is calculate, for each day, the sum of expected profits done in the past 30 days. This represented in a plot with on the horizontal axis the calendar (year-month-day) and on the vertical axis the sum of expected profit in the last 30 days, to view the variation of expected profit in intervals of 30 days over time. For example, I want to display on the 20/04/2016 value the profit done since 20/03/2016, and on the 21/04/2016 value the profit done since the 21/03/2016, etc...

      The problem is that if I put the date attribute in the column field on Tableau, then the calculation that will be done for each date in the line field will only be about the data sharing the exact date. I find no way to do calculation displayed at one date value of a time attribute, resulting of an aggregation on a date interval done with the same time attribute.

      (I managed to do the calculation for one date at a time with a parameter, but I want to display all dates in a single plot).


      If anyone have any advises about how to do this, that would be very helpful to me,