4 Replies Latest reply on Aug 27, 2012 9:44 AM by aung.myo

    Calculating COUNTD back-to-back

      I am new user of Tableau and I couldn't figure out how to solve an issue I face with. I looked at some community posts with similar issue, and I don't think those posts address my problem...or I still don't understand how it works.

       

      Here is the data I have:

      Date,ID

      8/1/2012 12:00:00 AM,100

      8/1/2012 12:00:00 AM,100

      8/1/2012 12:00:00 AM,101

      8/1/2012 12:00:00 AM,102

      8/1/2012 12:00:00 AM,103

      8/2/2012 12:00:00 AM,100

      8/2/2012 12:00:00 AM,101

      8/2/2012 12:00:00 AM,104

      8/2/2012 12:00:00 AM,104

      8/2/2012 12:00:00 AM,104

      8/3/2012 12:00:00 AM,101

      8/3/2012 12:00:00 AM,102

      8/3/2012 12:00:00 AM,102

      8/3/2012 12:00:00 AM,103

      8/3/2012 12:00:00 AM,103

      8/4/2012 12:00:00 AM,103

      8/4/2012 12:00:00 AM,103

      8/4/2012 12:00:00 AM,104

      8/4/2012 12:00:00 AM,105

       

      It shows the date and time that the customer login to the system. What I want to create is a histogram based on the number of visits customers had within a given time. For example, above data set should return a graph for...

       

      Number of visits,Number of ID

      1,1

      2,3

      3,2

       

      Original data wold be accessed from a tableau server. I could only get to the step as you can see here. I can count visually how many people have visited one, two or three times. How can I get one step further? Thanks in advance.

       

      Aung

       

      http://public.tableausoftware.com/static/images/ID/ID_Date/Sheet1/1.png

        • 1. Re: Calculating COUNTD back-to-back
          Dustin Smith

          Hi Aung,

           

          Alright, you stumped me.   I think I need a better understanding of what you're hoping the final output looks like.  Anyway you can mock something up in Excel or even in MS Paint so I can get a clearer picture of your vision?

           

          Thanks,

          Dustin

          • 2. Re: Calculating COUNTD back-to-back

            Hi Dustin,

             

            Thanks for looking into my question. I added a dashboard here to explain more. There are three pieces of information.

            1) Source data and explanation of it

            2) The graph I could create using the source data

            3) The graph I actually want to get. I got this graph by exporting the graph in 2) into excel and import it again as a different datasource. I want to get such a graph by using original source data without having to export and import.

             

            Thanks,

            Aung

             

            http://public.tableausoftware.com/static/images/ID/ID_Date/Dashboard1/1.png

            • 3. Re: Calculating COUNTD back-to-back
              Dustin Smith

              Hi Aung,

               

              Thanks for the clarification.  I think I have the answer.  The trick is to first move your ID field from Measures to Dimensions and then use it as a measure (count distinct aggregation) and then also in the level of detail left as a dimension.  Also, using your date field as a discrete measure and aggregating it to count distinct as well.

               

              I made a short video that hopefully demonstrates the solution much better than my explanation.    I've also attached the workbook to this reply.

              • 4. Re: Calculating COUNTD back-to-back

                Thank you, Dustin. That exactly solves the problem I am having