1 Reply Latest reply on Jul 23, 2013 3:09 AM by Jim Wahl

    Multi-period table calculations

    Trace Hancock

      Hello,

       

      I'm trying to replicate a table that looks something like this (below) in Tableau. I've searched everywhere and can't figure out how to do it. Any ideas? Thanks.

       

      Sales
      Week to DateMonth to DateYear to Date
      Cars$                     25,000$                  325,000$            24,375,000
      Boats$                       6,250$                  162,500$               1,950,000
      Total$                     31,250$                  487,500$            26,325,000
        • 1. Re: Multi-period table calculations
          Jim Wahl

          You can build a measure for each period, for example:

          Sales YTD =

          IF YEAR([Order Date]) == YEAR(TODAY()) AND
            (MONTH([Order Date]) < MONTH(TODAY()) OR
            (MONTH([Order Date]) == MONTH(TODAY()) AND DAY([Order Date]) <= DAY(TODAY())))
          THEN
            [Sales]
          END
          

           

          Sales MTD =

          IF YEAR([Order Date]) == YEAR(TODAY()) AND MONTH([Order Date]) = MONTH(TODAY()) AND 
                 DAY([Order Date]) <= DAY(TODAY())
          THEN 
             [Sales]
          END
          

           

          Sales WTD =

          IF YEAR([Order Date]) == YEAR(TODAY()) AND MONTH([Order Date]) == MONTH(TODAY()) AND
            DATEPART('week',[Order Date]) == DATEPART('week', TODAY()) AND 
            DAY([Order Date]) <= DAY(TODAY())
          THEN 
             [Sales]
          END
          

           

           

          Then add the measure values to rows, measure names to columns. ...

           

          2013-07-23 13-07-57.png

          1 of 1 people found this helpful