4 Replies Latest reply on Mar 21, 2013 2:35 AM by Dana Withers

    CountD problem

    Ken Gross

      I used the CountD function on a variable indicating patient id. The patient id's can repeat in the data set because each record is a visit.  I want to be able to have a count of say the total # of asthma visits and the total number of unique patients with an asthma visit.  After I did the calculation and then put the unique count data into a view I took a look at the underlying data to make sure that it showed only unique patient ids. I found that many id's repeated in the underlying data set, therefore the countd did not count unique id's.  Any ideas on why this would happen?

        • 1. Re: CountD problem
          Ashley Howard

          Can you upload a twbx file so we can see what is going on?

          • 2. Re: CountD problem
            Dana Withers

            Hi Ken,

             

            If you are choosing to look at the "underlying" tab of the view data option, it is correct that data there is not distinct. It is the underlying data set that you base your information on. That data set is taken straight from source, so it contains all doubles, however it will not count the doubles multiple times.

            Have you tried copying that data set and manually verifying the count?

             

            Dana

            • 3. Re: CountD problem
              Ken Gross

              Thank you Dana. You are correct I had been using the "underlying" tab. I have not tried copying the data set and verifying the count. Not clear on how that would work. I thought the CountD does the count on the fly when needed in the view that I place it into. How do I access underlying data that would show me the unique id's according to the countd procedure.

              • 4. Re: CountD problem
                Dana Withers

                Hi Ken,

                 

                I think you are absolutely right that it counts it on the fly - which is why it is hard to pinpoint.

                In attached workbook you can see how it counts the unique numbers and how it works in the view. specially when you drill down further.

                I am not quite sure how to best see if the count is correct. I think if I were to do this on a workbook in our own data set I'd drill down, get the underlying view to excel and take it from there or limit my view (query or excel file) to only a couple of records that I can easily verify and check it there. If it works in small versions and I know it is correct and it will not be changed further, then I trust it will stay correct in bigger data set.

                 

                Hope that helps,

                 

                Dana