0 Replies Latest reply on Aug 14, 2013 5:14 AM by Jonathan MacDonald

    Using count distinct on segmented data to give total sample size as opposed to range

    Jonathan MacDonald

      Hi there,

       

      I'm a big fan of these forums and I usually find the answer in a post when I do a search, but this one has had me stumped for a few days now and I can't seem to find a posted solution - do forgive me in advance if this has already been addressed elsewhere.

       

      I am working with survey data and I am trying to add a 'sample size' (n=X) to the caption of a chart so that users can see the total number of responses represented in one view. To do this I have created a data extract and I am using the Count Distinct function on a unique ResponseID. This works in some cases to provide the total sample, however, when I segment the data in the view, for example, by cutting it with some additional dimensions or measures, I end up getting a range instead of an absolute value.

       

      I've attached a sample workbook that outlines the issue.

       

      I guess my question is: what calculation can I do to only show the total number of responses represented in the current view? This will be subjected to a number of filters, so it would be good to have a dynamic total sample size that changes when it is filtered.

       

      Thanks,

      J