11 Replies Latest reply on Jul 2, 2013 11:35 AM by Cristian Vasile

    Count distinct with Google Bigquery not working

    Benjamin DELORME

      Hello,

       

      I'm using Google bigquery as datasource, and i would like to control my data by checking if the Number of rows is equal to the Count distinct on my primary ID column. Theorically yes it should.

      Here is my database schema :

      - visitor_id ( unique ID, integer )

      - first_name (string)

      - last_name (string)

      - created_at (timestamp)

       

      When I calculate the count distinct with a basic sql request, I get the same result as the number of rows.

      But when I calculate the count distinct with Tableau 8, I get the following results:

      - SUM(Number of rows) -> 218.570

      - CNTD(visitor_id) -> 215.487

      I don't do anything else on my workbook, no filters, etc..

       

      So I don't understand how Tableau 8 is calculating... why the two values aren't the same?

       

      Thanks for your help.