2 Replies Latest reply on Jul 20, 2012 8:24 AM by Cody Smith

    weeks or days since last entry or sale

    Cody Smith

      I'm trying to calculate the weeks since last sale for each item. I know how to do it in Excel, which I've attached, but can't figure out how to do it in Tableau. In the excel file, column C is what I'm trying to figure out on how to transfer that calculation into Tableau.

       

      The Weeks Since Last Sale.png file is what I'm trying to accomplish in the attached .twbx file.

        • 1. Re: weeks or days since last entry or sale
          Russell Christopher

          You want to use the DateDiff() expression. See attached, sheet3.

          • 2. Re: weeks or days since last entry or sale
            Cody Smith

            Sorry, I may not have full explained what I'm trying to do. Ultimately, I'm trying to figure out how to have everything displayed on the Final Report tab in the workbook where there is a single week in a compact list drop-down and it will tell me how many weeks since that last item sold in that single location.

             

            Below is 2 examples of what I'm trying to do:

             

            Ex1: Compact List shows 07/10/12

             

            Markets    Products    Weeks since Last Sale

            Alpharetta    UPC 1             1

            Alpharetta    UPC 2             0

             

            Ex1: Compact List shows 06/26/12

             

            Markets    Products    Weeks since Last Sale

            Alpharetta    UPC 1             3

            Alpharetta    UPC 2             2

             

            It would correlate with the data on the Report 1 tab as shown on the attached Weeks Since.png file