2 Replies Latest reply on Jan 25, 2019 12:16 PM by Joe Oppelt

    How can I get distinct count from my dataset?

    Eric Sammons

      I'm relatively new to Tableau and am currently trying to build a viz using data from our data lake where one bug_id (or issue_key) may have dozens of rows.  I need to count the row one time for the qualifying period.

       

      Basically, I am trying to get my viz to show results that I see when I execute the following query:

      select DISTINCT jira.issue_key from DATA_LAKE.jira_data jira
      WHERE   
      jira.project = [PROJET]
      AND jira.target_release = [VERSION]
      AND jira.month_end_date BETWEEN '2018-09-01' AND '2018-09-30'
      AND jira.defect_backlog_day_flag = 'true'
      

       

      When I execute the above I get back four issue_keys.  However, in the chart I'm trying to create I get 2.  The data is formatted as follows:

      project (string)
      bug_id (string)
      month_end_date
      defect_backlog_day_flag (string)issue_key (string)
      target_release (string)
      PROJ12121_jira12/31/2018truePROJ_1234

      1.0

      PROJ12121_jira01/30/2019truePROJ_12341.0
      PROJ12121_jira02/28/2019falsePROJ_12341.0
      PROJ12122_jira12/31/2018truePROJ_12351.0

       

      Given the above, a sample representation, Tableau will convert all the true|false to 1s and 0s (still as string values) all the above will become dimensions.  I create a calculated field with the following logic:

      IF [defect_backlog_day_flag] = "1"
      THEN
      1
      ELSE
      0
      END
      

       

      I have also attempted to convert defect_backlog_day_flag to a measure with data type whole number.  In either case, I do not get the anticipated results.  I am setting my Columns to month_end_date (with Month / Year formatting) and Rows are set to CNTD(defect_backlog_day_flag calculated). 

       

      If anyone has suggestions?  I'm also going to try to extract a smaller data set and play around with that...