Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Count Distinct in Group By Step

  1. #1
    Join Date
    Aug 2007
    Posts
    15

    Question Count Distinct in Group By Step

    Hi,

    How does one do a count(distinct) in a Group By Step?

    Thanks,

    -Dipin

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    "Number of values" as type?

    Sven

  3. #3
    Join Date
    Aug 2007
    Posts
    15

    Default

    The "Number of Values" type seems to just count the number of records going into the Group By step.

    Is there possibly another step that might accomplish a count distinct?

    Thanks,

    -Dipin

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    You must be doing something wrong then... it works for me. Example attached.

    Regards,
    Sven
    Attached Files Attached Files

  5. #5
    Join Date
    Aug 2007
    Posts
    15

    Default

    Sven,

    I get the following when I preview the dummy step:

    key1 key2 cnt
    a b 3
    a c 1
    a d 2


    While when I look at the data it seems as though the count for key1=a and key2=b should be 2 if it is a distinct count.

    Could this be a bug?

    If it makes any difference, I'm running kettle 2.5.0 on Max OS X at the moment.

    Thanks,

    -Dipin

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    So it seems... it seems to work on key2 in this case. You can always open a bugtracker at http://jira.pentaho.org

    Regards,
    Sven

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.