3 Replies Latest reply on Apr 20, 2017 6:33 AM by Alex Braun

    Time based calculations

    Viresh Kolagimath

      Hi All,


      I am using the sample data  Global Super Store, which is available along with tableau installation.


      I would like to see the data as per the below image. Please let me know how to achieve the below output.






        • 1. Re: Time based calculations
          Galen Busch

          Hi Viresh,


          That is a tricky table to tackle! Tableau, being a data visualization tool, isn't going to be able to go ***-for-tat with Excel (nor are they at all interested in doing so!)


          If you're open to visualization that data, I'd love to help!

          • 2. Re: Time based calculations
            Viresh Kolagimath



            It would be great i am able replicate somewhat similar to the above output. Please let me know what other alternative do i have.


            thank you.

            • 3. Re: Time based calculations
              Alex Braun

              The way you can do this is by creating separate fields for the different blocks of time, now it won't give you the visual like above, but it can give you a total for the range.


              For each date range/metric you want, you need to create a time filtered calculation

              Current Week - IF Datetrunc('week',today()) = datetrunc('week',[date]) then Orders end


              Previous Week IF datetrunc('week',today())-7 = datetrunc('week',[date] then Orders end


              MTD IF datetrunc('Month',today()) = datetrunc('month',[date]) then Orders end


              Then if you sum these, it would give you the total number of Orders in that period of time.