3 Replies Latest reply on May 31, 2015 11:45 PM by Tableau kumar

    datediff issue

    tableau gstl

      Hi All,

       

      I am trying to calculate datediff between min date for any id even when repeated to till date (Today)

      and keep them into different bins

       

      Steps:

      Created datediff('day',[Date],[Today])

      However it is not considering the min date when the same id has multiple dates

       

      Created datediff('day',min([Date]),[Today])

      Now this considers min date but the problem is we need to have id onto the which should not be visible in my case as I am trying to show aggregated data

       

      Also tried

      IF FIRST() = 0

      THEN DATEDIFF('day',WINDOW_MIN(MIN([Order Date])),WINDOW_MAX(MAX([Order Date])))

      END

       

      Even this needs id to be there on the view

       

      Attached sample workbook

      Thanks in advance

        • 1. Re: datediff issue
          Tableau kumar

          Hi,

           

          I have created calculation with respect to few Customers.

          What I did is, Date difference between First Order Date and today.

           

          The following link will help you for your situation.

          | Tableau Public

           

          Best Regards

          Laxman Kumar

          • 2. Re: datediff issue
            tableau gstl

            Hey Kumar,

             

            Thanks for the reply

             

            As mentioned in my initial post i would not like to have my id's or dates in my view as i am showing aggregated data based on the field called "Source"

             

            If I place id in my view i can achieve what i am trying to but the client want it other way with only source as a breakdown

             

            please check my sample workbook attached may be u get what i am trying to achieve

             

            Sorry I forgot to mention that my current version is tableau 8.3

             

            please suggest

            • 3. Re: datediff issue
              Tableau kumar

              Hi,

               

              I am using Tableau Public at my Office, so i can't download & Use your Workbook. So Publish your workbook to Tableau Public & send the Link.

              I am guessing this point will help you, If you don't want to show IDs on the report, right click on that column in the view, click on "Show Header" then this column will be hidden from report but it is part of Report.

               

               

              Best Regards

              Laxman Kumar